4
4
5
5
Stack is configured by the content of YAML files. Stack's YAML configuration
6
6
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.
8
9
9
10
The ** project-level** configuration file (` stack.yaml ` ) contains
10
11
project-specific options and may contain non-project-specific options.
@@ -57,6 +58,8 @@ resolver.
57
58
58
59
### resolver or snapshot
59
60
61
+ Command line equivalent (takes precedence): ` --resolver ` option
62
+
60
63
` resolver ` and ` snapshot ` are synonyms. Only one of these keys is permitted, not
61
64
both.
62
65
@@ -220,6 +223,8 @@ For further information on the format for specifying dependencies, see the
220
223
221
224
Default : ` {}`
222
225
226
+ Command line equivalent (takes precedence) : ` stack build --flag` option
227
+
223
228
Flags can be set for each package separately, e.g.
224
229
225
230
` ` ` yaml
@@ -281,6 +286,8 @@ user-message: ! 'Warning: Some packages were found to be incompatible with the r
281
286
282
287
Default : ` []`
283
288
289
+ Command line equivalent : ` --customer-preprocessor-extensions` option
290
+
284
291
In order for Stack to be aware of any custom preprocessors you are using, add
285
292
their extensions here
286
293
@@ -301,9 +308,11 @@ options below are listed in alphabetic order.
301
308
302
309
(Since 1.0.1)
303
310
311
+ Restrictions : POSIX systems only.
312
+
304
313
Default : ` false`
305
314
306
- Restrictions : POSIX systems only.
315
+ Command line equivalent (takes precedence) : ` --[no-]allow-different-user ` flag
307
316
308
317
Allow users other than the owner of the Stack root to use the Stack
309
318
installation.
@@ -352,12 +361,16 @@ about your snapshot database.
352
361
353
362
# ## arch
354
363
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.
357
365
358
- arch : i386, x86_64
366
+ Command line equivalent (takes precedence) : ` --arch ` option
359
367
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`.
361
374
362
375
# ## build
363
376
@@ -412,6 +425,8 @@ build:
412
425
ddump-dir: ""
413
426
` ` `
414
427
428
+ Command line equivalents (take precedence) : Yes, see below.
429
+
415
430
Allows setting build options which are usually specified on the command line.
416
431
417
432
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
421
436
422
437
# ## color
423
438
439
+ Command line equivalent (takes precedence) : ` --color` option
440
+
424
441
This option specifies when to use color in output. The option is used as
425
442
`color : <WHEN>`, where `<WHEN>` is 'always', 'never', or 'auto'. On Windows
426
443
versions before Windows 10, for terminals that do not support color codes, the
427
444
default is 'never'; color may work on terminals that support color codes.
428
445
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
-
433
446
(The British English spelling (colour) is also accepted. In yaml configuration
434
447
files, the American spelling is the alternative that has priority.)
435
448
436
449
# ## compiler
437
450
438
451
(Since 0.1.7)
439
452
453
+ Command line equivalent (takes precedence) : ` --compiler` option
454
+
440
455
Overrides the compiler version in the resolver. Note that the `compiler-check`
441
456
flag also applies to the version numbers. This uses the same syntax as compiler
442
457
resolvers like `ghc-9.2.4`. This can be used to override the
@@ -591,6 +606,9 @@ repository. See the output of `stack templates`.
591
606
592
607
# ## docker
593
608
609
+ Command line equivalents : ` --docker-*` flags and options (see
610
+ ` stack --docker-help` for details).
611
+
594
612
For further information, see the
595
613
[Docker integration](docker_integration.md#configuration) documentation.
596
614
@@ -600,6 +618,8 @@ For further information, see the
600
618
601
619
Default : ` warning`
602
620
621
+ Command line equivalent (takes precedence) : ` --[no-]dump-logs` flag
622
+
603
623
Control which log output from local non-dependency packages to print to the
604
624
console. By default, Stack will only do this when building a single target
605
625
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
615
635
616
636
Default : ` []`
617
637
638
+ Command line equivalent : ` --extra-include-dirs` option (repeat for each
639
+ directory)
640
+
618
641
A list of extra paths to be searched for header files. Paths should be absolute
619
642
620
643
` ` ` yaml
@@ -631,6 +654,8 @@ may well make sense to include these there as well.
631
654
632
655
Default : ` []`
633
656
657
+ Command line equivalent : ` --extra-lib-dirs` option (repeat for each directory)
658
+
634
659
A list of extra paths to be searched for libraries. Paths should be absolute
635
660
636
661
` ` ` yaml
@@ -640,7 +665,7 @@ extra-lib-dirs:
640
665
641
666
Since these are system-dependent absolute paths, it is recommended that you
642
667
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
644
669
may well make sense to include these there as well.
645
670
646
671
# ## extra-path
@@ -666,10 +691,18 @@ compiler's binary directory - will take precedence over those specified here
666
691
667
692
(Since 1.3.0)
668
693
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`.
673
706
674
707
# ## ghc-options
675
708
@@ -710,7 +743,13 @@ expressive, keys.
710
743
711
744
Default : ` standard`
712
745
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 :
714
753
715
754
* `standard`: Use the standard GHC binary distribution
716
755
* `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.
783
822
784
823
Default : ` true` (since 1.5.0)
785
824
825
+ Command line equivalent (takes precedence) : ` --[no-]install-ghc` flag
826
+
786
827
Whether or not to automatically install GHC when necessary.
787
828
788
829
# ## jobs
789
830
790
831
Default : the number of processors reported by your CPU.
791
832
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 :
795
837
796
838
` ` ` yaml
797
839
jobs: 1
@@ -803,6 +845,8 @@ Default (on Unix-like operating systems): `~/.local/bin`
803
845
804
846
Default (on Windows) : ` %APPDATA%\l ocal\b in`
805
847
848
+ Command line equivalent (takes precedence) : ` --local-bin-path` option
849
+
806
850
Target directory for `stack install` and `stack build --copy-bins`.
807
851
808
852
# ## local-programs-path
@@ -834,9 +878,13 @@ Hackage that make use of `configure` are `network` and `process`.
834
878
835
879
(Since 0.1.6)
836
880
881
+ Restrictions : Windows systems only.
882
+
837
883
Default : ` true`
838
884
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.
840
888
841
889
` ` ` yaml
842
890
modify-code-page: false
@@ -859,18 +907,12 @@ nix:
859
907
shell-file :
860
908
~~~
861
909
910
+ Command line equivalents : ` --nix-*` flags and options (see `stack --nix-help`
911
+ for details).
912
+
862
913
For further information, see the
863
914
[Nix integration](nix_integration.md#configuration) documentation.
864
915
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
-
874
916
# ## package-indices
875
917
876
918
Default :
@@ -1090,6 +1132,8 @@ setup-info-locations: []
1090
1132
1091
1133
(Since 2.3)
1092
1134
1135
+ Command line equivalent (takes precedence) : ` --setup-info-yaml` option
1136
+
1093
1137
By way of introduction, see the [`setup-info`](#setup-info) option. This option
1094
1138
specifies the location(s) of `setup-info` dictionaries.
1095
1139
@@ -1171,16 +1215,20 @@ ghc:
1171
1215
1172
1216
Default : ` false`
1173
1217
1218
+ Command line equivalent (takes precedence) : ` --[no-]skip-ghc-check` flag
1219
+
1174
1220
Should we skip the check to confirm that your system GHC version (on the PATH)
1175
1221
matches what your project expects?
1176
1222
1177
1223
# ## skip-msys
1178
1224
1179
1225
(Since 0.1.2.0)
1180
1226
1227
+ Restrictions : Windows systems only
1228
+
1181
1229
Default : ` false`
1182
1230
1183
- Restrictions : Windows systems only
1231
+ Command line equivalent (takes precedence) : ` --[no-]skip-msys ` flag
1184
1232
1185
1233
Skips checking for and installing MSYS2 when stack is Setting up the
1186
1234
environment. This usually doesn't make sense in project-level configurations,
@@ -1197,6 +1245,8 @@ skip-msys: true
1197
1245
Default : https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/
1198
1246
(as set in the `pantry` library)
1199
1247
1248
+ Command line equivalent (takes precedence) : ` --snapshot-location-base` option
1249
+
1200
1250
Sets the base location of the LTS Haskell or Stackage Nightly snapshots.
1201
1251
1202
1252
For example :
@@ -1219,6 +1269,8 @@ then use a custom `snapshot-location-base` in the closed environments only.
1219
1269
1220
1270
# ## stack-colors
1221
1271
1272
+ Command line equivalent (takes precedence) : ` --stack-colors` option
1273
+
1222
1274
Stack uses styles to format some of its output. The default styles do not work
1223
1275
well with every terminal theme. This option specifies Stack's output styles,
1224
1276
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:
1245
1297
` ` ` yaml
1246
1298
stack-colors: error=31:good=32:shell=35:dir=34:recommendation=32:target=95:module=35:package-component=95:secondary=92:highlight=32
1247
1299
` ` `
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.
1253
1302
1254
1303
(The British English spelling (colour) is also accepted. In YAML configuration
1255
1304
files, the American spelling is the alternative that has priority.)
@@ -1274,6 +1323,8 @@ stack-developer-mode: false
1274
1323
Default : ` false` , unless the [Docker](docker_integration.md) or
1275
1324
[Nix](nix_integration.md) integration is enabled.
1276
1325
1326
+ Command line equivalent (takes precedence) : ` --[no-]system-ghc` flag
1327
+
1277
1328
Enables or disables using the GHC available on the PATH. (Make sure PATH is
1278
1329
explicit, i.e., don't use ~.) Useful to enable if you want to save the time,
1279
1330
bandwidth or storage space needed to setup an isolated GHC.
@@ -1356,6 +1407,8 @@ Customize the URLs where Stack looks for snapshot build plans.
1356
1407
1357
1408
# ## with-gcc
1358
1409
1410
+ Command line equivalent (takes precedence) : ` --with-gcc` option
1411
+
1359
1412
Specify a path to GCC explicitly, rather than relying on the normal path
1360
1413
resolution.
1361
1414
@@ -1365,6 +1418,8 @@ with-gcc: /usr/local/bin/gcc-5
1365
1418
1366
1419
# ## with-hpack
1367
1420
1421
+ Command line equivalent (takes precedence) : ` --with-hpack` option
1422
+
1368
1423
Use an [Hpack](https://github.com/sol/hpack) executable, rather than Stack's
1369
1424
in-built version of the Hpack functionality.
1370
1425
@@ -1378,13 +1433,12 @@ with-hpack: /usr/local/bin/hpack
1378
1433
1379
1434
Default : ` .stack-work`
1380
1435
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 `
1384
1439
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.
1388
1442
1389
1443
# # Customisation
1390
1444
0 commit comments