File tree 3 files changed +29
-10
lines changed
3 files changed +29
-10
lines changed Original file line number Diff line number Diff line change @@ -205,12 +205,8 @@ command line only) with:
205
205
stack build --flag *:[-]<flag_name>
206
206
~~~
207
207
208
- !!! note
209
-
210
- Currently you needs to list all of your modules that interpret flags in the
211
- `other-modules` section of a Cabal file. Cabal (the tool) has a different
212
- behavior currently and doesn't require that the modules be listed. This may
213
- change in a future release.
208
+ In order to set a Cabal flag for a GHC boot package, the package must be
209
+ specified as an extra-dep.
214
210
215
211
### ` --[no-]force-dirty ` flag
216
212
Original file line number Diff line number Diff line change @@ -97,6 +97,24 @@ command:
97
97
stack ghci --package lens
98
98
~~~
99
99
100
+ ## Specifying Cabal flags
101
+
102
+ ` --flag <package_name>:[-]<flag_name> ` sets (or unsets) the specified Cabal flag
103
+ for the specified package.
104
+
105
+ This option can be specified multiple times to set (or unset) multiple Cabal
106
+ flags.
107
+
108
+ The same Cabal flag name can be set (or unset) for multiple packages with:
109
+
110
+ ~~~ text
111
+ --flag *:[-]<flag_name>
112
+ ~~~
113
+
114
+ In order to set a Cabal flag for a GHC boot package, the package must either be
115
+ an extra-dep or the package version must be specified with the ` --package `
116
+ option.
117
+
100
118
## Running plain GHCi
101
119
102
120
` stack ghci ` always runs GHCi configured to load code from packages in your
Original file line number Diff line number Diff line change @@ -241,18 +241,23 @@ the configuration means "extra-deps packages in directories
241
241
242
242
Default : ` {}`
243
243
244
- Command line equivalent (takes precedence) : ` stack build --flag` option
244
+ Command line equivalent (takes precedence) :
245
+ [`stack build --flag`](build_command.md#-flag-option) option
245
246
246
- Flags can be set for each package separately. For example :
247
+ Cabal flags can be set for each package separately. For example :
247
248
248
249
~~~yaml
249
250
flags :
250
251
package-name :
251
252
flag-name : true
252
253
~~~
253
254
254
- If a specified flag is different than the one specified for a snapshot package,
255
- then the snapshot package will automatically be promoted to be an extra-dep.
255
+ If a specified Cabal flag for a package included directly in a snapshot is
256
+ different to the Cabal flag specified for that package in the snapshot, then the
257
+ package will automatically be promoted to be an extra-dep.
258
+
259
+ In order to set a Cabal flag for a GHC boot package, the package must be
260
+ specified as an extra-dep.
256
261
257
262
# ## drop-packages
258
263
You can’t perform that action at this time.
0 commit comments