@@ -119,137 +119,100 @@ packages:
119
119
- .
120
120
~~~
121
121
122
- _NOTE_ From Stack 1.11, Stack moved over to Pantry for managing extra-deps, and
123
- removed some legacy syntax for specifying dependencies in `packages`. Some
124
- conversion notes are provided below.
125
-
126
122
The `packages` key specifies a list of packages that are part of your local
127
- project. These are specified via paths to local directories. The paths are
123
+ project. These are specified via paths to local directories. A path is
128
124
considered relative to the directory containing the `stack.yaml` file. For
129
- example, if your `stack.yaml` is located at `/foo/bar /stack.yaml`, and you have :
125
+ example, if the `stack.yaml` is located at `/dir1/dir2 /stack.yaml`, and has :
130
126
131
127
~~~yaml
132
128
packages :
133
- - hello
134
- - there/world
129
+ - my-package
130
+ - dir3/my-other-package
135
131
~~~
136
132
137
- Your configuration means "I have packages in `/foo/bar/hello` and
138
- ` /foo/bar/there/world ` .
133
+ the configuration means "project packages in directories `/dir1/dir2/my-package`
134
+ and `/dir1/dir2/dir3/my-other-package`" .
139
135
140
- If these packages should be treated as dependencies instead, specify them in
141
- ` extra-deps ` key, described below .
136
+ The ` packages` key is optional. The default value, '`.`', means that the
137
+ project has a single package located in the current directory .
142
138
143
- The `packages` key is _optional_. The default item, '`.`', means that your
144
- project has exactly one package, and it is located in the current directory.
139
+ Each specified package directory must have a valid Cabal file or Hpack
140
+ ` package.yaml` file present. Any subdirectories of the directory are not
141
+ searched for Cabal files. A subdirectories has to be specified as an independent
142
+ item in the list of packages.
145
143
146
- Each package directory specified must have a valid Cabal file or Hpack
147
- ` package.yaml` file present. The subdirectories of the directory are not
148
- searched for Cabal files. Subdirectories will have to be specified as
149
- independent items in the list of packages.
144
+ A project package is different from a dependency, both a snapshot dependency
145
+ (via the [`resolver` or `snapshot`](#resolver-or-snapshot) key) and an
146
+ extra-deps dependency (via the [`extra-deps`](#extra-deps) key). For example:
150
147
151
- Project packages are different from snapshot dependencies (via `resolver`) and
152
- extra dependencies (via `extra-deps`) in multiple ways, e.g. :
148
+ * a project package will be built by default by commanding
149
+ [`stack build`](build_command.md) without specific targets. A dependency will
150
+ only be built if it is depended upon; and
151
+ * test suites and benchmarks may be run for a project package. They are never
152
+ run for a dependency.
153
153
154
- * Project packages will be built by default with a `stack build` without
155
- specific targets. Dependencies will only be built if they are depended upon.
156
- * Test suites and benchmarks may be run for project packages. They are never run
157
- for extra dependencies.
154
+ # ## extra-deps
158
155
159
- __Legacy syntax__ Prior to Stack 1.11, it was possible to specify dependencies
160
- in your `packages` configuration value as well. This support was removed to
161
- simplify the file format. Instead, these values should be moved to `extra-deps`.
162
- As a concrete example, you would convert :
156
+ Default : ` []`
163
157
164
- ~~~yaml
165
- packages :
166
- - .
167
- - location :
168
- git : https://github.com/bitemyapp/esqueleto.git
169
- commit : 08c9b4cdf977d5bcd1baba046a007940c1940758
170
- extra-dep : true
171
- - location :
172
- git : https://github.com/yesodweb/wai.git
173
- commit : 6bf765e000c6fd14e09ebdea6c4c5b1510ff5376
174
- subdirs :
175
- - wai-extra
176
- extra-dep : true
158
+ The `extra-deps` key specifies a list of extra dependencies on top of what is
159
+ defined in the snapshot (specified by the
160
+ [`resolver` or `snapshot`](#resolver-or-snapshot) key). A dependency may come
161
+ from either a Pantry package location or a local file path.
177
162
178
- extra-deps :
179
- - streaming-commons-0.2.0.0
180
- - time-1.9.1
181
- - yesod-colonnade-1.3.0.1
182
- - yesod-elements-1.1
183
- ~~~
163
+ A Pantry package location is one or three different kinds of sources :
184
164
185
- into
165
+ * the package index (Hackage);
166
+ * an archive (a tarball or zip file, either local or over HTTP or HTTPS); or
167
+ * a Git or Mercurial repository.
186
168
187
- ~~~yaml
188
- packages :
189
- - .
169
+ For further information on the format for specifying a Pantry package location,
170
+ see the [Pantry](pantry.md) documentation. For example :
190
171
172
+ ~~~yaml
191
173
extra-deps :
192
- - streaming-commons-0.2.0.0
193
- - time-1.9.1
194
- - yesod-colonnade-1.3.0.1
195
- - yesod-elements-1.1
196
- - git : https://github.com/bitemyapp/esqueleto.git
197
- commit : 08c9b4cdf977d5bcd1baba046a007940c1940758
198
- - git : https://github.com/yesodweb/wai.git
199
- commit : 6bf765e000c6fd14e09ebdea6c4c5b1510ff5376
200
- subdirs :
201
- - wai-extra
174
+ # The latest revision of a package in the package index (Hackage):
175
+ - acme-missiles-0.3
176
+ # A specific revision of a package in the package index (Hackage):
177
+ - acme-missiles-0.3@rev:0
178
+ # An *.tar.gz archive file over HTTPS:
179
+ - url : https://github.com/example-user/my-repo/archive/08c9b4cdf977d5bcd1baba046a007940c1940758.tar.gz
180
+ subdirs :
181
+ - my-package
182
+ # A Git repository at a specific commit:
183
+ - git : https://github.com/example-user/my-repo.git
184
+ commit : 08c9b4cdf977d5bcd1baba046a007940c1940758
185
+ # An archive of files at a point in the history of a GitHub repository
186
+ # (identified by a specific commit):
187
+ - github : example-user/my-repo
188
+ commit : 08c9b4cdf977d5bcd1baba046a007940c1940758
189
+ subdirs :
190
+ - my-package
202
191
~~~
203
192
204
- And, in fact, the `packages` value could be left off entirely since it's using
205
- the default value.
206
-
207
- # ## extra-deps
208
-
209
- Default : ` []`
210
-
211
- This key allows you to specify extra dependencies on top of what is defined in
212
- your snapshot (specified by the `resolver` or `snapshot` key mentioned above).
213
- These dependencies may either come from a local file path or a Pantry package
214
- location.
215
-
216
- For the local file path case, the same relative path rules as apply to
217
- ` packages` apply.
218
-
219
- Pantry package locations allow you to include dependencies from three different
220
- kinds of sources :
193
+ !!! note
221
194
222
- * Hackage
223
- * Archives (tarballs or zip files, either local or over HTTP or HTTPS)
224
- * Git or Mercurial repositories
195
+ GHC boot packages are special. An extra-dep with the same package name and
196
+ version as a GHC boot package will be ignored.
225
197
226
- Here's an example using all of the above :
198
+ For a local file path source, the path is considered relative to the directory
199
+ containing the `stack.yaml` file. For example, if the `stack.yaml` is located
200
+ at `/dir1/dir2/stack.yaml`, and has :
227
201
228
202
~~~yaml
229
203
extra-deps :
230
- - vendor/hashable
231
- - streaming-commons-0.2.0.0
232
- - time-1.9.1
233
- - yesod-colonnade-1.3.0.1
234
- - yesod-elements-1.1
235
- - git : https://github.com/bitemyapp/esqueleto.git
236
- commit : 08c9b4cdf977d5bcd1baba046a007940c1940758
237
- - url : https://github.com/yesodweb/wai/archive/6bf765e000c6fd14e09ebdea6c4c5b1510ff5376.tar.gz
238
- subdirs :
239
- - wai-extra
240
- - github : snoyberg/conduit
241
- commit : 2e3e41de93821bcfe8ec6210aeca21be3f2087bf
242
- subdirs :
243
- - network-conduit-tls
204
+ - my-package
205
+ - dir3/my-other-package
244
206
~~~
245
207
246
- For further information on the format for specifying dependencies, see the
247
- [Pantry](pantry.md) documentation .
208
+ the configuration means "extra-deps packages in directories
209
+ ` /dir1/dir2/my-package ` and `/dir1/dir2/dir3/my-other-package`" .
248
210
249
211
!!! note
250
212
251
- GHC boot packages are special. An extra-dep with the same package name and
252
- version as a GHC boot package will be ignored.
213
+ A specified extra-dep that does not have the format of a valid Pantry
214
+ package location (for example, a reference to a package on Hackage that
215
+ omits the package's version) will be interpreted as a local file path.
253
216
254
217
# ## flags
255
218
0 commit comments