@@ -90,16 +90,16 @@ There are three types of package locations:
90
90
91
91
1. Hackage packages
92
92
2. Git and Mecurial repositories
93
- 3. Local or remote archives
93
+ 3. Local or remote archives (such as GitHub archives)
94
94
95
95
All three types support optional tree metadata to be added, which can be used
96
96
for reproducibility and faster downloads. This information can automatically be
97
97
generated in a [lock file](lock_files.md).
98
98
99
99
# ## Hackage packages
100
100
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 :
103
103
104
104
~~~yaml
105
105
extra-deps :
@@ -115,21 +115,23 @@ extra-deps:
115
115
- acme-missiles-0.3
116
116
~~~
117
117
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.
120
121
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 :
125
127
126
128
~~~yaml
127
129
extra-deps :
128
130
- acme-missiles-0.3@sha256:2ba66a092a32593880a87fb00f3213762d7bca65a687d45965778deb8694c5d1
129
131
~~~
130
132
131
133
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) :
133
135
134
136
~~~yaml
135
137
extra-deps :
@@ -147,12 +149,15 @@ Optionally, you can specify also the Pantry tree information. For example:
147
149
148
150
The SHA256 hash of the contents of the Cabal file and its size in bytes is
149
151
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.
151
155
152
156
# ## Git and Mercurial repositories
153
157
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 :
156
161
157
162
~~~yaml
158
163
extra-deps :
@@ -193,19 +198,6 @@ the root of the repository. If you specify a value of `subdirs`, then `'.'` is
193
198
_not_ included by default and needs to be explicitly specified if a required
194
199
package is found in the top-level directory of the repository.
195
200
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
-
209
201
# ### git-annex
210
202
211
203
[git-annex](https://git-annex.branchable.com) is not supported. This is because
@@ -225,7 +217,9 @@ following line:
225
217
fonts export-ignore
226
218
~~~
227
219
228
- ### Local or remote archives
220
+ ### Local or remote archives (such as GitHub archives)
221
+
222
+ #### Filepaths or URLs to archive files
229
223
230
224
You can use filepaths referring to local archive files or HTTP or HTTPS URLs
231
225
referring to remote archive files, either tarballs or ZIP files.
@@ -250,3 +244,27 @@ extra-deps:
250
244
- archive : ../acme-missiles-0.3.tar.gz
251
245
sha256 : e563d8b524017a06b32768c4db8eff1f822f3fb22a90320b7e414402647b735b
252
246
~~~
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