Skip to content

Commit 3f21488

Browse files
committed
Merge branch 'stable'
2 parents ab4f5e8 + eff7f3b commit 3f21488

File tree

3 files changed

+29
-10
lines changed

3 files changed

+29
-10
lines changed

doc/build_command.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,8 @@ command line only) with:
205205
stack build --flag *:[-]<flag_name>
206206
~~~
207207

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.
214210

215211
### `--[no-]force-dirty` flag
216212

doc/ghci.md

+18
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,24 @@ command:
9797
stack ghci --package lens
9898
~~~
9999

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+
100118
## Running plain GHCi
101119

102120
`stack ghci` always runs GHCi configured to load code from packages in your

doc/yaml_configuration.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -241,18 +241,23 @@ the configuration means "extra-deps packages in directories
241241

242242
Default: `{}`
243243

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
245246

246-
Flags can be set for each package separately. For example:
247+
Cabal flags can be set for each package separately. For example:
247248

248249
~~~yaml
249250
flags:
250251
package-name:
251252
flag-name: true
252253
~~~
253254

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.
256261

257262
### drop-packages
258263

0 commit comments

Comments
 (0)