1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351
|
<div class="hidden-warning"><a href="https://docs.haskellstack.org/"><img src="https://cdn.jsdelivr.net/gh/commercialhaskell/stack/doc/img/hidden-warning.svg"></a></div>
# Stack's global flags and options
Stack can also be configured by flags and options on the command line. Global
flags and options apply to all of Stack's commands. In addition, all of Stack's
commands accept the `--setup-info-yaml` and `--snapshot-location-base` options
and the `--help` flag.
## `--allow-different-user` flag
Restrictions: POSIX systems only
Default: True, if inside Docker; false otherwise
Enable/disable permitting users other than the owner of the
[Stack root](stack_root.md) directory to use a Stack installation. For further
information, see the documentation for the corresponding non-project specific
configuration [option](yaml_configuration.md#allow-different-user).
## `--arch` option
Pass the option `--arch <architecture>` to specify the relevant machine
architecture. For further information, see the documentation for the
corresponding non-project specific configuration
[option](yaml_configuration.md#arch).
## `--color` or `-colour` options
Pass the option `stack --color <when>` to specify when to use color in output.
For further information, see the documentation for the corresponding non-project
specific configuration [option](yaml_configuration.md#color).
## `--compiler` option
Pass the option `--compiler <compiler>` to specify the compiler. For further
information, see the [YAML configuration](yaml_configuration.md#compiler)
documentation.
## `--custom-preprocessor-extensions` option
Pass the option `--custom-preprocessor-extensions <extension>` to specify an
extension used for a custom preprocessor. For further information, see the
documentation for the corresponding non-project specific configuration
[option](yaml_configuration.md#custom-preprocessor-extensions).
## `--docker*` flags and options
Stack supports automatically performing builds inside a Docker container. For
further information see `stack --docker-help` or the
[Docker integratiom](docker_integration.md) documentation.
## `--[no-]dump-logs` flag
Default: Dump warning logs
Enables/disables the dumping of the build output logs for project packages to
the console. For further information, see the documentation for the
corresponding non-project specific configuration
[option](yaml_configuration.md#dump-logs).
## `--extra-include-dirs` option
Pass the option `--extra-include-dirs <director>` to specify an extra directory
to check for C header files. The option can be specified multiple times. For
further information, see the documentation for the corresponding non-project
specific configuration [option](yaml_configuration.md#extra-include-dirs).
## `--extra-lib-dirs` option
Pass the option `--extra-lib-dirs <director>` to specify an extra directory
to check for libraries. The option can be specified multiple times. For further
information, see the documentation for the corresponding non-project specific
configuration [option](yaml_configuration.md#extra-lib-dirs).
## `--ghc-build` option
Pass the option `--ghc-build <build>` to specify the relevant specialised GHC
build. For further information, see the documentation for the corresponding
non-project specific configuration [option](yaml_configuration.md#ghc-build).
## `--ghc-variant` option
Pass the option `--ghc-variant <variant>` to specify the relevant GHC variant.
For further information, see the documentation for the corresponding non-project
specific configuration [option](yaml_configuration.md#ghc-variant).
## `--hpack-numeric-version` flag
Pass the flag `--hpack-numeric-version` to cause Stack to report the numeric
version of its built-in Hpack library to the standard output stream (e.g.
`0.35.0`) and quit.
## `--[no-]install-ghc` flag
Default: Enabled
Enables/disables the download and instalation of GHC if necessary. For further
information, see the documentation for the corresponding non-project specific
configuration [option](yaml_configuration.md#install-ghc).
## `--jobs` or `-j` option
Pass the option `--jobs <number_of_jobs>` to specify the number of concurrent
jobs (Stack actions during building) to run.
When [building GHC from source](yaml_configuration.md#building-ghc-from-source),
specifies the `-j[<n>]` flag of GHC's Hadrian build system.
By default, Stack specifies a number of concurrent jobs equal to the number of
CPUs (cores) that the machine has. In some circumstances, that default can cause
some machines to run out of memory during building. If those circumstances
arise, specify `--jobs 1`.
This configuration option is distinct from GHC's own `-j[<n>]` flag, which
relates to parallel compilation of modules within a package.
For further information, see the documentation for the corresponding non-project
specific configuration option: [`jobs`](yaml_configuration.md#jobs).
## `--local-bin-path` option
Pass the option `--local-bin-path <directory>` to set the target directory for
[`stack build --copy-bins`](build_command.md#-no-copy-bins-flag) and
`stack install`. An absolute or relative path can be specified. A relative path
at the command line is always assumed to be relative to the current directory.
For further information, see the documentation for the corresponding non-project
specific configuration [option](yaml_configuration.md#local-bin-path).
## `--lock-file` option
Default: `read-write`, if snapshot specified in YAML configuration file;
`read-only`, if a different snapshot is specified on the command line.
Pass the option `--lock-file <mode>` to specify how Stack interacts with lock
files. Valid modes are:
* `error-on-write`: Stack reports an error, rather than write a lock file;
* `ignore`: Stack ignores lock files;
* `read-only`: Stack only reads lock files; and
* `read-write`: Stack reads and writes lock files.
## `--[no-]modify-code-page` flag
Restrictions: Windows systems only
Default: Enabled
Enables/disables setting the codepage to support UTF-8. For further information,
see the documentation for the corresponding non-project specific configuration
[option](yaml_configuration.md#modify-code-page).
## `--nix*` flags and options
Stack can be configured to integrate with Nix. For further information, see
`stack --nix-help` or the [Nix integration](nix_integration.md) documentation.
## `--numeric-version` flag
Pass the flag `--numeric-version` to cause Stack to report its numeric version
to the standard output stream (e.g. `2.9.1`) and quit.
## `--[no-]plan-in-log` flag
[:octicons-tag-24: 2.13.1](https://github.com/commercialhaskell/stack/releases/tag/v2.13.1)
Default: Disabled
Enables/disables the logging of build plan construction in debug output.
Information about the build plan construction can be lengthy. If you do not need
it, it is best omitted from the debug output.
## `--resolver` option
A synonym for the [`--snapshot` option](#snapshot-option) to specify the
snapshot resolver.
## `--[no-]rsl-in-log` flag
[:octicons-tag-24: 2.9.1](https://github.com/commercialhaskell/stack/releases/tag/v2.9.1)
Default: Disabled
Enables/disables the logging of the raw snapshot layer (rsl) in debug output.
Information about the raw snapshot layer can be lengthy. If you do not need it,
it is best omitted from the debug output.
## `--[no-]script-no-run-compile` flag
Default: Disabled
Enables/disables the use of options `--no-run --compile` with the
[`stack script` command](script_command.md).
## `--silent` flag
Equivalent to the `--verbosity silent` option.
## `--[no-]skip-ghc-check` option
Default: Disabled
Enables/disables the skipping of checking the GHC version and architecture. For
further information, see the documentation for the corresponding non-project
specific configuration [option](yaml_configuration.md#skip-ghc-check).
## `--[no-]skip-msys` option
Restrictions: Windows systems only
Default: Disabled
Enables/disables the skipping of checking for the Stack-supplied MSYS2 (and
installing that MSYS2, if it is not installed) when Stack is setting up the
environment. For further information, see the documentation for the
corresponding non-project specific configuration
[option](yaml_configuration.md#skip-msys).
## `--snapshot` option
[:octicons-tag-24: 2.15.1](https://github.com/commercialhaskell/stack/releases/tag/v2.15.1)
Pass the option `--snapshot <snapshot>` to specify the snapshot. For further
information, see the [YAML configuration](yaml_configuration.md#snapshot)
documentation.
At the command line (only):
* `--snapshot lts-<major_version>` specifies the latest Stackage LTS Haskell
snapshot with the specified major version;
* `--snapshot lts` specifies, from those with the greatest major version, the
latest Stackage LTS Haskell snapshot;
* `--snapshot nightly` specifies the most recent Stackage Nightly snapshot;
and
* `--snapshot global` specifies the snapshot specified by the project-level
configuration file in the `global-project` directory in the
[Stack root](stack_root.md#global-project-directory).
## `--stack-colors` or `--stack-colours` options
Pass the option `--stack-colors <styles>` to specify Stack's output styles. For
further information, see the documentation for the corresponding non-project
specific configuration [option](yaml_configuration.md#stack-colors).
## `--stack-root` option
Overrides: `STACK_ROOT` environment variable
Pass the option `--stack-root <absolute_path_to_the_Stack_root>` to specify the
path to the [Stack root](stack_root.md) directory. The path must be an absolute
one.
## `--stack-yaml` option
Default: `stack.yaml`
Overrides: `STACK_YAML` enviroment variable
Pass the option `--stack-yaml <file>` to specify Stack's project-level YAML
configuration file.
## `--[no-]system-ghc` flag
Default: Disabled
Enables/disables the use of a GHC executable on the PATH, if one is available
and its version matches.
## `--[no-]terminal` flag
Default: Stack is running in a terminal (as detected)
Enables/disables whether Stack is running in a terminal.
## `--terminal-width` option
Default: the terminal width (if detected); otherwise `100`
Pass the option `--terminal-width <width>` to specify the width of the terminal,
used by Stack's pretty printed messages.
## `--[no-]time-in-logs` flag
Default: Enabled
Enables/disables the inclusion of time stamps against logging entries when the
verbosity level is 'debug'.
## `--verbose` or `-v` flags
Equivalent to the `--verbosity debug` option.
## `--verbosity` option
Default: `info`
Pass the option `--verbosity <log_level>` to specify the level for logging.
Possible levels are `silent`, `error`, `warn`, `info` and `debug`, in order of
increasing amounts of information provided by logging.
## `--version` flag
Pass the flag `--version` to cause Stack to report its version to standard
output and quit. For versions that are release candidates, the report will list
the dependencies that Stack has been compiled with.
## `--with-gcc` option
Pass the option `--with-gcc <path_to_gcc>` to specify use of a GCC executable.
For further information, see the documentation for the corresponding non-project
specific configuration [option](yaml_configuration.md#with-gcc).
## `--with-hpack` option
Pass the option `--with-hpack <hpack>` to specify use of an Hpack executable.
For further information, see the documentation for the corresponding
non-project specific configuration [option](yaml_configuration.md#with-hpack).
## `--work-dir` option
Default: `.stack-work`
Overrides: [`STACK_WORK`](environment_variables.md#stack_work) environment
variable, and [`work-dir`](yaml_configuration.md) non-project specific
configuration option.
Pass the option `--work-dir <relative_path_to_the_Stack_root>` to specify the
path to Stack's work directory, within a local project or package directory. The
path must be a relative one, relative to the the root directory of the project
or package. The relative path cannot include a `..` (parent directory)
component.
## `--setup-info-yaml` command option
Default: `https://raw.githubusercontent.com/commercialhaskell/stackage-content/master/stack/stack-setup-2.yaml`
The `--setup-info-yaml <url>` command option specifies the location of a
`setup-info` dictionary. The option can be specified multiple times.
## `--snapshot-location-base` command option
Default: `https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master`
The `--snapshot-location-base <url>` command option specifies the base location
of snapshots.
## `--help` command flag
If Stack is passed the `--help` command flag, it will output help for the
command.
|