Skip to content

Commit b2d35a6

Browse files
authored
Merge pull request #5719 from mpilgrem/fixdoc5664
Fix #5664 Improve STACK_ROOT documentation
2 parents deb4a99 + 4b801a2 commit b2d35a6

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

doc/GUIDE.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,8 +1233,8 @@ The shebang line is not required in that case.
12331233
### Just-in-time compilation
12341234
12351235
You can add the `--compile` flag to make stack compile the script,
1236-
and then run the compiled executable. Compilation is done quickly,
1237-
without optimization. To compile with optimization, use the `--optimize` flag
1236+
and then run the compiled executable. Compilation is done quickly,
1237+
without optimization. To compile with optimization, use the `--optimize` flag
12381238
instead. Compilation is done only if needed; if the executable already exists,
12391239
and is newer than the script, stack just runs the executable directly.
12401240
@@ -1399,12 +1399,18 @@ is that it's the catch-all project whenever you're running stack somewhere else.
13991399
14001400
## Setting stack root location
14011401
1402-
`stack path --stack-root` will tell you the location of the "stack root". Among
1403-
other things, this is where stack stores downloaded programs and snapshot
1404-
packages. This location can be configured by setting the STACK_ROOT environment
1405-
variable or passing the `--stack-root` commandline option. It is particularly
1406-
useful to do this on Windows, where filepaths are limited (MAX_PATH), and things
1407-
can break when this limit is exceeded.
1402+
`stack path --stack-root` will tell you the location of the 'stack root'. This
1403+
is where stack stores snapshot packages, among other things. On operating
1404+
systems other than Windows, it is also where stack stores tools such as ghc and
1405+
msys by default, in a `programs` folder. (On Windows, the default location for
1406+
such tools is `%LOCALAPPDATA%\Programs\stack`.)
1407+
1408+
The location of the stack root can be configured by setting the `STACK_ROOT`
1409+
environment variable or using stack's `--stack-root` option on the command line.
1410+
It is particularly useful to do this on Windows, where the length of filepaths
1411+
may be limited (to
1412+
[MAX_PATH](https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd)),
1413+
and things can break when this limit is exceeded.
14081414
14091415
## `stack.yaml` vs `.cabal` files
14101416

0 commit comments

Comments
 (0)