Announcing the first release in the stack-2.1 series!
The Stack 2 release represents a series of significant changes to how Stack works internally. For the vast majority of cases, these changes are backwards compatible, in that existing projects will continue to build in the same way with Stack 2 as they did with Stack 1. The large version bump is due to the fundamental internal changes to cache handling, database storage (using SQLite in place of binary files), implicit snapshots (which greatly improve the precompiled cache), and moving to Pantry. We have also removed some less used features, as listed in the release notes below.
See https://haskellstack.org/ for installation and upgrade instructions.
Changes since v1.9.3
00-index.tarstyle indices. See #4137.
packagessection has been removed. Instead, you must use
extra-depsfor such dependencies.
packagesnow only supports local filepaths.
stack freezecommand provides support for automatically generating this additional information.
pantrylibrary can be used for interacting with these contents.
stack freezehas been added which outputs project and snapshot definitions with dependencies pinned to their exact versions.
ignore-revision-mismatchsetting is no longer needed, and has been removed.
stack solvercommand was removed as well as a related option
foo.txt, but not
stack imagecommand. With the advent of Docker multistage builds, this functionality is no longer useful. For an example, please see Building Haskell Apps with Docker.
compilercan be set to use a GHC built from source with
stack.yamlnow supports a
configure-options, which are passed directly to the
configurestep in the Cabal build process. See #1438
snapshot: a synonym for
resolver. See #4256
stack scriptnow passes
-i -idirin to the
ghcinvocation. This makes it so that the script can import local modules, and fixes an issue where
.hsfiles in the current directory could affect interpretation of the script. See #4538
stack script, custom snapshot files will be resolved relative to the directory containing the script.
--plainoption for the
execfamily of commands
--exact-configurationCabal configuration option when building (should mostly be a non-user-visible enhancement).
1.19.2. This means projects using snapshots earlier than
nightly-2015-05-05will no longer build.
stack docker cleanupcommand. Docker itself now has
docker image pruneand
docker container prune, which you can use instead.
packagename>prefix is no longer included in interelaved mode when only building a single target.
-fhide-source-pathsGHC option is now enabled by default and can be disabled via the
hide-source-pathsconfiguration option in
stack.yaml. See #3784
PATHenvironment variable. See #3138.
recommend-stack-upgrade: falseto bypass this. See #1681.
stack list-dependencieshas been removed in favour of
stack ls dependencies.
--docker-auto-pullis enabled. See #3332.
--color=WHENis now also available as a non-project-specific yaml configuration parameter
NO_COLORenvironment variable is present.
stack ls stack-colorslists the styles and the associated ‘ANSI’ control character sequences that stack uses to color some of its output. See
stack ls stack-colors --helpfor more information.
--stack-colors=STYLES, also available as a non-project-specific yaml configuration parameter, allows a stack user to redefine the default styles that stack uses to color some of its output. See
stack --helpfor more information.
stack ls stack-colorsat the command line and for
stack-colors:in yaml configuration files.
--ddump-dir. (See #4225)
preferred-versionsinformation from Hackage for choosing latest version of a package in some cases, e.g.
stack unpack packagename.
The main module to load is ambiguousmessage now include package names so they can be more easily copy-pasted.
ls dependenciesto list dependencies as tree. #4101
ghcito run with
stack ide targetscommand.
--stdoutflag to all
ghc-pkg. (See #2662)
get-stackscript now works on Windows CI machines of Appveyor, Travis and Azure Pipelines. See #4535/
stack ghciis invoked outside of a project directory. See #3651
--extra-depflag for adding packages not present in the snapshot. Currently, this only works with packages from Hackage, not Git repos or archives.
--compile, Stack will perform an optimization of checking whether a newer executable exists, making reruns significantly faster. There’s a downside to this, however: if you have a multifile script, and change one of the dependency modules, Stack will not automatically detect and recompile.
stack cleanwill delete the entire
.stack-work/distdirectory, not just the relevant subdirectory for the current GHC version. See #4480.
stack purgeas a shortcut for
stack clean --full. See #3863.
stack ls dependenciesaccept a
--global-hintsflag to bypass the need for an installed GHC. See #4390.
stack config envcommand for getting shell script environment variables. See #620.
stack setupon Windows. See #1212.
ignore-expiryflag to the
hackage-securitysection of the
~/.stack/config.yaml. It allows to disable timestamp expiration verification just like
cabal --ignore-expirydoes. The flag is not enabled by default so that the default functionality is not changed.
--helpoutput. See #893.
GHC_ENVIRONMENTenvironment variable to specify dependency packages explicitly when running test. This is done to prevent ambiguous module name errors in
get-stackscript now works on Windows CI machines of Appveyor, Travis and Azure Pipelines. See #4535
PATHenvironment variable. See #2472
system-ghc: true, Stack will now find the appropriate GHC installation based on the version suffix, allowing you to more easily switch between various system-installed GHCs. See #2433.
stack initwill now support create a
stack.yamlfile without any local packages. See #2465
GHC_ENVIRONMENTenvironment variable to
-to tell GHC to ignore any such files when GHC is new enough (>= 8.4.4), otherwise simply unset the variable. This allows Stack to have control of package databases when running commands like
stack exec ghci, even in the presence of implicit environment files created by
cabal new-build. See #4706.
--test-argumentsoptions. See #2226
local-programs-pathconfiguration option. See #4726
--docker-mount-modeoption to set the Docker volume mount mode for performance tuning on macOS.
addDependentFile, which now includes a hash. See yesodweb/yesod#1551
subdirsfor git repos in
extra-depsto match whole directory names. Also fixes for
subdirs: .. See #4292
stack ide targetscommand.
--file-watchnot responding to file modifications when running inside docker on Mac. See #4506
stack script --compilenow works.
Setup.hsfile. See #4526.
templatessubcommand now reflects behaviour in stack 1.9 — that it downloads and shows a help file, rather than listing available templates.
--docker-auto-pull, see #4598
stack initwill now work for cabal files with sublibraries. See #4408
stackexecutable when the host
stackis not compatible with the Docker image (on Linux), and doesn’t show an unnecessary extra error when the in-container re-exec’ed
stackexits with failure.
--ghc-optionsflag now parses multiple options. See #3315.
Thanks to all our contributors for this release:
Do you like this blog post and need help with industrial Haskell, Rust or DevOps? Contact us.