# \[ANN\] Stack 2.15.1

**URL:** <https://discourse.haskell.org/t/ann-stack-2-15-1/8767>\
**Category:** Announcements\
**Created:** [February 10, 2024, 12:48am UTC](https://discourse.haskell.org/t/ann-stack-2-15-1/8767 "2024-02-10T00:48:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpilgrem](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/mpilgrem/32/2529_2.png) [@mpilgrem](https://discourse.haskell.org/u/mpilgrem)\
**Post date:** [February 10, 2024, 12:48am UTC](https://discourse.haskell.org/t/ann-stack-2-15-1/8767/1 "2024-02-10T00:48:44Z")

</div>

See [https://haskellstack.org/](https://haskellstack.org/) for installation and upgrade instructions.

Release notes:

- After an upgrade from an earlier version of Stack, on first use only, Stack 2.15.1 may warn that it had trouble loading the CompilerPaths cache.
- The hash used as a key for Stack’s pre-compiled package cache has changed, following the dropping of support for Cabal versions older than `1.24.0.0`.

**Changes since v2.13.1:**

Behavior changes:

- Stack does not leave `*.hi` or `*.o` files in the `setup-exe-src` directory of the Stack root, and deletes any corresponding to a `setup-<hash>.hs` or `setup-shim-<hash>.hs` file, to avoid GHC issue [#21250](https://gitlab.haskell.org/ghc/ghc/-/issues/21250).
- If Stack’s Nix integration is not enabled, Stack will notify the user if a `nix` executable is on the PATH. This usually indicates the Nix package manager is available. In YAML configuration files, the `notify-if-nix-on-path` key is introduced, to allow the notification to be muted if unwanted.
- Drop support for Intero (end of life in November 2019).
- `stack path --stack-root` no longer sets up Stack’s environment and does not load Stack’s configuration.
- Stack no longer locks on configuration, so packages (remote and local) can be configured in parallel. This increases the effective concurrency of builds that before would use fewer threads. Reconsider your `--jobs` setting accordingly. See [#84](https://github.com/commercialhaskell/stack/issues/84).
- Stack warns that its support for Cabal versions before `2.2.0.0` is deprecated and may be removed in the next version of Stack. Removal would mean that projects using snapshots earlier than `lts-12.0` or `nightly-2018-03-18` (GHC 8.4.1) might no longer build. See [#6377](https://github.com/commercialhaskell/stack/issues/6377).
- If Stack’s `--resolver` option is not specified, Stack’s `unpack` command with a package name will seek to update the package index before seeking to download the most recent version of the package in the index.
- If the version of Cabal (the library) provided with the specified GHC can copy specific components, Stack will copy only the components built and will not build all executable components at least once.

Other enhancements:

- Consider GHC 9.8 to be a tested compiler and remove warnings.
- Stack can build packages with dependencies on public sub-libraries of other packages.
- Add flag `--no-init` to Stack’s `new` command to skip the initialisation of the newly-created project for use with Stack.
- The HTML file paths produced at the end of `stack haddock` are printed on separate lines and without a trailing dot.
- Add option of the form `--doctest-option=<argument>` to `stack build`, where `doctest` is a program recognised by versions of the Cabal library from `1.24.0.0`.
- Experimental: Add flag `--haddock-for-hackage` to Stack’s `build` command (including the `haddock` synonym for `build --haddock`) to enable building local packages with flags to generate Haddock documentation, and an archive file, suitable for upload to Hackage. The form of the Haddock documentation generated for other packages is unaffected.
- Experimental: Add flag `--documentation` (`-d` for short) to Stack’s `upload` command to allow uploading of documentation for packages to Hackage.
- `stack new` no longer rejects project templates that specify a `package.yaml` in a subdirectory of the project directory.
- Stack will notify the user if Stack has not been tested with the version of GHC that is being user or a version of Cabal (the library) that has been found. In YAML configuration files, the `notify-if-ghc-untested` and `notify-if-cabal-untested` keys are introduced, to allow the notification to be muted if unwanted.
- The compiler version is included in Stack’s build message (e.g. `stack> build (lib + exe + test) with ghc-9.6.4`).
- Add flag `--candidate` to Stack’s `unpack` command, to allow package candidates to be unpacked locally.
- Stack will notify the user if a specified architecture value is unknown to Cabal (the library). In YAML configuration files, the `notify-if-arch-unknown` key is introduced, to allow the notification to be muted if unwanted.
- Add option `--filter <item>` to Stack’s `ls dependencies text` command to filter out an item from the results, if present. The item can be `$locals` for all local packages.
- Add option `--snapshot` as synonym for `--resolver`.
- Add the `config set snapshot` command, corresponding to the `config set resolver` command.

Bug fixes:

- Fix the `Curator` instance of `ToJSON`, as regards `expect-haddock-failure`.
- Better error message if a `resolver:` or `snapshot:` value is, in error, a YAML number.
- Stack accepts all package names that are, in fact, acceptable to Cabal.
- Stack’s `sdist` command can check packages with names that include non-ASCII characters.

**Thanks to all our contributors for this release:**

- Bryan Richter
- Dash Lu
- Jason Shipman
- Marco Zocca
- Markus Schirp
- Mike Pilgrem
- Olivier Benz
- Phil de Joux
- theophilebatoz

---

<div class="post-metadata">

**Author:** ![janus](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/janus/32/1060_2.png) [@janus](https://discourse.haskell.org/u/janus)\
**Post date:** [February 10, 2024, 5:28pm UTC](https://discourse.haskell.org/t/ann-stack-2-15-1/8767/2 "2024-02-10T17:28:12Z")

</div>

> [@mpilgrem](#):
>
> Stack can build packages with dependencies on public sub-libraries of other packages.

How does this look in practice? I found [PR 6343](https://github.com/commercialhaskell/stack/pull/6343) but it doesn’t mention any example packages.

---

<div class="post-metadata">

**Author:** ![theobat](https://avatars.discourse-cdn.com/v4/letter/t/258eb7/32.png) [@theobat](https://discourse.haskell.org/u/theobat)\
**Post date:** [February 10, 2024, 6:43pm UTC](https://discourse.haskell.org/t/ann-stack-2-15-1/8767/3 "2024-02-10T18:43:09Z")

</div>

It means you can use this type of dependency in your cabal file :

> <https://github.com/commercialhaskell/stack/blob/master/tests/integration/tests/cabal-sublibrary-dependency/files/files.cabal#L10>

Where the project in question has this type of cabal file :

> <https://github.com/commercialhaskell/stack/blob/master/tests/integration/tests/cabal-sublibrary-dependency/files/subproject/subproject.cabal>

---

<div class="post-metadata">

**Author:** ![mpilgrem](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/mpilgrem/32/2529_2.png) [@mpilgrem](https://discourse.haskell.org/u/mpilgrem)\
**Post date:** [February 11, 2024, 4:12pm UTC](https://discourse.haskell.org/t/ann-stack-2-15-1/8767/4 "2024-02-11T16:12:00Z")

</div>

An experimental new feature is `--haddock-for-hackage`. For example, Hackage cannot build Stack’s Haddock documentation but Stack can build it. I can build it, and add the Haddock documentation to Hackage (and have now done so), with (in the root directory of the `stack` package):

```nohighlight
stack purge # No harm in starting with a clean slate
stack haddock --haddock-for-hackage # Build docs in the format Hackage needs
stack upload . --documentation # Upload docs only to Hackage

```
