Skip to content

Commit ded2b43

Browse files
committed
Re #6014 Improve STACK_WORK documentation.
1 parent 7a9ea50 commit ded2b43

File tree

4 files changed

+31
-17
lines changed

4 files changed

+31
-17
lines changed

doc/environment_variables.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,28 +73,34 @@ sequences for color to its output.
7373
Related command: all commands that make use of Stack's global YAML configuration
7474
file (`config.yaml`).
7575

76-
Overridden by: Stack's global `--stack-root` option.
76+
Overridden by: Stack's global
77+
[`--stack-root`](global_flags.md#the---stack-root-option) option.
7778

7879
The environment variable `STACK_ROOT` can be used to specify the Stack root
7980
directory.
8081

8182
## `STACK_WORK`
8283

83-
Related command: all commands that make use of Stack's working directory.
84+
Related command: all commands that make use of Stack's work directories.
8485

85-
Overridden by: Stack's global `--work-dir` option.
86+
Overridden by: Stack's [`work-dir`](yaml_configuration.md#work-dir) non-project
87+
specific configuration option, or global
88+
[`--work-dir`](global_flags.md#the---work-dir-option) option.
8689

87-
The environment variable `STACK_YAML` can be used to specify Stack's
88-
working directory in a project. The path must be a relative one, relative to the
89-
root directory of the project.
90+
The environment variable `STACK_WORK` can be used to specify the path of Stack's
91+
work directory, within a local project or package directory, and override
92+
Stack's default of `.stack-work`. The path must be a relative one, relative to
93+
the root directory of the project or package. The relative path cannot include a
94+
`..` (parent directory) component.
9095

9196
## `STACK_XDG`
9297

9398
Related command: all commands that make use of Stack's user-specific general
9499
YAML configuration file (`config.yaml`).
95100

96101
Overridden by: the use of Stack's `STACK_ROOT` environment variable, or the use
97-
of Stack's global `--stack-root` option.
102+
of Stack's global
103+
[`--stack-root`](global_flags.md#the---stack-root-option) option.
98104

99105
On Unix-like operating systems and Windows, Stack can be configured to follow
100106
the XDG Base Directory Specification if the environment variable `STACK_XDG` is
@@ -105,7 +111,8 @@ set to any non-empty value.
105111
Related command: all commands that make use of Stack's project-level YAML
106112
configuration file.
107113

108-
Overridden by: Stack's global `--stack-yaml` option.
114+
Overridden by: Stack's global
115+
[`--stack-yaml`](global_flags.md#the---stack-yaml-option) option.
109116

110117
The environment variable `STACK_YAML` can be used to specify Stack's
111118
project-level YAML configuration file.

doc/global_flags.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,15 @@ non-project specific configuration [option](yaml_configuration.md#with-hpack).
268268

269269
Default: `.stack-work`
270270

271-
Overrides: `STACK_WORK` environment variable
271+
Overrides: [`STACK_WORK`](environment_variables.md#stack_work) environment
272+
variable, and [`work-dir`](yaml_configuration.md) non-project specific
273+
configuration option.
272274

273275
Pass the option `--work-dir <relative_path_to_the_Stack_root>` to specify the
274-
path to Stack's work directory for the project. The path must be a relative one,
275-
relative to the project's root directory. For further information, see the
276-
documentation for the corresponding non-project specific configuration
277-
[option](yaml_configuration.md#work-dir).
276+
path to Stack's work directory, within a local project or package directory. The
277+
path must be a relative one, relative to the the root directory of the project
278+
or package. The relative path cannot include a `..` (parent directory)
279+
component.
278280

279281
## The `--setup-info-yaml` command option
280282

doc/glossary.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ The following terms are used in Stack's documentation.
4747
|`stack.yaml` |A project-level configuration file used by Stack, which may also contain non-project-specific options.|
4848
|Stackage |A [distribution](https://www.stackage.org/) of compatible Haskell packages.|
4949
|Stack root |A directory in which Stack stores important files. See `stack path --stack-root`. On Windows, or if Stack is configured to use the XDG Base Directory Specification, Stack also stores important files outside of the Stack root.|
50+
|Stack work directory|A directory within a local project or package directory in which Stack stores files created during the build process. Named `.stack-work`, by default.|
5051
|Unix-like operating systems|Linux, FreeBSD and macOS. |
5152
|VS Code |[Visual Studio Code](https://code.visualstudio.com/), a source code editor.|
5253
|Windows |A group of operating systems developed by Microsoft. |

doc/yaml_configuration.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,12 +1565,16 @@ with-hpack: /usr/local/bin/hpack
15651565

15661566
Default: `.stack-work`
15671567

1568-
Command line equivalent (takes precedence): `--work-dir` option
1568+
Command line equivalent (takes precedence):
1569+
[`--work-dir`](global_flags.md#the---work-dir-option) option
15691570

1570-
Environment variable alternative (lowest precedence): `STACK_WORK`
1571+
Environment variable alternative (lowest precedence):
1572+
[`STACK_WORK`](environment_variables.md#stack_work)
15711573

1572-
`work-dir` (or the contents of `STACK_WORK`) specifies the relative path of
1573-
Stack's 'work' directory.
1574+
`work-dir` specifies the path of Stack's work directory, within a local project
1575+
or package directory. The path must be a relative one, relative to the
1576+
root directory of the project or package. The relative path cannot include a
1577+
`..` (parent directory) component.
15741578

15751579
## Customisation scripts
15761580

0 commit comments

Comments
 (0)