Skip to content

Commit 810cd03

Browse files
committed
Merge remote-tracking branch 'origin/master' into v1.7.0
2 parents 811fc7c + e2af643 commit 810cd03

File tree

34 files changed

+271
-104
lines changed

34 files changed

+271
-104
lines changed

ChangeLog.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,34 @@ Behavior changes:
1111

1212
Other enhancements:
1313

14+
* `stack unpack` now supports a `--to /target/directory` option to
15+
specify where to unpack the package into
16+
* `stack hoogle` now supports a new flag `--server` that launches local
17+
Hoogle server on port 8080. See
18+
[#2310](https://github.com/commercialhaskell/stack/issues/2310)
19+
1420
Bug fixes:
1521

22+
* When a package contained sublibraries, stack was always recompiling the
23+
package. This has been fixed now, no recompilation is being done because of
24+
sublibraries. See [#3899](https://github.com/commercialhaskell/stack/issues/3899).
25+
* The `get-stack.sh` install script now matches manual instructions
26+
when it comes to Debian/Fedora/CentOS install dependencies.
27+
* Compile Cabal-simple with gmp when using Nix.
28+
See [#2944](https://github.com/commercialhaskell/stack/issues/2944)
29+
* `stack ghci` now replaces the stack process with ghci. This improves
30+
signal handling behavior. In particular, handling of Ctrl-C. To make
31+
this possible, the generated files are now left behind after exit.
32+
The paths are based on hashing file contents, and it's stored in the
33+
system temporary directory, so this shouldn't result in too much
34+
garbage. See
35+
[#3821](https://github.com/commercialhaskell/stack/issues/3821).
36+
* 1.6.1 introduced a change that made some precompiled cache files use
37+
longer paths, sometimes causing builds to fail on windows. This has been
38+
fixed. See [#3649](https://github.com/commercialhaskell/stack/issues/3649)
1639

17-
## v1.7.0.1 (release candidate)
1840

19-
Release notes:
41+
## v1.7.0.1 (release candidate)
2042

2143
Major changes:
2244

@@ -91,9 +113,6 @@ Bug fixes:
91113
## v1.6.5
92114

93115
Bug fixes:
94-
* 1.6.1 introduced a change that made some precompiled cache files use
95-
longer paths, sometimes causing builds to fail on windows. This has been
96-
fixed. See [#3649](https://github.com/commercialhaskell/stack/issues/3649)
97116
* Some unnecessary rebuilds when no files were changed are now avoided, by
98117
having a separate build cache for each component of a package. See
99118
[#3732](https://github.com/commercialhaskell/stack/issues/3732).

doc/GUIDE.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,15 @@ Unpacked yackage-0.8.0 to /var/home/harendra/yackage-0.8.0/
517517
cueball:~$ cd yackage-0.8.0/
518518
```
519519

520+
Note that you can also unpack to the directory of your liking instead of
521+
the current one by issueing:
522+
523+
```
524+
cueball:~$ stack unpack yackage-0.8.0 --to ~/work
525+
```
526+
527+
This will create a `yackage-0.8.0` directory inside `~/work`
528+
520529
### stack init
521530
This new directory does not have a `stack.yaml` file, so we need to make one
522531
first. We could do it by hand, but let's be lazy instead with the `stack init`
@@ -1715,7 +1724,8 @@ users. Here's a quick rundown:
17151724
upstream packages available).
17161725
* `stack unpack` is a command we've already used quite a bit for examples, but
17171726
most users won't use it regularly. It does what you'd expect: downloads a
1718-
tarball and unpacks it.
1727+
tarball and unpacks it. It accept optional `--to` argument to specify
1728+
the destination directory.
17191729
* `stack sdist` generates an uploading tarball containing your package code
17201730
* `stack upload` uploads an sdist to Hackage. As of
17211731
version [1.1.0](https://docs.haskellstack.org/en/v1.1.0/ChangeLog/) stack

doc/install_and_upgrade.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Distribution packages are available for [Ubuntu](#ubuntu), [Debian](#debian),
1414
[Fedora](#fedora),
1515
[Arch Linux](#arch-linux) and [FreeBSD](#freebsd).
1616
Binaries for other operating systems are listed below, and available on
17-
[the Github releases page](https://github.com/fpco/stack/releases). For the
17+
[the GitHub release page](https://github.com/fpco/stack/releases). For the
1818
future, we are open to supporting more OSes (to request one, please
1919
[submit an issue](https://github.com/commercialhaskell/stack/issues/new)).
2020

@@ -175,7 +175,7 @@ install it by simply doing:
175175
sudo pacman -S stack
176176

177177
Note that this version may slightly lag behind, but it should be updated within
178-
the day. The package is also always rebuilt and updated when one of it's
178+
the day. The package is also always rebuilt and updated when one of its
179179
dependencies gets an update.
180180

181181
- [stack](https://www.archlinux.org/packages/community/x86_64/stack/) _latest stable version_

doc/yaml_configuration.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,6 @@ does not rely on correct ordering in the package index, while revision
164164
number is likely simpler to use. In practice, both should guarantee
165165
equally reproducible build plans.
166166

167-
If unspecified, `subdirs` defaults to `['.']` (i.e. look only in the top-level
168-
directory). Note that if you specify a value of `subdirs`, then `'.'` is _not_
169-
included by default and needs to be explicitly specified if a required package
170-
is found in the top-level directory of the repository.
171-
172167
#### Local file path
173168

174169
Like `packages`, local file paths can be used in `extra-deps`, and
@@ -231,8 +226,11 @@ extra-deps:
231226
- wai
232227
```
233228

234-
If unspecified, `subdirs` defaults to `subdirs: [.]`, or looking for a
235-
package in the root of the repo.
229+
If unspecified, `subdirs` defaults to `['.']` meaning looking for a
230+
package in the root of the repo.. Note that if you specify a value of
231+
`subdirs`, then `'.'` is _not_ included by default and needs to be
232+
explicitly specified if a required package is found in the top-level
233+
directory of the repository.
236234

237235
#### Archives (HTTP(S) or local filepath)
238236

etc/scripts/get-stack.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ do_ubuntu_install() {
164164
do_debian_install() {
165165

166166
install_dependencies() {
167-
apt_install_dependencies g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev
167+
apt_install_dependencies g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev git gnupg
168168
}
169169

170170
if is_arm ; then
@@ -188,7 +188,7 @@ do_debian_install() {
188188
# and install the necessary dependencies explicitly.
189189
do_fedora_install() {
190190
install_dependencies() {
191-
dnf_install_pkgs perl make automake gcc gmp-devel libffi zlib xz tar
191+
dnf_install_pkgs perl make automake gcc gmp-devel libffi zlib-devel xz tar git gnupg
192192
}
193193

194194
if is_64_bit ; then
@@ -208,7 +208,7 @@ do_fedora_install() {
208208
# and install the necessary dependencies explicitly.
209209
do_centos_install() {
210210
install_dependencies() {
211-
yum_install_pkgs perl make automake gcc gmp-devel libffi zlib xz tar
211+
yum_install_pkgs perl make automake gcc gmp-devel libffi zlib xz tar git gnupg
212212
}
213213

214214
if is_64_bit ; then

src/Stack/Build/Cache.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ buildCacheFile dir component = do
120120
let nonLibComponent prefix name = prefix <> "-" <> T.unpack name
121121
cacheFileName <- parseRelFile $ case component of
122122
CLib -> "lib"
123+
CInternalLib name -> nonLibComponent "internal-lib" name
123124
CExe name -> nonLibComponent "exe" name
124125
CTest name -> nonLibComponent "test" name
125126
CBench name -> nonLibComponent "bench" name

src/Stack/Build/Execute.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,11 +1317,12 @@ singleBuild ac@ActionContext {..} ee@ExecuteEnv {..} task@Task {..} installedMap
13171317
])
13181318
(const (return ()))
13191319

1320-
readProcessNull ghcPkgExe
1320+
void $ proc ghcPkgExe
13211321
[ "register"
13221322
, "--force"
13231323
, libpath
13241324
]
1325+
readProcess_
13251326
liftIO $ forM_ exes $ \exe -> do
13261327
D.createDirectoryIfMissing True bindir
13271328
let dst = bindir FP.</> FP.takeFileName exe

src/Stack/Build/Installed.hs

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -230,25 +230,37 @@ isAllowed opts mcache sourceMap mloc dp
230230
| otherwise =
231231
case Map.lookup name sourceMap of
232232
Nothing ->
233-
case mloc of
234-
-- The sourceMap has nothing to say about this global
235-
-- package, so we can use it
236-
Nothing -> Allowed
237-
Just ExtraGlobal -> Allowed
238-
-- For non-global packages, don't include unknown packages.
239-
-- See:
240-
-- https://github.com/commercialhaskell/stack/issues/292
241-
Just _ -> UnknownPkg
242-
Just pii
243-
| not (checkLocation (piiLocation pii)) -> WrongLocation mloc (piiLocation pii)
244-
| version /= piiVersion pii -> WrongVersion version (piiVersion pii)
245-
| otherwise -> Allowed
233+
-- If the sourceMap has nothing to say about this package,
234+
-- check if it represents a sublibrary first
235+
-- See: https://github.com/commercialhaskell/stack/issues/3899
236+
case dpParentLibIdent dp of
237+
Just (PackageIdentifier parentLibName version') ->
238+
case Map.lookup parentLibName sourceMap of
239+
Nothing -> checkNotFound
240+
Just pii
241+
| version' == version -> checkFound pii
242+
| otherwise -> checkNotFound -- different versions
243+
Nothing -> checkNotFound
244+
Just pii -> checkFound pii
246245
where
247246
PackageIdentifier name version = dpPackageIdent dp
248247
-- Ensure that the installed location matches where the sourceMap says it
249248
-- should be installed
250249
checkLocation Snap = mloc /= Just (InstalledTo Local) -- we can allow either global or snap
251250
checkLocation Local = mloc == Just (InstalledTo Local) || mloc == Just ExtraGlobal -- 'locally' installed snapshot packages can come from extra dbs
251+
-- Check if a package is allowed if it is found in the sourceMap
252+
checkFound pii
253+
| not (checkLocation (piiLocation pii)) = WrongLocation mloc (piiLocation pii)
254+
| version /= piiVersion pii = WrongVersion version (piiVersion pii)
255+
| otherwise = Allowed
256+
-- check if a package is allowed if it is not found in the sourceMap
257+
checkNotFound = case mloc of
258+
-- The sourceMap has nothing to say about this global package, so we can use it
259+
Nothing -> Allowed
260+
Just ExtraGlobal -> Allowed
261+
-- For non-global packages, don't include unknown packages.
262+
-- See: https://github.com/commercialhaskell/stack/issues/292
263+
Just _ -> UnknownPkg
252264

253265
data LoadHelper = LoadHelper
254266
{ lhId :: !GhcPkgId

src/Stack/Build/Source.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ splitComponents =
167167
where
168168
go a b c [] = (Set.fromList $ a [], Set.fromList $ b [], Set.fromList $ c [])
169169
go a b c (CLib:xs) = go a b c xs
170+
go a b c (CInternalLib x:xs) = go (a . (x:)) b c xs
170171
go a b c (CExe x:xs) = go (a . (x:)) b c xs
171172
go a b c (CTest x:xs) = go a (b . (x:)) c xs
172173
go a b c (CBench x:xs) = go a b (c . (x:)) xs
@@ -434,9 +435,9 @@ getPackageFilesForTargets
434435
-> Set NamedComponent
435436
-> RIO env (Map NamedComponent (Set (Path Abs File)), [PackageWarning])
436437
getPackageFilesForTargets pkg cabalFP nonLibComponents = do
437-
(_,compFiles,otherFiles,warnings) <-
438+
(components',compFiles,otherFiles,warnings) <-
438439
getPackageFiles (packageFiles pkg) cabalFP
439-
let components = Set.insert CLib nonLibComponents
440+
let components = M.keysSet components' `Set.union` nonLibComponents
440441
componentsFiles =
441442
M.map (\files -> Set.union otherFiles (Set.map dotCabalGetPath files)) $
442443
M.filterWithKey (\component _ -> component `Set.member` components) compFiles

src/Stack/Build/Target.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ resolveRawTarget globals snap deps locals (ri, rt) =
230230
-- Helper function: check if a 'NamedComponent' matches the given 'ComponentName'
231231
isCompNamed :: ComponentName -> NamedComponent -> Bool
232232
isCompNamed _ CLib = False
233+
isCompNamed t1 (CInternalLib t2) = t1 == t2
233234
isCompNamed t1 (CExe t2) = t1 == t2
234235
isCompNamed t1 (CTest t2) = t1 == t2
235236
isCompNamed t1 (CBench t2) = t1 == t2

0 commit comments

Comments
 (0)