@@ -15,20 +15,27 @@ command:
15
15
stack build --flag yackage:-upload
16
16
~~~
17
17
18
- This means: when compiling the ` yackage ` package, turn off the ` upload ` flag
19
- (thus the ` - ` in ` -upload ` ). Unlike other tools, Stack is explicit about which
20
- package's flag you want to change. It does this for two reasons:
18
+ This means: when compiling the ` yackage ` package, turn off the ` upload ` Cabal
19
+ flag (thus the ` - ` in ` -upload ` ). Unlike other tools, Stack is explicit about
20
+ which package's flag you want to change. It does this for two reasons:
21
21
22
22
1 . There's no global meaning for Cabal flags, and therefore two packages can
23
23
use the same flag name for completely different things.
24
+
24
25
2 . By following this approach, we can avoid unnecessarily recompiling snapshot
25
- packages that happen to use a flag that we're using.
26
+ packages that happen to use a Cabal flag that we're using.
26
27
27
- You can also change flag values on the command line for extra-dep and snapshot
28
- packages. If you do this, that package will automatically be promoted to an
29
- extra-dep, since the build plan is different than what the plan snapshot
28
+ You can also change Cabal flag values on the command line for extra-dep and
29
+ snapshot packages. If you do this, that package will automatically be promoted
30
+ to an extra-dep, since the build plan is different than what the plan snapshot
30
31
definition would entail.
31
32
33
+ If you have Cabal flags that you will be setting regularly when building your
34
+ packages, you can add them to your Stack project-level configuration file
35
+ (` stack.yaml ` ). For more information, see the
36
+ [ flags] ( ../configure/yaml/project.md#flags ) project-specific configuration
37
+ option documentation.
38
+
32
39
## GHC options
33
40
34
41
GHC options follow a similar logic as in managing Cabal flags, with a few
@@ -90,10 +97,13 @@ While this specific corner case does catch people by surprise, the overall goal
90
97
of reproducible builds is - in the Stack maintainers' views - worth the
91
98
confusion.
92
99
93
- Final point: if you have GHC options that you'll be regularly passing to your
94
- packages, you can add them to your ` stack.yaml ` file. For more information, see
95
- the [ ghc-options] ( ../configure/yaml/non-project.md#ghc-options ) non-project
96
- specific configuration option documentation.
100
+ If you have GHC options that you will be applying regularly when building your
101
+ packages, you can add them to your Stack project-level configuration file
102
+ (` stack.yaml ` ) or (if applicable) to a
103
+ [ global Stack configuration file] ( ../configure/yaml/index.md#project-level-and-global-configuration-files ) .
104
+ For more information, see the
105
+ [ ghc-options] ( ../configure/yaml/non-project.md#ghc-options ) non-project specific
106
+ configuration option documentation.
97
107
98
108
!!! note
99
109
0 commit comments