Skip to content

Commit ce15bd8

Browse files
authored
Merge branch 'master' into drop-ghcrts-env-var
2 parents a1b7d47 + 839378a commit ce15bd8

114 files changed

Lines changed: 2007 additions & 949 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ tags
2323
/_site/
2424
/.dir-locals.el
2525
/.git/
26+
/stack.cabal
27+
/etc/scripts/stack-scripts.cabal

.hlint.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
- ignore: {name: "Use &&&"}
1717
- ignore: {name: "Redundant compare"}
1818

19+
# Added in hlint-2.0.10, ignoring for now
20+
- ignore: {name: "Unnecessary hiding"}
21+
- ignore: {name: "Use lambda-case"}
22+
1923
- ignore: {name: "Use fewer imports", within: [
2024
"System.Process.Read", # Related to 'Hide post-AMP warnings' comment
2125
"Stack.Exec" # ifdef for System.Process.Read

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ cache:
1919
matrix:
2020
fast_finish: true
2121
include:
22-
- env: BUILD=cabal STACK_YAML=stack.yaml CABALVER=1.24 GHCVER=8.0.2
23-
compiler: ": #GHC 8.0.2"
24-
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
22+
# FIXME: Removing because the build keeps timing out.
23+
# - env: BUILD=cabal STACK_YAML=stack.yaml CABALVER=1.24 GHCVER=8.0.2
24+
# compiler: ": #GHC 8.0.2"
25+
# addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
2526

2627
- env: BUILD=stack GHCVER=8.0.2 STACK_YAML=stack.yaml
2728
compiler: ": #stack 8.0.2"

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ discuss the change before plowing into writing code.
4444

4545
If you'd like to help out but aren't sure what to work on, look for issues with
4646
the
47-
[awaiting pr](https://github.com/commercialhaskell/stack/issues?q=is%3Aopen+is%3Aissue+label%3A%22awaiting+pr%22)
47+
[awaiting pull request](https://github.com/commercialhaskell/stack/issues?q=is%3Aopen+is%3Aissue+label%3A%22awaiting+pull+request%22)
4848
label. Issues that are suitable for newcomers to the codebase have the
49-
[newcomer](https://github.com/commercialhaskell/stack/issues?q=is%3Aopen+is%3Aissue+label%3A%22awaiting+pr%22+label%3Anewcomer)
49+
[newcomer friendly](https://github.com/commercialhaskell/stack/issues?q=is%3Aopen+is%3Aissue+label%3A%22awaiting+pull+request%22+label%3a%22newcomer+friendly%22)
5050
label. Best to post a comment to the issue before you start work, in case anyone
5151
has already started.
5252

ChangeLog.md

Lines changed: 72 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ Behavior changes:
3131
`stack.yaml` will promote it to a local package, providing for more
3232
consistency with flags and better reproducibility. See:
3333
[#849](https://github.com/commercialhaskell/stack/issues/849)
34+
* The `package-indices` setting with Hackage no longer works with the
35+
`00-index.tar.gz` tarball, but must use the `01-index.tar.gz` file
36+
to allow revised packages to be found.
3437
* Options passsed via `--ghci-options` are now passed to the end of the
3538
invocation of ghci, instead of the middle. This allows using `+RTS`
3639
without an accompanying `-RTS`.
@@ -39,22 +42,22 @@ Behavior changes:
3942
* Addition of `stack build --copy-compiler-tool`, to allow tools like
4043
intero to be installed globally for a particular compiler.
4144
[#2643](https://github.com/commercialhaskell/stack/issues/2643)
42-
* Stack will now try to detect the width of the running terminal
43-
(only on POSIX for the moment) and use that to better display
44-
output messages. Work is ongoing, so some messages will not
45-
be optimal yet. The terminal width can be overriden with the
46-
new `--terminal-width` command-line option (this works even on
47-
non-POSIX).
4845
* Stack will ask before saving hackage credentials to file. This new
4946
prompt can be avoided by using the `save-hackage-creds` setting. Please
5047
see [#2159](https://github.com/commercialhaskell/stack/issues/2159).
51-
* The `GHCRTS` environment variable will no longer be passed to
48+
* The `GHCRTS` environment variable will no longer be passed through to
5249
every program stack runs. Instead, it will only be passed through
5350
commands like `exec`, `runghc`, `script`, `ghci`, etc.
5451
See [#3444](https://github.com/commercialhaskell/stack/issues/3444).
52+
* The `pvp-bounds` feature is no longer fully functional, due to some
53+
issues with the Cabal library's printer. See
54+
[#3550](https://github.com/commercialhaskell/stack/issues/3550).
5555

5656
Other enhancements:
5757

58+
* The `with-hpack` configuration option specifies an Hpack executable to use
59+
instead of the Hpack bundled with Stack. Please
60+
see [#3179](https://github.com/commercialhaskell/stack/issues/3179).
5861
* It's now possible to skip tests and benchmarks using `--skip`
5962
flag
6063
* `GitSHA1` is now `StaticSHA256` and is implemented using the `StaticSize 64 ByteString` for improved performance.
@@ -73,14 +76,9 @@ Other enhancements:
7376
assist with the user experience when the `PATH` environment variable
7477
has not been properly configured, see
7578
[#3232](https://github.com/commercialhaskell/stack/issues/3232).
76-
* Introduce the `Stack.StaticBytes` module for more efficiently
77-
holding statically-known byte sizes.
7879
* `stack setup` for ghcjs will now install `alex` and `happy` if
7980
they are not present. See
8081
[#3109](https://github.com/commercialhaskell/stack/issues/3232).
81-
* `--ghc-options` and `--ghcjs-boot-options` now parse their input, so
82-
multiple arguments can be passed in one option.
83-
See [#3315](https://github.com/commercialhaskell/stack/issues/3315)
8482
* Added `stack ghci --only-main` flag, to skip loading / importing
8583
all but main modules. See the ghci documentation page
8684
for further info.
@@ -103,9 +101,43 @@ Other enhancements:
103101
* When using Nix, nix-shell now depends always on gcc to prevent build errors
104102
when using the FFI. As ghc depends on gcc anyway, this doesn't increase the
105103
dependency footprint.
104+
* `--cwd DIR` can now be passed to `stack exec` in order to execute the
105+
program in a different directory. See:
106+
[#3264](https://github.com/commercialhaskell/stack/issues/3264)
107+
* Plan construction will detect if you add an executable-only package
108+
as a library dependency, resulting in much clearer error
109+
messages. See:
110+
[#2195](https://github.com/commercialhaskell/stack/issues/2195).
111+
* Addition of `--ghc-options` to `stack script` to pass options directly
112+
to GHC. See:
113+
[#3454](https://github.com/commercialhaskell/stack/issues/3454)
114+
* Add hpack `package.yaml` to build Stack itself
115+
* Add `ignore-revision-mismatch` setting. See:
116+
[#3520](https://github.com/commercialhaskell/stack/issues/3520).
117+
* Log when each individual test suite finishes. See:
118+
[#3552](https://github.com/commercialhaskell/stack/issues/3552).
119+
* Stack will now try to detect the width of the running terminal
120+
(only on POSIX for the moment) and use that to better display
121+
output messages. Work is ongoing, so some messages will not
122+
be optimal yet. The terminal width can be overriden with the
123+
new `--terminal-width` command-line option (this works even on
124+
non-POSIX).
125+
* Passing non local packages as targets to `stack ghci` will now
126+
cause them to be used as `-package` args along with package
127+
hiding.
128+
* Detect when user changed .cabal file instead of package.yaml. This
129+
was implemented upstream in hpack. See
130+
[#3383](https://github.com/commercialhaskell/stack/issues/3383).
131+
* Automatically run `autoreconf -i` as necessary when a `configure`
132+
script is missing. See
133+
[#3534](https://github.com/commercialhaskell/stack/issues/3534)
134+
* GHC bindists can now be identified by their SHA256 checksum in addition to
135+
their SHA1 checksum, allowing for more security in download.
106136

107137
Bug fixes:
108138

139+
* `stack hoogle` correctly generates Hoogle databases. See:
140+
[#3362](https://github.com/commercialhaskell/stack/issues/3362)
109141
* `stack --docker-help` is now clearer about --docker implying
110142
system-ghc: true, rather than both --docker and --no-docker.
111143
* `stack haddock` now includes package names for all modules in the
@@ -141,6 +173,30 @@ Bug fixes:
141173
* docs.haskellstack.org RTD documentation search is replaced by the mkdocs
142174
search. Please see
143175
[#3376](https://github.com/commercialhaskell/stack/issues/3376).
176+
* `stack clean` now works with nix. See
177+
[#3468](https://github.com/commercialhaskell/stack/issues/3376).
178+
* `stack build --only-dependencies` no longer builds local project packages
179+
that are depended on. See
180+
[#3476](https://github.com/commercialhaskell/stack/issues/3476).
181+
* Properly handle relative paths stored in the precompiled cache files. See
182+
[#3431](https://github.com/commercialhaskell/stack/issues/3431).
183+
* In some cases, Cabal does not realize that it needs to reconfigure, and must
184+
be told to do so automatically. This would manifest as a "shadowed
185+
dependency" error message. We now force a reconfigure whenever a dependency is
186+
built, even if the package ID remained the same. See
187+
[#2781](https://github.com/commercialhaskell/stack/issues/2781).
188+
* When `--pvp-bounds` is enabled for sdist or upload, internal
189+
dependencies could cause errors when uploaded to hackage. This is
190+
fixed, see [#3290](https://github.com/commercialhaskell/stack/issues/3290)
191+
* Fixes a bug where nonexistent hackage versions would cause stack to
192+
suggest the same package name, without giving version info. See
193+
[#3562](https://github.com/commercialhaskell/stack/issues/3562)
194+
* Fixes a bug that has existed since 1.5.0, where
195+
`stack setup --upgrade-cabal` would say that Cabal is already the latest
196+
version, when it wasn't.
197+
* Ensure that an `extra-dep` from a local directory is not treated as
198+
a `$locals` for GHC options purposes. See
199+
[#3574](https://github.com/commercialhaskell/stack/issues/3574).
144200

145201

146202
## 1.5.1
@@ -219,6 +275,9 @@ Other enhancements:
219275
on the PATH or shadowed by another entry.
220276
* Allow running tests on tarball created by sdist and upload
221277
[#717](https://github.com/commercialhaskell/stack/issues/717).
278+
* For filesystem setup-info paths, it's no longer assumed that the
279+
directory is writable, instead a temp dir is used. See
280+
[#3188](https://github.com/commercialhaskell/stack/issues/3188).
222281

223282
Bug fixes:
224283

@@ -339,7 +398,7 @@ Other enhancements:
339398
([#2986](https://github.com/commercialhaskell/stack/issues/2986))
340399
* `stack exec` now takes `--rts-options` which passes the given arguments inside of
341400
`+RTS ... args .. -RTS` to the executable. This works around stack itself consuming
342-
the RTS flags on Windows. ([#2986](https://github.com/commercialhaskell/stack/issues/2640))
401+
the RTS flags on Windows. ([#2640](https://github.com/commercialhaskell/stack/issues/2640))
343402
* Upgraded `http-client-tls` version, which now offers support for the
344403
`socks5://` and `socks5h://` values in the `http_proxy` and `https_proxy`
345404
environment variables.

Setup.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ generateBuildModule verbosity pkg lbi = do
4747
where
4848
allInstPkgsIdx = installedPkgs lbi
4949
allInstPkgIds = map installedPackageId $ allPackages allInstPkgsIdx
50-
-- instPkgIds includes `stack-X.X.X`, which is not a depedency hence is missing from allInstPkgsIdx. Filter that out.
50+
-- instPkgIds includes `stack-X.X.X`, which is not a dependency hence is missing from allInstPkgsIdx. Filter that out.
5151
availInstPkgIds = filter (`elem` allInstPkgIds) $ testDeps xs ys
5252
handleDepClosureFailure unsatisfied =
5353
error $

doc/GUIDE.md

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ The following changes will be made to stack.yaml:
10851085
- aeson-0.10.0.0
10861086
- aeson-compat-0.3.0.0
10871087
- attoparsec-0.13.0.1
1088-
- conduit-extra-1.1.9.2
1088+
- conduit-extra-1.2.0
10891089
- email-validate-2.2.0
10901090
- hex-0.1.2
10911091
- http-api-data-0.2.2
@@ -1579,8 +1579,9 @@ what needs to be removed:
15791579
We've already used `stack exec` used multiple times in this guide. As you've
15801580
likely already guessed, it allows you to run executables, but with a slightly
15811581
modified environment. In particular: `stack exec` looks for executables on
1582-
stack's bin paths, and sets a few additional environment variables (like
1583-
`GHC_PACKAGE_PATH`, which tells GHC which package databases to use).
1582+
stack's bin paths, and sets a few additional environment variables (like adding
1583+
those paths to `PATH`, and setting `GHC_PACKAGE_PATH`, which tells GHC which
1584+
package databases to use).
15841585
15851586
If you want to see exactly what the modified environment looks like, try:
15861587
@@ -1789,7 +1790,7 @@ it. Here is an example:
17891790
-}
17901791
```
17911792
1792-
## Finding project configs, and the implicit global
1793+
## Finding project configs, and the implicit global project
17931794
17941795
Whenever you run something with stack, it needs a `stack.yaml` project file. The
17951796
algorithm stack uses to find this is:
@@ -1820,6 +1821,15 @@ configuration. It has no impact on projects at all. Every package you install
18201821
with it is put into isolated databases just like everywhere else. The only magic
18211822
is that it's the catch-all project whenever you're running stack somewhere else.
18221823
1824+
## Setting stack root location
1825+
1826+
`stack path --stack-root` will tell you the location of the "stack root". Among
1827+
other things, this is where stack stores downloaded programs and snapshot
1828+
packages. This location can be configured by setting the STACK_ROOT environment
1829+
variable or passing the `--stack-root` commandline option. It is particularly
1830+
useful to do this on Windows, where filepaths are limited (MAX_PATH), and things
1831+
can break when this limit is exceeded.
1832+
18231833
## `stack.yaml` vs `.cabal` files
18241834
18251835
Now that we've covered a lot of stack use cases, this quick summary of
@@ -1899,21 +1909,6 @@ __Other tools for comparison (including active and historical)__
18991909
* [cabal-src](https://hackage.haskell.org/package/cabal-src) is mostly irrelevant in the presence of both stack and cabal sandboxes, both of which make it easier to add additional package sources easily. The mega-sdist executable that ships with cabal-src is, however, still relevant. Its functionality may some day be folded into stack
19001910
* [stackage-cli](https://hackage.haskell.org/package/stackage-cli) was an initial attempt to make cabal-install work more easily with curated snapshots, but due to a slight impedance mismatch between cabal.config constraints and snapshots, it did not work as well as hoped. It is deprecated in favor of stack.
19011911
1902-
## More resources
1903-
1904-
There are lots of resources available for learning more about stack:
1905-
1906-
* `stack --help`
1907-
* `stack --version` — identify the version and Git hash of the stack executable
1908-
* `--verbose` (or `-v`) — much more info about internal operations (useful for bug reports)
1909-
* The [home page](http://haskellstack.org)
1910-
* The [stack mailing list](https://groups.google.com/d/forum/haskell-stack)
1911-
* The [the FAQ](faq.md)
1912-
* The [stack wiki](https://github.com/commercialhaskell/stack/wiki)
1913-
* The [haskell-stack tag on Stack Overflow](http://stackoverflow.com/questions/tagged/haskell-stack)
1914-
* [Another getting started with stack tutorial](http://seanhess.github.io/2015/08/04/practical-haskell-getting-started.html)
1915-
* [Why is stack not cabal?](https://www.fpcomplete.com/blog/2015/06/why-is-stack-not-cabal)
1916-
19171912
19181913
## Fun features
19191914
@@ -1962,11 +1957,11 @@ As a starting point you can use [the "simple" template](https://github.com/comme
19621957
An introduction into template-writing and a place for submitting official templates,
19631958
you will find at [the stack-templates repository](https://github.com/commercialhaskell/stack-templates#readme).
19641959
1965-
### IDE
1960+
### Editor integration
19661961
1967-
stack has a work-in-progress suite of editor integrations, to do things like
1968-
getting type information in Emacs. For more information, see
1969-
[stack-ide](https://github.com/commercialhaskell/stack-ide#readme).
1962+
For editor integration, stack has a related project called
1963+
[intero](https://github.com/commercialhaskell/intero). It is particularly well
1964+
supported by emacs, but some other editors have integration for it as well.
19701965
19711966
### Visualizing dependencies
19721967
@@ -2039,11 +2034,11 @@ image:
20392034
and then run `stack image container` and then `docker images` to list
20402035
the images.
20412036

2042-
Note that the executable will be built in the development environment
2043-
and copied to the container, so the dev OS must match that of the
2037+
Note that the executable will be built in the development environment
2038+
and copied to the container, so the dev OS must match that of the
20442039
container OS. This is easily accomplished using [Docker integration](docker_integration.md),
2045-
under which the exe emitted by `stack build` will be built on the
2046-
Docker container, not the local OS.
2040+
under which the exe emitted by `stack build` will be built on the
2041+
Docker container, not the local OS.
20472042

20482043
The executable will be stored under `/usr/local/bin/<your-project>-exe`
20492044
in the running container.
@@ -2159,6 +2154,14 @@ build:
21592154
executable-profiling: true
21602155
```
21612156

2157+
### Further reading
2158+
2159+
For more commands and uses, see [the official GHC chapter on
2160+
profiling](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html),
2161+
[the Haskell wiki](https://wiki.haskell.org/How_to_profile_a_Haskell_program),
2162+
and [the chapter on profiling in Real World
2163+
Haskell](http://book.realworldhaskell.org/read/profiling-and-optimization.html).
2164+
21622165
### Tracing
21632166

21642167
To generate a backtrace in case of exceptions during a test or benchmarks run,
@@ -2169,14 +2172,21 @@ but adds the `+RTS -xc` runtime option.
21692172

21702173
`stack` now supports debugging and profiling with
21712174
[DWARF information](https://ghc.haskell.org/trac/ghc/wiki/DWARF),
2172-
using the `--no-strip`, `--no-library-stripping`, and `--no-executable-shipping`
2175+
using the `--no-strip`, `--no-library-stripping`, and `--no-executable-stripping`
21732176
flags to disable the default behavior of removing such information from compiled
21742177
libraries and executables.
21752178

2176-
### Further reading
2179+
## More resources
21772180

2178-
For more commands and uses, see [the official GHC chapter on
2179-
profiling](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html),
2180-
[the Haskell wiki](https://wiki.haskell.org/How_to_profile_a_Haskell_program),
2181-
and [the chapter on profiling in Real World
2182-
Haskell](http://book.realworldhaskell.org/read/profiling-and-optimization.html).
2181+
There are lots of resources available for learning more about stack:
2182+
2183+
* `stack --help`
2184+
* `stack --version` — identify the version and Git hash of the stack executable
2185+
* `--verbose` (or `-v`) — much more info about internal operations (useful for bug reports)
2186+
* The [home page](http://haskellstack.org)
2187+
* The [stack mailing list](https://groups.google.com/d/forum/haskell-stack)
2188+
* The [the FAQ](faq.md)
2189+
* The [stack wiki](https://github.com/commercialhaskell/stack/wiki)
2190+
* The [haskell-stack tag on Stack Overflow](http://stackoverflow.com/questions/tagged/haskell-stack)
2191+
* [Another getting started with stack tutorial](http://seanhess.github.io/2015/08/04/practical-haskell-getting-started.html)
2192+
* [Why is stack not cabal?](https://www.fpcomplete.com/blog/2015/06/why-is-stack-not-cabal)

doc/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ the needed files to start a project correctly.
5555
- The `stack build` command will build the minimal project.
5656
- `stack exec my-project-exe` will execute the command.
5757
- If you just want to install an executable using stack, then all you have to do
58-
is`stack install <package-name>`.
58+
is `stack install <package-name>`.
5959

6060
If you want to launch a REPL:
6161

@@ -118,7 +118,10 @@ installed.
118118
4. Once `stack` finishes building, check the stack version with
119119
`stack exec stack -- --version`. Make sure the version is the latest.
120120
5. Look for issues tagged with
121-
[`newcomer` and `awaiting-pr` labels](https://github.com/commercialhaskell/stack/issues?q=is%3Aopen+is%3Aissue+label%3Anewcomer+label%3A%22awaiting+pr%22).
121+
[newcomer friendly](https://github.com/commercialhaskell/stack/issues?q=is%3Aopen+is%3Aissue+label%3a%22newcomer+friendly%22)
122+
and
123+
[awaiting pull request](https://github.com/commercialhaskell/stack/issues?q=is%3Aopen+is%3Aissue+label%3A%22awaiting+pull+request%22)
124+
labels.
122125

123126
Build from source as a one-liner:
124127

@@ -175,4 +178,4 @@ commercial Haskell users, and has since become a thriving open source
175178
project meeting the needs of Haskell users of all stripes.
176179

177180
If you'd like to get involved with Stack, check out the
178-
[newcomers label on the Github issue tracker](https://github.com/commercialhaskell/stack/issues?q=is%3Aopen+is%3Aissue+label%3Anewcomer).
181+
[newcomer friendly](https://github.com/commercialhaskell/stack/issues?q=is%3Aopen+is%3Aissue+label%3a%22newcomer+friendly%22) label on the Github issue tracker.

0 commit comments

Comments
 (0)