|
2 | 2 |
|
3 | 3 | This page is intended to fully document all configuration options available in the stack.yaml file. Note that this page is likely to be both *incomplete* and sometimes *inaccurate*. If you see such cases, please update the page, and if you're not sure how, open an issue labeled "question".
|
4 | 4 |
|
5 |
| -The stack.yaml configuration options break down into [project specific](#project-config) options in: |
| 5 | +The stack.yaml configuration options break down into [project-specific](#project-config) options in: |
6 | 6 |
|
7 | 7 | - `<project dir>/stack.yaml`
|
8 | 8 |
|
9 |
| -and [non-project specific](#non-project-config) options in: |
| 9 | +and [non-project-specific](#non-project-config) options in: |
10 | 10 |
|
11 | 11 | - `/etc/stack/config.yaml` -- for system global non-project default options
|
12 | 12 | - `~/.stack/config.yaml` -- for user non-project default options
|
13 | 13 | - The project file itself may also contain non-project specific options
|
14 | 14 |
|
15 | 15 | *Note:* When stack is invoked outside a stack project it will source project specific options from `~/.stack/global/stack.yaml`. Options in this file will be ignored for a project with its own `<project dir>/stack.yaml`.
|
16 | 16 |
|
17 |
| -## Project config |
18 |
| - |
19 |
| -Project specific options are only valid in the `stack.yaml` file local to a project, not in the user or global config files. |
| 17 | +## Project-specific config |
| 18 | + |
| 19 | +Project-specific options are only valid in the `stack.yaml` file local to a project, not in the user or global config files. |
| 20 | + |
| 21 | +> Note: We define **project** to mean a directory that contains a `stack.yaml` |
| 22 | +> file. We define **package** the same way that Cabal defines a package. (This |
| 23 | +> means a single `.cabal` file---which may contain a library, a test suite, and |
| 24 | +> multiple executables.) Note that a single **Stack project** may contain |
| 25 | +> several **packages**---which might be located in a directory on your |
| 26 | +> computer, on Hackage, in a remote Git or Mercurial repository, or even in a |
| 27 | +> tarball somewhere on the internet. |
| 28 | +
|
| 29 | +In your project-specific options, you specify both **which of your packages** |
| 30 | +to build and **which dependencies to use** when building these packages. Stack |
| 31 | +treats _packages_ and _dependencies_ differently. For dependencies, Stack only |
| 32 | +builds the library part, while for packages Stack builds the library, the |
| 33 | +executables, and the test suite. |
| 34 | + |
| 35 | +The below sections will show you how to tell Stack where to find your packages |
| 36 | +and dependencies. |
| 37 | + |
| 38 | +Note that, using the options described below, it **is possible** to specify in |
| 39 | +your `stack.yaml` multiple sources of the same package/dependency. For example, |
| 40 | +you might specify a version of a project on your local machine, a Stackage |
| 41 | +snapshot that contains the same package, as well as a version of the same |
| 42 | +package on Hackage. For simplicity, **Stack will only use one version of each |
| 43 | +package/dependency.** There are rules that dictate how Stack chooses which |
| 44 | +version to use. Read [the section on |
| 45 | +"shadowing"](http://docs.haskellstack.org/en/stable/architecture/#shadowing) to |
| 46 | +learn more about these rules. |
20 | 47 |
|
21 | 48 | ### packages
|
22 | 49 |
|
@@ -222,7 +249,7 @@ as a reminder for the user to review the configuration and make any changes if
|
222 | 249 | needed. The user can delete this message if the generated configuration is
|
223 | 250 | acceptable.
|
224 | 251 |
|
225 |
| -## Non-project config |
| 252 | +## Non-project-specific config |
226 | 253 |
|
227 | 254 | Non-project config options may go in the global config (`/etc/stack/config.yaml`) or the user config (`~/.stack/config.yaml`).
|
228 | 255 |
|
|
0 commit comments