The Haskell Tool Stack
Changes since v2.5.1.1:
Behavior changes:
stack repl
now always warns about GHCi problems with loading multiple
packages. It also sets now proper working directory when invoked with
one package. See
#5421
custom-setup
dependencies are now properly initialized for stack dist
.
This makes explicit-setup-deps
no longer required and that option was
removed. See
#4006
Other enhancements:
Nix integration now passes ghcVersion
(in addition to existing ghc
) to
shell-file
as an identifier that can be looked up in a compiler attribute set.
Nix integration now allows Nix integration if the user is ready in nix-shell. This gets rid of "In Nix shell but reExecL is False" error.
stack list
is a new command to list package versions in a snapshot.
See #5431
Consider GHC 9.0 a tested compiler and remove warnings.
custom-preprocessor-extensions
is a new configuration option for allowing
stack to be aware of any custom preprocessors you have added to Setup.hs
.
See #3491
Added --candidate
flag to upload
command to upload a package candidate
rather than publishing the package.
Error output using --no-interleaved-output
no longer prepends indentating
whitespace. This allows emacs compilation-mode and vim quickfix to locate
and track errors. See
#5523
Bug fixes:
stack new
now suppports branches other than master
as default for
GitHub repositories. See
#5422
Support basic auth in package-indices. See #5509.
Add support for parsing .hi
. files from GHC 8.10 and 9.0. See
hi-file-parser#2.
See https://haskellstack.org/ for installation and upgrade instructions.
Changes since v2.3.3
Major changes:
snapshot-location-base
yaml configuration option, which allows to
override the default location of snapshot configuration files. This option
affects how snapshot synonyms (LTS/Nightly) are expanded to URLs by the
pantry
library.docker-network
configuration key added to override docker --net
argBehavior changes:
--watch-all
#5310
Other enhancements:
stack ls dependencies json
now includes fields sha256
and size
for
dependencies of type
archive
in location
.
#5280
stack --help
and the --stack-colors
option, and stack ls stack-colors --help
) now include info
, debug
,
other-level
, secondary
and highlight
, used with verbose output.Bug fixes:
stack test --coverage
when using Cabal 3stack new
now generates PascalCase'd module name correctly.
#5376
Thanks to all our contributors for this release:
Changes since v2.3.3
Major changes:
snapshot-location-base
yaml configuration option, which allows to
override the default location of snapshot configuration files. This option
affects how snapshot synonyms (LTS/Nightly) are expanded to URLs by the
pantry
library.docker-network
configuration key added to overwrite docker --net
argBehavior changes:
--watch-all
#5310
Other enhancements:
stack ls dependencies json
now includes fields sha256
and size
for
dependencies of type
archive
in location
.
#5280
stack --help
and the --stack-colors
option, and stack ls stack-colors --help
) now include info
, debug
,
other-level
, secondary
and highlight
, used with verbose output.Bug fixes:
stack test --coverage
when using Cabal 3stack new
now generates PascalCase'd module name correctly.
#5376
See https://haskellstack.org/ for installation and upgrade instructions.
Changes since v2.3.1
Other enhancements:
stack-developer-mode
flagBug fixes:
STACK_YAML
env var with Docker, make the path absolute.stack repl foo:test:bar
failing without a project
build before that. See
#5213
stack sdist
introducing unneded sublibrary syntax when using
pvp-bounds. See
#5289
Thanks to all our contributors for this release:
See https://haskellstack.org/ for installation and upgrade instructions.
Release notes:
We have reduced the number of platforms that we support with binary releases. The reason behind this is that we've been slowed down in our release process until now with issues trying to build binaries for less common platforms. In order to make sure we can address issues more quickly (like supporting new GHC versions), we're limiting support from the Stack team to:
If others want to provide additional binaries, we will definitely be happy for the support. But since our CI system is currently able to produce these three bindists only, that's what we will be providing with the next release.
Since we no longer have dynamically linked Linux binaries, we are removing
removing the -static
suffix from the static Linux binaries. If you have
scripts to download the latest stable Linux binary, update them to use
linux-x86_64
instead of linux-x86_64-static
(if you are already using the
former, nothing needs to change). For this release, both are supported, but
the next release will no longer have the -static
variant.
We are also deprecating the download links at https://stackage.org/stack. See this page for the current installation instructions: https://docs.haskellstack.org/en/stable/install_and_upgrade/.
These are the canonical locations to download the latest stable binaries from, and will continue to be supported going forward:
As always, binaries for specific versions are available from the Github releases: https://github.com/commercialhaskell/stack/releases.
Changes since v2.1.3.1
Major changes:
setup-info-locations
yaml configuration now allows overwriting the default locations of stack-setup-2.yaml
.
#5031
#2983
#2913
The setup-info
configuration key now allows overwriting parts of the default setup-info
The --setup-info-yaml
command line flag now may be used in all stack commands such as stack build
, and not only in stack setup
The --setup-info-yaml
may specify multiple locations for stack-setup.yaml
files.
The stack upload
can read first reads environment Variable $HACKAGE_USERNAME
and $HACKAGE_PASSWORD
if they are missing only then asks for username
or password
Fully remove GHCJS support.
Remove the freeze
command. It has been replaced by lock files.
Behavior changes:
Remove the deprecated --stack-setup-yaml
command line argument in favor of --setup-info-yaml
#2647
We now recommend checking in generated cabal files for repos. When generating lock files for
extra-deps that only include package.yaml
files, a deprecation warning will be generated.
Also, those packages will no longer be included in the generated lock files.
See #5210.
Other enhancements:
Add build-output-timestamps
flag in yaml. Setting it to true
prefixes each build log output line with a timestamp.
Show warning about local-programs-path
with spaces on windows
when running scripts. See
#5013
Add ls dependencies json
which will print dependencies as JSON.
ls dependencies --tree
is now ls dependencies tree
. See
#4424
Remove warning for using Stack with GHC 8.8-8.10, and Cabal 3.0-3.2.
Allow relative paths in --setup-info-yaml
and tool paths
#3394
Added the --only-locals
flag. See
#5272
Bug fixes:
Upgrade pantry
: module mapping insertions into the database are now atomic.
Previously, if you SIGTERMed at the wrong time while running a script, you
could end up with an inconsistent database state.
--resolver global
doesn't retrieve snapshots list from the internet
beause doesn't need it. See #5103
Fix using relative links in haddocks output. See #4971.
Do not include generated cabal file information in lock files. See #5045.
Use proper Hoogle executable path when installed automatically. See #4905
Fix GHC version for batched package unregistration. See #4951
Use Hoogle from the snapshot used and not the latest version. See #4905
Resolve "'stty' is not recognized". See #4901
Fix missing reconfigure check causing errors when a package gets used in multiple projects. See #5147
Thanks to all our contributors for this release:
Changes since v2.1.3
Release notes:
Major changes:
setup-info-locations
yaml configuration now allows overwriting the default locations of stack-setup-2.yaml
.
#5031
#2983
#2913
The setup-info
configuration key now allows overwriting parts of the default setup-info
The --setup-info-yaml
command line flag now may be used in all stack commands such as stack build
, and not only in stack setup
The --setup-info-yaml
may specify multiple locations for stack-setup.yaml
files.
The stack upload
can read first reads environment Variable $HACKAGE_USERNAME
and $HACKAGE_PASSWORD
if they are missing only then asks for username
or password
Fully remove GHCJS support.
Remove the freeze
command. It has been replaced by lock files.
Behavior changes:
Remove the deprecated --stack-setup-yaml
command line argument in favor of --setup-info-yaml
#2647
We now recommend checking in generated cabal files for repos. When generating lock files for
extra-deps that only include package.yaml
files, a deprecation warning will be generated.
Also, those packages will no longer be included in the generated lock files.
See #5210.
Other enhancements:
Add build-output-timestamps
flag in yaml. Setting it to true
prefixes each build log output line with a timestamp.
Show warning about local-programs-path
with spaces on windows
when running scripts. See
#5013
Add ls dependencies json
which will print dependencies as JSON.
ls dependencies --tree
is now ls dependencies tree
. See
#4424
Remove warning for using Stack with GHC 8.8 and Cabal 3.0.
Allow relative paths in --setup-info-yaml
and tool paths
#3394
Bug fixes:
Upgrade pantry
: module mapping insertions into the database are now atomic.
Previously, if you SIGTERMed at the wrong time while running a script, you
could end up with an inconsistent database state.
--resolver global
doesn't retrieve snapshots list from the internet
beause doesn't need it. See #5103
Fix using relative links in haddocks output. See #4971.
Do not include generated cabal file information in lock files. See #5045.
Use proper Hoogle executable path when installed automatically. See #4905
Fix GHC version for batched package unregistration. See #4951
Use Hoogle from the snapshot used and not the latest version. See #4905
Resolve "'stty' is not recognized". See #4901
Fix missing reconfigure check causing errors when a package gets used in multiple projects. See #5147
See https://haskellstack.org/ for installation and upgrade instructions.
Changes since v2.1.1
Behavior changes:
Disable WAL mode for SQLite3 databases, to improve compatibility with some platforms and filesystems. See #4876.
By default, do not perform expiry checks in Hackage Security. See #4928.
Other enhancements:
Do not rerun expected test failures. This is mostly a change that will only affect the Stackage Curator use case, but there is now an additional message letting the user know when a previously-failed test case is being rerun.
Move configure information for local packages back to .stack-work to improve caching. See #4893.
Bug fixes:
Fix to allow dependencies on specific versions of local git repositories. See #4862
Allow Stack commands to be run in Nix mode without having a project file available. See #4854.
Removes dependency on gnu-tar for OSX and Linux environment. The
--force-local
option was required only for windows environment.
Properly wait for the tar
subprocess to complete before returning, thereby
avoiding a SIGTERM screwing up GHC installation. See
#4888.
Use package complete locations from lock files when resolving dependencies
in extra-deps
. See
#4887.
Set the HASKELL_DIST_DIR
environment to a proper package dist
directory so doctest
is able to load modules autogenerated by Cabal.
Expose package library when running tests.
Fix support for non-ASCII module names. See 4938
Other changes:
pantry-tmp
package back to pantry
, now that we have gained
maintainership (which had been used by someone else for a candidate-only test
that made it look like the name was free but prevented uploading a real
package).Thanks to all our contributors for this release:
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
Major changes:
00-index.tar
style indices. See
#4137.packages
section has
been removed. Instead, you must use extra-deps
for such
dependencies. packages
now only supports local filepaths.stack freeze
command provides support
for automatically generating this additional
information.pantry
library can be
used for interacting with these contents.stack freeze
has been added which outputs
project and snapshot definitions with dependencies pinned to
their exact versions.ignore-revision-mismatch
setting is no longer needed, and
has been removed.cabal-install
versions so stack solver
command was removed as
well as a related option --solver
from stack new
and
stack init
.*.txt
will
match foo.txt
, but not foo.2.txt
.stack image
command. With the advent of Docker multistage
builds, this functionality is no longer useful. For an example, please see
Building Haskell Apps with
Docker.compiler
can be set to use a GHC
built from source with ghc-git-COMMIT-FLAVOUR
stack.yaml
now supports a configure-options
, which are passed directly to
the configure
step in the Cabal build process. See
#1438
Behavior changes:
stack.yaml
now supports snapshot
: a synonym for resolver
. See
#4256
stack script
now passes -i -idir
in to the ghc
invocation. This makes it so that the script can import local
modules, and fixes an issue where .hs
files 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.--upgrade-cabal
flag to stack setup
.drop-packages
field in stack.yaml
--plain
option for the exec
family of commands--exact-configuration
Cabal configuration option when
building (should mostly be a non-user-visible enhancement).1.19.2
. This means
projects using snapshots earlier than lts-3.0
or
nightly-2015-05-05
will no longer build.stack docker cleanup
command. Docker itself now has
docker image prune
and
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-paths
GHC option is now enabled by default and
can be disabled via the hide-source-paths
configuration option in
stack.yaml
. See #3784
PATH
environment
variable. See
#3138.recommend-stack-upgrade: false
to bypass this. See
#1681.stack list-dependencies
has been removed in favour of stack ls dependencies
.--docker-auto-pull
is enabled. See
#3332.Other enhancements:
--color=WHEN
is now also available as a
non-project-specific yaml configuration parameter color:
.NO_COLOR
environment variable is present.stack ls stack-colors
lists the styles and the associated 'ANSI'
control character sequences that stack uses to color some of its output. See
stack ls stack-colors --help
for 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 --help
for more information.--color
, --stack-colors
, stack ls stack-colors
at the command line and
for color:
and stack-colors:
in yaml configuration files.--ddump-dir
. (See
#4225)preferred-versions
information from
Hackage for choosing latest version of a package in some cases,
e.g. stack unpack packagename
.The main module to load is ambiguous
message
now include package names so they can be more easily copy-pasted.--tree
to ls dependencies
to list dependencies as tree.
#4101
--pedantic
to ghci
to run with -Wall
and -Werror
#4463
--cabal-files
flag to stack ide targets
command.--stdout
flag to all stack ide
subcommands.ghc-pkg
.
(See #2662)get-stack
script now works on Windows CI machines of Appveyor,
Travis and Azure Pipelines. See
#4535/stack ghci
is invoked outside of a project
directory. See
#3651
--extra-dep
flag for adding
packages not present in the snapshot. Currently, this only works
with packages from Hackage, not Git repos or archives.--optimize
or --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 clean
will delete the entire .stack-work/dist
directory,
not just the relevant subdirectory for the current GHC version. See
#4480.stack purge
as a shortcut for stack clean --full
. See
#3863.stack dot
and stack ls dependencies
accept a
--global-hints
flag to bypass the need for an installed GHC. See
#4390.stack config env
command for getting shell script environment
variables. See #620.stack setup
on Windows. See
#1212.ignore-expiry
flag to the hackage-security
section of the ~/.stack/config.yaml
. It allows to disable timestamp
expiration verification just like cabal --ignore-expiry
does.
The flag is not enabled by default so that the default functionality
is not changed.--help
output. See
#893.GHC_ENVIRONMENT
environment variable to specify dependency
packages explicitly when running test. This is done to prevent
ambiguous module name errors in doctest
tests.get-stack
script now works on Windows CI machines of Appveyor,
Travis and Azure Pipelines. See
#4535
PATH
environment
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 init
will now support create a stack.yaml
file without any local
packages. See #2465
docker.db
).GHC_ENVIRONMENT
environment 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-arguments
options. See
#2226
local-programs-path
configuration option.
See #4726
--docker-mount-mode
option to set the Docker volume mount mode
for performance tuning on macOS.Bug fixes:
addDependentFile
,
which now includes a hash. See
yesodweb/yesod#1551
subdirs
for git repos in extra-deps
to match whole directory names.
Also fixes for subdirs: .
. See
#4292
--cabal-files
flag to stack ide targets
command.stack clean
.--file-watch
not responding to file modifications when running
inside docker on Mac. See
#4506
--ghc-options
with stack script --compile
now works.Setup.hs
file. See
#4526.templates
subcommand 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 init
will now work for cabal files with sublibraries. See
#4408
stack
executable when the host stack
is not
compatible with the Docker image (on Linux), and doesn't show an unnecessary
extra error when the in-container re-exec'ed stack
exits with failure.stack ghci
command's --ghc-options
flag now parses multiple options.
See #3315.Thanks to all our contributors for this release:
Changes since v1.9.3
Major changes:
Switch over to pantry for managing packages. This is a major change to Stack's internals, and affects user-visible behavior in a few places. Some highlights:
00-index.tar
style indices. See
#4137.packages
section has
been removed. Instead, you must use extra-deps
for such
dependencies. packages
now only supports local filepaths.stack freeze
command provides support
for automatically generating this additional
information.pantry
library can be
used for interacting with these contents.stack freeze
has been added which outputs
project and snapshot definitions with dependencies pinned to
their exact versions.ignore-revision-mismatch
setting is no longer needed, and
has been removed.cabal-install
versions so stack solver
command was removed as
well as a related option --solver
from stack new
and
stack init
.Upgrade to Cabal 2.4
*.txt
will
match foo.txt
, but not foo.2.txt
.Remove the stack image
command. With the advent of Docker multistage
builds, this functionality is no longer useful. For an example, please see
Building Haskell Apps with
Docker.
Support building GHC from source (experimental)
compiler
can be set to use a GHC
built from source with ghc-git-COMMIT-FLAVOUR
stack.yaml
now supports a configure-options
, which are passed directly to
the configure
step in the Cabal build process. See
#1438
Remove support for building GHCJS itself. Future releases of Stack may remove GHCJS support entirely.
Support for lock files for pinning exact project dependency versions
Behavior changes:
stack.yaml
now supports snapshot
: a synonym for resolver
. See #4256
stack script
now passes -i -idir
in to the ghc
invocation. This makes it so that the script can import local
modules, and fixes an issue where .hs
files in the current
directory could affect interpretation of the script. See
#4538
When using stack script
, custom snapshot files will be resolved
relative to the directory containing the script.
Remove the deprecated --upgrade-cabal
flag to stack setup
.
Support the drop-packages
field in stack.yaml
Remove the GPG signing code during uploads. The GPG signatures have never been used yet, and there are no plans to implement signature verification.
Remove the --plain
option for the exec
family of commands
Always use the --exact-configuration
Cabal configuration option when
building (should mostly be a non-user-visible enhancement).
No longer supports Cabal versions older than 1.19.2
. This means
projects using snapshots earlier than lts-3.0
or
nightly-2015-05-05
will no longer build.
Remove the stack docker cleanup
command. Docker itself now has
docker image prune
and
docker container prune
,
which you can use instead.
Interleaved output is now turned on by default, see
#4702. In
addition, the packagename>
prefix is no longer included in
interelaved mode when only building a single target.
The -fhide-source-paths
GHC option is now enabled by default and
can be disabled via the hide-source-paths
configuration option in
stack.yaml
. See #3784
Stack will reconfigure a package if you modify your PATH
environment
variable. See
#3138.
For GHC 8.4 and later, disable the "shadowed dependencies" workaround. This means that Stack will no longer have to force reconfigures as often. See #3554.
When building a package, Stack takes a lock on the dist directory in use to avoid multiple runs of Stack from trampling each others' files. See #2730.
Stack will check occassionally if there is a new version available and prompt
the user to upgrade. This will not incur any additional network traffic, as
it will piggy-back on the existing Hackage index updates. You can set
recommend-stack-upgrade: false
to bypass this. See
#1681.
stack list-dependencies
has been removed in favour of stack ls dependencies
.
The new default for --docker-auto-pull
is enabled. See
#3332.
Other enhancements:
--color=WHEN
is now also available as a
non-project-specific yaml configuration parameter color:
.NO_COLOR
environment variable is present.stack ls stack-colors
lists the styles and the associated 'ANSI'
control character sequences that stack uses to color some of its output. See
stack ls stack-colors --help
for 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 --help
for more information.--color
, --stack-colors
, stack ls stack-colors
at the command line and
for color:
and stack-colors:
in yaml configuration files.--ddump-dir
. (See #4225)preferred-versions
information from
Hackage for choosing latest version of a package in some cases,
e.g. stack unpack packagename
.The main module to load is ambiguous
message
now include package names so they can be more easily copy-pasted.--tree
to ls dependencies
to list dependencies as tree.
#4101
--pedantic
to ghci
to run with -Wall
and -Werror
#4463
--cabal-files
flag to stack ide targets
command.--stdout
flag to all stack ide
subcommands.ghc-pkg
.
(See #2662)get-stack
script now works on Windows CI machines of Appveyor,
Travis and Azure Pipelines. See
#4535/stack ghci
is invoked outside of a project directory. See
#3651
--extra-dep
flag for adding
packages not present in the snapshot. Currently, this only works
with packages from Hackage, not Git repos or archives.--optimize
or --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 clean
will delete the entire .stack-work/dist
directory,
not just the relevant subdirectory for the current GHC version. See
#4480.stack purge
as a shortcut for stack clean --full
. See
#3863.stack dot
and stack ls dependencies
accept a
--global-hints
flag to bypass the need for an installed GHC. See
#4390.stack config env
command for getting shell script environment
variables. See #620.stack setup
on Windows. See
#1212.ignore-expiry
flag to the hackage-security
section of the ~/.stack/config.yaml
. It allows to disable timestamp
expiration verification just like cabal --ignore-expiry
does.
The flag is not enabled by default so that the default functionality
is not changed.--help
output. See
#893.GHC_ENVIRONMENT
environment variable to specify dependency
packages explicitly when running test. This is done to prevent
ambiguous module name errors in doctest
tests.get-stack
script now works on Windows CI machines of Appveyor,
Travis and Azure Pipelines. See
#4535
PATH
environment
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 init
will now support create a stack.yaml
file without any local
packages. See #2465
docker.db
).GHC_ENVIRONMENT
environment 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-arguments
options. See
#2226
local-programs-path
configuration option.
See #4726
Bug fixes:
addDependentFile
,
which now includes a hash. See
yesodweb/yesod#1551
subdirs
for git repos in extra-deps
to match whole directory names.
Also fixes for subdirs: .
. See
#4292
--cabal-files
flag to stack ide targets
command.stack clean
.--file-watch
not responding to file modifications when running
inside docker on Mac. See
#4506
--ghc-options
with stack script --compile
now works.Setup.hs
file. See
#4526.templates
subcommand 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 init
will now work for cabal files with sublibraries. See
#4408
stack
executable when the host stack
is not compatible with the Docker image (on Linux), and doesn't show an unnecessary
extra error when the in-container re-exec'ed stack
exits with failure.stack ghci
command's --ghc-options
flag now parses multiple options.
See #3315.