@@ -98,49 +98,45 @@ generated in a [lock file](lock_files.md).
98
98
99
99
# ## Hackage packages
100
100
101
- Packages can be stated by a name- version combination. The basic syntax for this
102
- is :
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 :
103
103
104
104
~~~yaml
105
105
extra-deps :
106
- - acme-missiles-0.3
106
+ - acme-missiles-0.3@rev:0
107
107
~~~
108
108
109
- Using this syntax, the most recent Cabal file revision available will
110
- be used.
111
-
112
- You can specify a specific revision number, with `0` being the original file,
113
- like this :
109
+ A package name and version only can be stated. Using this syntax, the most
110
+ recent Cabal file revision available in the package index will be used. For
111
+ example :
114
112
115
113
~~~yaml
116
114
extra-deps :
117
- - acme-missiles-0.3@rev:0
115
+ - acme-missiles-0.3
118
116
~~~
119
117
120
- For safer, more reproducible builds, you can optionally specify the SHA256 hash
121
- of the Cabal file's contents, like this :
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.
120
+
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
125
123
126
~~~yaml
124
127
extra-deps :
125
128
- acme-missiles-0.3@sha256:2ba66a092a32593880a87fb00f3213762d7bca65a687d45965778deb8694c5d1
126
129
~~~
127
130
128
- You can optionally also specify the size of the Cabal file in bytes, like this :
131
+ Optionally, you can specify also the size of the Cabal file in bytes. For
132
+ example :
129
133
130
134
~~~yaml
131
135
extra-deps :
132
136
- acme-missiles-0.3@sha256:2ba66a092a32593880a87fb00f3213762d7bca65a687d45965778deb8694c5d1,631
133
137
~~~
134
138
135
- !!! note
136
-
137
- Specifying package using SHA256 is slightly more resilient in that it does
138
- not rely on correct ordering in the package index, while revision number is
139
- likely simpler to use. In practice, both should guarantee equally
140
- reproducible build plans.
141
-
142
- You can also include the Pantry tree information. The following would be
143
- generated and stored in the lock file :
139
+ Optionally, you can specify also the Pantry tree information. For example :
144
140
145
141
~~~yaml
146
142
- hackage : acme-missiles-0.3@sha256:2ba66a092a32593880a87fb00f3213762d7bca65a687d45965778deb8694c5d1,613
@@ -149,6 +145,10 @@ generated and stored in the lock file:
149
145
sha256 : 614bc0cca76937507ea0a5ccc17a504c997ce458d7f2f9e43b15a10c8eaeb033
150
146
~~~
151
147
148
+ The SHA256 hash of the contents of the Cabal file and its size in bytes is
149
+ provided in Stack's lock file. For further information, see the
150
+ [lock files](lock_files.md) documentation.
151
+
152
152
# ## Git and Mercurial repositories
153
153
154
154
You can give a Git or Mercurial repository at a specific commit, and Stack will
0 commit comments