Skip to content

Commit cf9d8bb

Browse files
committed
Merge branch 'stable'
2 parents a1dee53 + af114fb commit cf9d8bb

File tree

1 file changed

+45
-27
lines changed

1 file changed

+45
-27
lines changed

doc/pantry.md

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,16 @@ There are three types of package locations:
9090

9191
1. Hackage packages
9292
2. Git and Mecurial repositories
93-
3. Local or remote archives
93+
3. Local or remote archives (such as GitHub archives)
9494

9595
All three types support optional tree metadata to be added, which can be used
9696
for reproducibility and faster downloads. This information can automatically be
9797
generated in a [lock file](lock_files.md).
9898

9999
### Hackage packages
100100

101-
A package can be identified by its name, version and its Cabal file revision
102-
number, with `0` being the original Cabal file. For example:
101+
A package can be identified by its name, version and Cabal file revision
102+
number, with revision `0` being the original Cabal file. For example:
103103

104104
~~~yaml
105105
extra-deps:
@@ -115,21 +115,23 @@ extra-deps:
115115
- acme-missiles-0.3
116116
~~~
117117

118-
This may result in one build differing from another, if a further Cabal file
119-
revision is added to the package index between builds.
118+
This syntax is often used in practice, but may result in one build differing
119+
from another, if a new or further Cabal file revision is added to the package
120+
index between the builds.
120121

121-
Alternatively, you can specify the package name and version with the SHA256 hash
122-
of the contents of its Cabal file. Doing so is slighly more resilient than using
123-
the Cabal file revision number, as it does not rely on the correct ordering in
124-
the package index. For example:
122+
As an alternative to specifying the Cabal file revision number, you can specify
123+
the package name and version with the SHA256 hash of the contents of its Cabal
124+
file. Doing so is slightly more resilient than using the Cabal file revision
125+
number, as it does not rely on the correct ordering in the package index.
126+
For example:
125127

126128
~~~yaml
127129
extra-deps:
128130
- acme-missiles-0.3@sha256:2ba66a092a32593880a87fb00f3213762d7bca65a687d45965778deb8694c5d1
129131
~~~
130132

131133
Optionally, you can specify also the size of the Cabal file in bytes. For
132-
example:
134+
example (where the file size is `631` bytes):
133135

134136
~~~yaml
135137
extra-deps:
@@ -147,12 +149,15 @@ Optionally, you can specify also the Pantry tree information. For example:
147149

148150
The SHA256 hash of the contents of the Cabal file and its size in bytes is
149151
provided in Stack's lock file. For further information, see the
150-
[lock files](lock_files.md) documentation.
152+
[lock files](lock_files.md) documentation. The SHA256 hash and file size
153+
alternative is also what Stack uses when it makes suggestions about missing
154+
packages.
151155

152156
### Git and Mercurial repositories
153157

154-
You can give a Git or Mercurial repository at a specific commit, and Stack will
155-
clone that repository. For example:
158+
You can specify a Git or Mercurial repository at a specific commit, and Stack
159+
will clone that repository and, if it has submodules (Git), update the
160+
repository's submodules. For example:
156161

157162
~~~yaml
158163
extra-deps:
@@ -193,19 +198,6 @@ the root of the repository. If you specify a value of `subdirs`, then `'.'` is
193198
_not_ included by default and needs to be explicitly specified if a required
194199
package is found in the top-level directory of the repository.
195200

196-
#### GitHub
197-
198-
[:octicons-tag-24: 1.7.1](https://github.com/commercialhaskell/stack/releases/tag/v1.7.1)
199-
200-
You can specify packages from GitHub repository name using `github`. For
201-
example:
202-
203-
~~~yaml
204-
extra-deps:
205-
- github: snoyberg/http-client
206-
commit: a5f4f30f01366738f913968163d856366d7e0342
207-
~~~
208-
209201
#### git-annex
210202

211203
[git-annex](https://git-annex.branchable.com) is not supported. This is because
@@ -225,7 +217,9 @@ following line:
225217
fonts export-ignore
226218
~~~
227219

228-
### Local or remote archives
220+
### Local or remote archives (such as GitHub archives)
221+
222+
#### Filepaths or URLs to archive files
229223

230224
You can use filepaths referring to local archive files or HTTP or HTTPS URLs
231225
referring to remote archive files, either tarballs or ZIP files.
@@ -250,3 +244,27 @@ extra-deps:
250244
- archive: ../acme-missiles-0.3.tar.gz
251245
sha256: e563d8b524017a06b32768c4db8eff1f822f3fb22a90320b7e414402647b735b
252246
~~~
247+
248+
#### GitHub archive files
249+
250+
[:octicons-tag-24: 1.7.1](https://github.com/commercialhaskell/stack/releases/tag/v1.7.1)
251+
252+
You can specify a GitHub respository at a specific commit and Stack will obtain
253+
from GitHub an archive file of the files in the repository at that point in its
254+
history. For example:
255+
256+
~~~yaml
257+
extra-deps:
258+
- github: snoyberg/http-client
259+
commit: a5f4f30f01366738f913968163d856366d7e0342
260+
~~~
261+
262+
!!! note
263+
264+
An archive file of the files in a GitHub repository at a point in its
265+
history is not the same as a clone of the repository (including its history)
266+
and the updating of any submodules. If you need the latter, use the syntax
267+
for a [Git repository](pantry.md#git-and-mercurial-repositories).
268+
269+
If the package fails to build due to missing files, it may be that updated
270+
submodules are required.

0 commit comments

Comments
 (0)