Snapshot location¶
This document describes the specification of a snapshot location:
- in YAML configuration files, in the
snapshotorresolver(deprecated) key; or - at the command line, with the
--snapshotor--resolver(deprecated) option.
In YAML configuration files¶
Info
Stack uses the Pantry to specify the location of snapshots. Pantry is geared towards reproducible build plans with cryptographically secure specification of snapshots.
There are four ways to specify a snapshot location:
-
Via a convenience synonym, which provides a short form for some common URLs (see further below).
These are:
-
Stackage LTS Haskell snapshots, for example:
-
Stackage Nightly snapshots, for example:
-
GitHub:
github:user/repo:pathis treated as:
Overriding the default snapshot location base
By default, LTS Haskell and Stackage Nightly snapshot configurations are retrieved from the
stackage-snapshotsGitHub repository of usercommercialhaskell. The snapshot-location-base option allows a custom location to be set. -
-
Via a compiler version, for example:
This snapshot specifies only a compiler version and, indirectly, its boot packages.
-
Via a URL pointing to a snapshot configuration file, for example:
snapshot: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2025/8/17.yaml`For safer, more reproducible builds, you can optionally specify a URL together with a cryptographic hash of its content. For example:
snapshot: url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/12/0.yaml size: 499143 sha256: 781ea577595dff08b9c8794761ba1321020e3e1ec3297fb833fe951cce1bee11sizeis the number of bytes in the file andsha256is the file's SHA256 hash. If not provided, the information will automatically be generated and stored in a lock file. -
Via a relative or absolute local file path pointing to a snapshot configuration file, for example:
This can also be specified as:
This allows local file paths and covenience synonyms to be disambiguated.
At the command line¶
As in YAML configuration files, a snapshot location can be specified via a convenience synoynm, a compiler version, a URL, or a local file path. In addition, at the command line only:
--snapshot lts-<major_version>specifies the latest Stackage LTS Haskell snapshot with the specified major version;--snapshot ltsspecifies, from those with the greatest major version, the latest Stackage LTS Haskell snapshot;--snapshot nightlyspecifies the most recent Stackage Nightly snapshot; and--snapshot globalspecifies the snapshot specified by the project-level configuration file in theglobal-projectdirectory in the Stack root.