[ANN] Stack 2.9.1

See https://haskellstack.org/ for installation and upgrade instructions.

Changes since v2.7.5:

Release notes:

  • After an upgrade from an earlier version of Stack, on first use only, Stack 2.9.1 may warn that it had trouble loading the CompilerPaths cache.

Behavior changes:

  • stack build --coverage will generate a unified coverage report, even if there is only one *.tix file, in case a package has tested the library of another package that has not tested its own library. See #5713
  • stack --verbose no longer includes the lengthy raw snapshot layer (rsl) in the debug output by default. The new stack --[no-]rsl-in-log flag enables or disables the inclusion of the rsl in the debug output.

Other enhancements:

  • Bump to Hpack 0.35.0.
  • On Windows, the installer now sets DisplayVersion in the registry, enabling tools like winget to properly read the version number.
  • Adds flag --script-no-run-compile (disabled by default) that uses the --no-run option with stack script (and forces the --compile option). This enables a command like stack --script-no-run-compile Script.hs to behave like stack script <arguments> --no-run --compile -- Script.hs but without having to list all the <arguments> in the Stack interpreter options comment in Script.hs on the command line. That may help test that scripts compile in CI (continuous integration). See #5755
  • Fuller help is provided at the command line if a subcommand is missing (for example, stack ls now yields the equivalent of stack ls --help). See #809
  • Add build option --cabal-verbosity=VERBOSITY to specify the Cabal verbosity level (the option accepts Cabal’s numerical and extended syntax). See #1369
  • Add the possibility of a sh script to customise fully GHC installation. See #5585
  • tools subcommand added to stack ls, to list stack’s installed tools.
  • stack uninstall shows how to uninstall Stack.
  • --ghc-variant accepts int-native as a variant.

Bug fixes:

  • Fix stack clean --full, so that the files to be deleted are not in use. See #5714
  • Fix an inconsistency in the pretty formatting of the output of stack build --coverage
  • Fix repeated warning about missing parameters when using stack new
  • Include pantry-0.5.6: Remove operational and mirror keys from bootstrap key set. See #53
  • Pass any CPP options specified via cpp-options: in the Cabal file to GHCi using GHC’s -optP flag. See #5608
  • On Unix-like operating systems, respect the with-gcc option when installing GHC. See #5609
  • Fixed logic in get_isa() in get-stack.sh to exclude systems that don’t have x86 in their uname -m output. See #5792.
  • Fixed output of stack ls snapshots local on Windows, to behave like that on Unix-like operating systems.
  • Fix non-deterministic test failures when executing a test suite for a multi-project repository with parallelism enabled. See #5024

Thanks to all our contributors for this release:

  • ARATA Mizuki
  • citrusmunch
  • Dan Brooks
  • Danila Danko
  • Emanuel Borsboom
  • HallowedDust5
  • hs211216
  • Idris Raja
  • Josh Soref
  • Julian Ospald
  • Leo Sin
  • Maciej Bielecki
  • Malte Neuss
  • malteneuss
  • Marc Etter
  • Matt Audesse
  • Michael Snoyman
  • Mike Pilgrem
  • Naoya Yamashita
  • Phil de Joux
  • Sibi Prabakaran
  • Tom Sydney Kerckhove
10 Likes

The update affects installation via ghcup isn’t it? Could you explain how? Right now, you have to configure stack manually in order to make it work with hls. AFAIK, this update adds some installation hook, so stack uses ghcup tool. I am pulling some documentation to haskell org and this could be interesting to add if the PR gets accepted.

1 Like

Hurrah! Thank you very much @mpilgrem and contributors. The docs facelift is great too.

@hasufell is the author of that addition to Stack, and has a plan for how a future version of GHCup can make use of it - see Finalize stack integration (#392) · Issues · Haskell / ghcup-hs · GitLab.

5 Likes

The feature is documented here: Configuration (project and global) - The Haskell Tool Stack

You could already do it. Something like this (haven’t tested, am on mobile):

#!/bin/bash

set -euo pipefail

case $HOOK_GHC_TYPE in
    bindist)
		echo "$(ghcup run --ghc "$HOOK_GHC_VERSION" --install)/ghc"
        ;;
    git)
		# TODO: should be somewhat possible
        >&2 echo "Hook doesn't support installing from source"
        exit 1
        ;;
    *)
        >&2 echo "Unsupported GHC installation type: $HOOK_GHC_TYPE"
        exit 2
        ;;
esac

Place these contents into ~/.stack/hooks/ghc-install.sh and make the file executable. That should pipe installation through GHCup.

We will then update the GHCup bootstrap script to:

  1. Always install stack by default (you’ll still be able to disable it with an env var)
  2. Ask the user if they want to install the new hook for better integration
3 Likes

Brilliant update and gorgeous facelift on the docs! Thanks for the hard work. Using stack daily and it’s never been such a pleasure.

4 Likes

Thanks for your kind words. On the online documentation, much of the past substantive content - the product of a lot of work by other authors - is unchanged, but moving to the Material for MkDocs theme ‘unlocked’ it by revealing its structure and allowing it to be navigated more easily. The ‘content tabs’ extension to Markdown is particularly useful because it means that users of one platform do not have to be troubled by content that is specific to another platform. Material for MkDocs itself has excellent documentation, which has helped ease the transition.

The recent changes have been: (a) to separate a reference-style ‘advanced’ guide from the tutorial-style ‘introductory’ guide; (b) to start to enforce an editorial consistency on the existing content (some of which had accumulated piecemeal); (c) to try to bring things up to date (I am conscious there is more to be done on that front); and (d) to fill in some gaps, including adding some context (there is more to be done on that front too).

3 Likes

The new hpack means we can now use GHC2020. Great stuff guys!

1 Like
4 Likes

Delighted to hear you are working on the docs structure/content as well, great news.

Awesome to see tighter integration between ghcup and stack! Waiting for ghcup release.

There’s no new release required. The integration happens via a shell script in ~/.stack/hooks that is installed by the ghcup bootstrap script (also a shell script).

The binary itself has no knowledge of this. That was the entire point of the hook based approach: passive integration, so the tools don’t have to know anything about each other.


Also, to avoid confusion: the unofficial stack binaries have no patch to the source code applied. They simply augment the existing ones. Upstream does not provide M1 or armv7 binaries and the linux aarch64 is built against a too new glibc.

1 Like