Skip to content

Commit 268ea80

Browse files
committed
Merge branch 'stable'
2 parents 8c25ec4 + ff10b3d commit 268ea80

File tree

1 file changed

+95
-41
lines changed

1 file changed

+95
-41
lines changed

doc/yaml_configuration.md

Lines changed: 95 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
Stack is configured by the content of YAML files. Stack's YAML configuration
66
options break down into [project-specific](#project-specific-configuration)
7-
options and [non-project-specific](#non-project-specific-configuration) options. They are configured at the project-level or globally.
7+
options and [non-project-specific](#non-project-specific-configuration) options.
8+
They are configured at the project-level or globally.
89

910
The **project-level** configuration file (`stack.yaml`) contains
1011
project-specific options and may contain non-project-specific options.
@@ -57,6 +58,8 @@ resolver.
5758

5859
### resolver or snapshot
5960

61+
Command line equivalent (takes precedence): `--resolver` option
62+
6063
`resolver` and `snapshot` are synonyms. Only one of these keys is permitted, not
6164
both.
6265

@@ -220,6 +223,8 @@ For further information on the format for specifying dependencies, see the
220223

221224
Default: `{}`
222225

226+
Command line equivalent (takes precedence): `stack build --flag` option
227+
223228
Flags can be set for each package separately, e.g.
224229

225230
```yaml
@@ -281,6 +286,8 @@ user-message: ! 'Warning: Some packages were found to be incompatible with the r
281286

282287
Default: `[]`
283288

289+
Command line equivalent: `--customer-preprocessor-extensions` option
290+
284291
In order for Stack to be aware of any custom preprocessors you are using, add
285292
their extensions here
286293

@@ -301,9 +308,11 @@ options below are listed in alphabetic order.
301308

302309
(Since 1.0.1)
303310

311+
Restrictions: POSIX systems only.
312+
304313
Default: `false`
305314

306-
Restrictions: POSIX systems only.
315+
Command line equivalent (takes precedence): `--[no-]allow-different-user` flag
307316

308317
Allow users other than the owner of the Stack root to use the Stack
309318
installation.
@@ -352,12 +361,16 @@ about your snapshot database.
352361

353362
### arch
354363

355-
Set the architecture for GHC, build directories, etc. Values are those
356-
recognized by Cabal, e.g.:
364+
Default: The machine architecture on which Stack is running.
357365

358-
arch: i386, x86_64
366+
Command line equivalent (takes precedence): `--arch` option
359367

360-
This can also be set via the command line.
368+
Stack identifies different GHC executables by platform (operating system and
369+
machine architecture), (optional) GHC variant and (optional) GHC build.
370+
See [`setup-info`](#setup-info).
371+
372+
`arch` sets the machine architecture. Values are those recognized by Cabal,
373+
including `x86_64`, `i386` and `aarch64`.
361374

362375
### build
363376

@@ -412,6 +425,8 @@ build:
412425
ddump-dir: ""
413426
```
414427

428+
Command line equivalents (take precedence): Yes, see below.
429+
415430
Allows setting build options which are usually specified on the command line.
416431

417432
The meanings of these settings correspond directly with the command line flags
@@ -421,22 +436,22 @@ of the same name. For further information, see the
421436

422437
### color
423438

439+
Command line equivalent (takes precedence): `--color` option
440+
424441
This option specifies when to use color in output. The option is used as
425442
`color: <WHEN>`, where `<WHEN>` is 'always', 'never', or 'auto'. On Windows
426443
versions before Windows 10, for terminals that do not support color codes, the
427444
default is 'never'; color may work on terminals that support color codes.
428445

429-
The color use can also be set at the command line using the equivalent
430-
`--color=<WHEN>` global option. Color use set at the command line takes
431-
precedence over that set in a yaml configuration file.
432-
433446
(The British English spelling (colour) is also accepted. In yaml configuration
434447
files, the American spelling is the alternative that has priority.)
435448

436449
### compiler
437450

438451
(Since 0.1.7)
439452

453+
Command line equivalent (takes precedence): `--compiler` option
454+
440455
Overrides the compiler version in the resolver. Note that the `compiler-check`
441456
flag also applies to the version numbers. This uses the same syntax as compiler
442457
resolvers like `ghc-9.2.4`. This can be used to override the
@@ -591,6 +606,9 @@ repository. See the output of `stack templates`.
591606

592607
### docker
593608

609+
Command line equivalents: `--docker-*` flags and options (see
610+
`stack --docker-help` for details).
611+
594612
For further information, see the
595613
[Docker integration](docker_integration.md#configuration) documentation.
596614

@@ -600,6 +618,8 @@ For further information, see the
600618

601619
Default: `warning`
602620

621+
Command line equivalent (takes precedence): `--[no-]dump-logs` flag
622+
603623
Control which log output from local non-dependency packages to print to the
604624
console. By default, Stack will only do this when building a single target
605625
package or if the log contains warnings, to avoid generating unnecessarily
@@ -615,6 +635,9 @@ dump-logs: all # dump all logs for local non-dependency packages
615635

616636
Default: `[]`
617637

638+
Command line equivalent: `--extra-include-dirs` option (repeat for each
639+
directory)
640+
618641
A list of extra paths to be searched for header files. Paths should be absolute
619642

620643
```yaml
@@ -631,6 +654,8 @@ may well make sense to include these there as well.
631654

632655
Default: `[]`
633656

657+
Command line equivalent: `--extra-lib-dirs` option (repeat for each directory)
658+
634659
A list of extra paths to be searched for libraries. Paths should be absolute
635660

636661
```yaml
@@ -640,7 +665,7 @@ extra-lib-dirs:
640665

641666
Since these are system-dependent absolute paths, it is recommended that you
642667
specify these in your `config.yaml` file. If you control the build environment
643-
in your project's ``stack.yaml``, perhaps through docker or other means, then it
668+
in your project's ``stack.yaml``, perhaps through Docker or other means, then it
644669
may well make sense to include these there as well.
645670

646671
### extra-path
@@ -666,10 +691,18 @@ compiler's binary directory - will take precedence over those specified here
666691

667692
(Since 1.3.0)
668693

669-
Specify a specialized architecture bindist to use. Normally this is
670-
determined automatically, but you can override the autodetected value here.
671-
Possible arguments include `standard`, `gmp4`, `nopie`, `tinfo6`,
672-
`tinfo6-nopie`, `ncurses6`, `int-native` and `integersimple`.
694+
Default: `standard`
695+
696+
Command line equivalent (takes precedence): `--ghc-build` option
697+
698+
Stack identifies different GHC executables by platform (operating system and
699+
machine architecture), (optional) GHC variant and (optional) GHC build.
700+
See [`setup-info`](#setup-info).
701+
702+
`ghc-build` specifies a specialized architecture for the GHC executable.
703+
Normally this is determined automatically, but it can be overriden. Possible
704+
arguments include `standard`, `gmp4`, `nopie`, `tinfo6`, `tinfo6-nopie`,
705+
`ncurses6`, `int-native` and `integersimple`.
673706

674707
### ghc-options
675708

@@ -710,7 +743,13 @@ expressive, keys.
710743

711744
Default: `standard`
712745

713-
Specify a variant binary distribution of GHC to use. Known values:
746+
Command line equivalent (takes precedence): `--ghc-variant` option
747+
748+
Stack identifies different GHC executables by platform (operating system and
749+
machine architecture), (optional) GHC variant and (optional) GHC build.
750+
See [`setup-info`](#setup-info).
751+
752+
`ghc-variant` specifies a variant of the GHC executable. Known values are:
714753

715754
* `standard`: Use the standard GHC binary distribution
716755
* `int-native`: From GHC 9.4.1, use a GHC bindist that uses the Haskell-native
@@ -783,15 +822,18 @@ will receive a warning if this configuration value is set.
783822

784823
Default: `true` (since 1.5.0)
785824

825+
Command line equivalent (takes precedence): `--[no-]install-ghc` flag
826+
786827
Whether or not to automatically install GHC when necessary.
787828

788829
### jobs
789830

790831
Default: the number of processors reported by your CPU.
791832

792-
Specifies how many build tasks should be run in parallel. This can be overloaded
793-
on the command line via `-jN`, for example `-j2`. One usage for this might be to
794-
avoid running out of memory by setting it to 1, like this:
833+
Command line equivalent (takes precedence): `-j`, `--jobs` option
834+
835+
Specifies how many build tasks should be run in parallel. One usage for this
836+
might be to avoid running out of memory by setting it to 1, like this:
795837

796838
```yaml
797839
jobs: 1
@@ -803,6 +845,8 @@ Default (on Unix-like operating systems): `~/.local/bin`
803845

804846
Default (on Windows): `%APPDATA%\local\bin`
805847

848+
Command line equivalent (takes precedence): `--local-bin-path` option
849+
806850
Target directory for `stack install` and `stack build --copy-bins`.
807851

808852
### local-programs-path
@@ -834,9 +878,13 @@ Hackage that make use of `configure` are `network` and `process`.
834878

835879
(Since 0.1.6)
836880

881+
Restrictions: Windows systems only.
882+
837883
Default: `true`
838884

839-
Whether to modify the code page for UTF-8 output when running on Windows.
885+
Command line equivalent (takes precedence): `--[no-]modify-code-page` flag
886+
887+
Whether to modify the code page for UTF-8 output.
840888

841889
```yaml
842890
modify-code-page: false
@@ -859,18 +907,12 @@ nix:
859907
shell-file:
860908
~~~
861909

910+
Command line equivalents: `--nix-*` flags and options (see `stack --nix-help`
911+
for details).
912+
862913
For further information, see the
863914
[Nix integration](nix_integration.md#configuration) documentation.
864915

865-
### os
866-
867-
Set the operating system for GHC, build directories, etc. Values are those
868-
recognized by Cabal, e.g.:
869-
870-
os: windows, linux
871-
872-
You are unlikely to want to change the `os` value.
873-
874916
### package-indices
875917

876918
Default:
@@ -1090,6 +1132,8 @@ setup-info-locations: []
10901132

10911133
(Since 2.3)
10921134

1135+
Command line equivalent (takes precedence): `--setup-info-yaml` option
1136+
10931137
By way of introduction, see the [`setup-info`](#setup-info) option. This option
10941138
specifies the location(s) of `setup-info` dictionaries.
10951139

@@ -1171,16 +1215,20 @@ ghc:
11711215

11721216
Default: `false`
11731217

1218+
Command line equivalent (takes precedence): `--[no-]skip-ghc-check` flag
1219+
11741220
Should we skip the check to confirm that your system GHC version (on the PATH)
11751221
matches what your project expects?
11761222

11771223
### skip-msys
11781224

11791225
(Since 0.1.2.0)
11801226

1227+
Restrictions: Windows systems only
1228+
11811229
Default: `false`
11821230

1183-
Restrictions: Windows systems only
1231+
Command line equivalent (takes precedence): `--[no-]skip-msys` flag
11841232

11851233
Skips checking for and installing MSYS2 when stack is Setting up the
11861234
environment. This usually doesn't make sense in project-level configurations,
@@ -1197,6 +1245,8 @@ skip-msys: true
11971245
Default: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/
11981246
(as set in the `pantry` library)
11991247

1248+
Command line equivalent (takes precedence): `--snapshot-location-base` option
1249+
12001250
Sets the base location of the LTS Haskell or Stackage Nightly snapshots.
12011251

12021252
For example:
@@ -1219,6 +1269,8 @@ then use a custom `snapshot-location-base` in the closed environments only.
12191269

12201270
### stack-colors
12211271

1272+
Command line equivalent (takes precedence): `--stack-colors` option
1273+
12221274
Stack uses styles to format some of its output. The default styles do not work
12231275
well with every terminal theme. This option specifies Stack's output styles,
12241276
allowing new styles to replace the defaults. The option is used as
@@ -1245,11 +1297,8 @@ terminal theme might wish to set the styles as follows:
12451297
```yaml
12461298
stack-colors: error=31:good=32:shell=35:dir=34:recommendation=32:target=95:module=35:package-component=95:secondary=92:highlight=32
12471299
```
1248-
The styles can also be set at the command line using the equivalent
1249-
`--stack-colors=<STYLES>` global option. Styles set at the command line take
1250-
precedence over those set in a YAML configuration file. (In respect of styles
1251-
used in verbose output, some of that output occurs before the configuration file
1252-
is processed.)
1300+
In respect of styles used in verbose output, some of that output occurs before
1301+
the configuration file is processed.
12531302

12541303
(The British English spelling (colour) is also accepted. In YAML configuration
12551304
files, the American spelling is the alternative that has priority.)
@@ -1274,6 +1323,8 @@ stack-developer-mode: false
12741323
Default: `false`, unless the [Docker](docker_integration.md) or
12751324
[Nix](nix_integration.md) integration is enabled.
12761325

1326+
Command line equivalent (takes precedence): `--[no-]system-ghc` flag
1327+
12771328
Enables or disables using the GHC available on the PATH. (Make sure PATH is
12781329
explicit, i.e., don't use ~.) Useful to enable if you want to save the time,
12791330
bandwidth or storage space needed to setup an isolated GHC.
@@ -1356,6 +1407,8 @@ Customize the URLs where Stack looks for snapshot build plans.
13561407

13571408
### with-gcc
13581409

1410+
Command line equivalent (takes precedence): `--with-gcc` option
1411+
13591412
Specify a path to GCC explicitly, rather than relying on the normal path
13601413
resolution.
13611414

@@ -1365,6 +1418,8 @@ with-gcc: /usr/local/bin/gcc-5
13651418

13661419
### with-hpack
13671420

1421+
Command line equivalent (takes precedence): `--with-hpack` option
1422+
13681423
Use an [Hpack](https://github.com/sol/hpack) executable, rather than Stack's
13691424
in-built version of the Hpack functionality.
13701425

@@ -1378,13 +1433,12 @@ with-hpack: /usr/local/bin/hpack
13781433

13791434
Default: `.stack-work`
13801435

1381-
This key specifies the relative path of Stack's 'work' directory. This can also
1382-
be specified by an environment variable or on the command line. The earlier
1383-
items in the list below take precedence:
1436+
Command line equivalent (takes precedence): `--work-dir` option
1437+
1438+
Environment variable alternative (lowest precedence): `STACK_WORK`
13841439

1385-
1. `--work-dir DIR` passed on the command line
1386-
2. `work-dir` in a YAML configuration file
1387-
3. `STACK_WORK` environment variable
1440+
`work-dir` (or the contents of `STACK_WORK`) specifies the relative path of
1441+
Stack's 'work' directory.
13881442

13891443
## Customisation
13901444

0 commit comments

Comments
 (0)