Skip to content

Commit aa87914

Browse files
committed
Re commercialhaskell#6478 Improve ghc-options documentation
1 parent 96199bb commit aa87914

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

doc/build_command.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,15 +435,19 @@ The effect of `--fast` can be overriden with Stack's
435435

436436
### `--ghc-options` option
437437

438+
Augment and, if applicable, override any GHC command line options specified in
439+
Cabal files (including those created from `package.yaml` files) or in Stack's
440+
YAML configuration files.
441+
438442
`stack build --ghc-options <ghc_options>` passes the specified command line
439443
options to GHC, depending on Stack's
440444
[`apply-ghc-options`](yaml_configuration.md#apply-ghc-options) YAML
441445
configuration option. This option can be specified multiple times.
442446

443-
GHC's command line options are evaluated from left to right. Later options can
444-
override the effect of earlier ones. Stack applies the options specified at the
445-
command line last. Any existing GHC command line options of a package are
446-
applied after those specified at the command line.
447+
GHC's command line options are _order-dependent_ and evaluated from left to
448+
right. Later options can override the effect of earlier ones. Any GHC command
449+
line options for a package specified at Stack's command line are applied after
450+
those specified in Stack's YAML configuration files.
447451

448452
### `--[no-]library-profiling` flag
449453

doc/yaml_configuration.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,10 @@ arguments include `standard`, `gmp4`, `nopie`, `tinfo6`, `tinfo6-libc6-pre232`,
10031003
Default: `{}`
10041004

10051005
Related command line (takes precedence):
1006-
[`stack build --ghc-options`](build_command.md#ghc-options-option) option
1006+
[`stack build --ghc-options`](build_command.md#-ghc-options-option) option
1007+
1008+
Augment and, if applicable, override any GHC command line options specified in
1009+
Cabal files (including those created from `package.yaml` files).
10071010

10081011
`ghc-options` can specify GHC command line options for a named package, all
10091012
local packages that are targets (using the `$targets` key), all local packages
@@ -1019,10 +1022,11 @@ ghc-options:
10191022
~~~
10201023

10211024
GHC's command line options are _order-dependent_ and evaluated from left to
1022-
right. Later options can override earlier options. Stack applies options (as
1023-
applicable) in the order of `$everything`, `$locals`, `$targets`, and then those
1024-
for the named package. Any existing GHC command line options of a package are
1025-
applied after those specified in Stack's YAML configuration.
1025+
right. Later options can override the effect of earlier ones. Stack applies
1026+
options (as applicable) in the order of `$everything`, `$locals`, `$targets`,
1027+
and then those for the named package. Any GHC command line options for a package
1028+
specified at Stack's command line are applied after those specified in Stack's
1029+
YAML configuration files.
10261030

10271031
Since Stack 1.6.1, setting a GHC options for a specific package will
10281032
automatically promote it to a local package (much like setting a custom package

0 commit comments

Comments
 (0)