11<div class =" hidden-warning " ><a href =" https://docs.haskellstack.org/ " ><img src =" https://rawgit.com/commercialhaskell/stack/master/doc/img/hidden-warning.svg " ></a ></div >
22
3- # Snapshot and package location
3+ # Package location
44
55[ :octicons-tag-24: 2.1.1] ( https://github.com/commercialhaskell/stack/releases/tag/v2.1.1 )
66
7- This document describes:
8-
9- * the specification of a snapshot location (in the
10- [ ` snapshot ` ] ( ../configure/yaml/project.md#snapshot ) or
11- [ ` resolver ` ] ( ../configure/yaml/project.md#resolver ) key)
12- * the specification of a package location (in the ` extra-deps ` key and in a
13- snapshot)
7+ This document describes the specification of a package location (in the
8+ ` extra-deps ` key and in a snapshot).
149
1510!!! info
1611
1712 Stack uses the [Pantry](https://hackage.haskell.org/package/pantry) to
18- specify the location of snapshots and packages. Pantry is geared towards
19- reproducible build plans with cryptographically secure specification of
20- snapshots and packages.
21-
22- ## Snapshot location
23-
24- There are essentially four different ways of specifying a snapshot location:
25-
26- 1 . Via a compiler version, which is a "compiler only" snapshot. This could be,
27- for example:
28-
29- ~~~ yaml
30- snapshot : ghc-8.6.5
31- ~~~
32-
33- 2. Via a URL pointing to a snapshot configuration file, for example :
34-
35- ~~~yaml
36- snapshot : https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2018/8/21.yaml`
37- ~~~
38-
39- 3. Via a local file path pointing to a snapshot configuration file, for
40- example :
41-
42- ~~~yaml
43- snapshot : my-local-snapshot.yaml
44- ~~~
45-
46- 4. Via a _convenience synonym_, which provides a short form for some common
47- URLs. These are :
48-
49- * GitHub: `github:user/repo:path` is treated as:
50-
51- ~~~text
52- https://raw.githubusercontent.com/user/repo/master/path
53- ~~~
54-
55- * LTS Haskell: `lts-X.Y` is treated (by default) as:
56-
57- ~~~text
58- github:commercialhaskell/stackage-snapshots:lts/X/Y.yaml
59- ~~~
60-
61- * Stackage Nightly: `nightly-YYYY-MM-DD` is treated (by default) as:
62-
63- ~~~text
64- github:commercialhaskell/stackage-snapshots:nightly/YYYY/M/D.yaml
65- ~~~
66-
67- !!! info
68-
69- By default, LTS Haskell and Stackage Nightly snapshot configurations are
70- retrieved from the `stackage-snapshots` GitHub repository of user
71- ` commercialhaskell` . The
72- [snapshot-location-base](../configure/yaml/non-project.md#snapshot-location-base)
73- option allows a custom location to be set.
74-
75- For safer, more reproducible builds, you can optionally specify a URL
76- together with a cryptographic hash of its content. For example :
77-
78- ~~~yaml
79- snapshot :
80- url : https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/12/0.yaml
81- size : 499143
82- sha256 : 781ea577595dff08b9c8794761ba1321020e3e1ec3297fb833fe951cce1bee11
83- ~~~
84-
85- ` size` is the number of bytes in the file and `sha256` is the file's SHA256
86- hash. If not provided, the information will automatically be generated and
87- stored in a [lock file](lock_files.md).
88-
89- # # Package location
13+ specify the location of packages. Pantry is geared towards reproducible
14+ build plans with cryptographically secure specification of packages.
9015
9116There are three types of package locations:
9217
@@ -98,7 +23,7 @@ All three types support optional tree metadata to be added, which can be used
9823for reproducibility and faster downloads. This information can automatically be
9924generated in a [ lock file] ( lock_files.md ) .
10025
101- # ## Hackage packages
26+ ## Hackage packages
10227
10328A package can be identified by its name, version and Cabal file revision
10429number, with revision ` 0 ` being the original Cabal file. For example:
@@ -158,7 +83,7 @@ provided in Stack's lock file. For further information, see the
15883alternative is also what Stack uses when it makes suggestions about missing
15984packages.
16085
161- # ## Git and Mercurial repositories
86+ # # Git and Mercurial repositories
16287
16388You can specify a Git or Mercurial repository at a specific commit, and Stack
16489will clone that repository and, if it has submodules (Git), update the
@@ -222,7 +147,7 @@ the root of the repository. If you specify a value of `subdirs`, then `'.'` is
222147_not_ included by default and needs to be explicitly specified if a required
223148package is found in the top-level directory of the repository.
224149
225- # ### git-annex
150+ # ## git-annex
226151
227152[git-annex](https://git-annex.branchable.com) is not supported. This is because
228153` git archive` does not handle symbolic links outside the work tree. It is still
@@ -241,9 +166,9 @@ following line:
241166fonts export-ignore
242167~~~
243168
244- ### Local or remote archives (such as GitHub archives)
169+ ## Local or remote archives (such as GitHub archives)
245170
246- #### Filepaths or URLs to archive files
171+ ### Filepaths or URLs to archive files
247172
248173You can use filepaths referring to local archive files or HTTP or HTTPS URLs
249174referring to remote archive files, either tarballs or ZIP files.
@@ -275,7 +200,7 @@ extra-deps:
275200 sha256 : e563d8b524017a06b32768c4db8eff1f822f3fb22a90320b7e414402647b735b
276201~~~
277202
278- # ### GitHub archive files
203+ # ## GitHub archive files
279204
280205[:octicons-tag-24 : 1.7.1](https://github.com/commercialhaskell/stack/releases/tag/v1.7.1)
281206
@@ -294,7 +219,7 @@ extra-deps:
294219 An archive file of the files in a GitHub repository at a point in its
295220 history is not the same as a clone of the repository (including its history)
296221 and the updating of any submodules. If you need the latter, use the syntax
297- for a [Git repository](pantry.md #git-and-mercurial-repositories).
222+ for a [Git repository](#git-and-mercurial-repositories).
298223
299224 If the package fails to build due to missing files, it may be that updated
300225 submodules are required.
0 commit comments