Skip to content

Commit f2db462

Browse files
committed
Re #6920 Document the compiler tools directory in the Stack root
1 parent 365152d commit f2db462

4 files changed

Lines changed: 45 additions & 16 deletions

File tree

doc/commands/build_command.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,8 +1026,10 @@ to Stack's local binary directory (see `stack path --local-bin`). The
10261026
Default: Disabled
10271027

10281028
Set the flag to enable copying of built executable files (binaries) of targets
1029-
to Stack's compiler tools binary directory (see
1030-
`stack path --compiler-tools-bin`).
1029+
to Stack's
1030+
[compiler tools directory](../topics/stack_root.md#compiler-tools-directory-optional)
1031+
for the specified compiler version (see Stack's
1032+
[`path --compiler-tools-bin` command](path_command.md)).
10311033

10321034
### `--coverage` flag
10331035

doc/commands/path_command.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Pass the following flags for information about specific files or locations:
2121
|--bin-path |The PATH in the [Stack environment](../topics/stack_environment.md).|
2222
|--compiler-bin |The directory containing the GHC executable. |
2323
|--compiler-exe |The GHC executable. |
24-
|--compiler-tools-bin |The directory containing binaries specific to a particular compiler.|
24+
|--compiler-tools-bin |The [compiler tools directory](../topics/stack_root.md#compiler-tools-directory-optional) for the specified compiler version.|
2525
|--config-location |Stack's project-level configuration file (`stack.yaml`, by default).|
2626
|--dist-dir |The dist work directory, relative to the package directory.|
2727
|--extra-include-dirs |Extra include directories. |
@@ -36,11 +36,11 @@ Pass the following flags for information about specific files or locations:
3636
|--local-install-root |The root directory for local project installation. |
3737
|--local-pkg-db |The local package database. |
3838
|--programs |The root directory for GHC and other Stack-supplied tools.|
39-
|--project-root |The project root directory.|
39+
|--project-root |The project root directory. |
4040
|--snapshot-doc-root |The root directory for snapshot documentation. |
4141
|--snapshot-install-root|The root directory for snapshot installation. |
4242
|--snapshot-pkg-db |The snapshot package database. |
43-
|--stack-root |The Stack root. |
43+
|--stack-root |The [Stack root](../topics/stack_root.md). |
4444

4545
The command also accepts flags and options of the
4646
[`stack build`](build_command.md#flags-affecting-ghcs-behaviour) command that

doc/topics/stack_environment.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,35 @@ root directory.
4545

4646
## The compiler tools directory
4747

48-
Stack creates, in the [Stack root](stack_root.md), a compiler tools directory
49-
for the specified version of GHC (when the directory is required). Command
50-
[`stack path --compiler-tools-bin`](../commands/path_command.md) to see
51-
that directory.
48+
When the directory is required, Stack creates, in the
49+
[Stack root](stack_root.md#compiler-tools-directory-optional), a compiler tools
50+
directory for the specified compiler version. Command
51+
[`stack path --compiler-tools-bin`](../commands/path_command.md) to see that
52+
directory.
5253

5354
!!! info
5455

5556
Stack's
5657
[`build` command](../commands/build_command.md#-no-copy-compiler-tool-flag)
5758
can be configured to install built executable files of project packages into
58-
the compiler tools directory.
59+
the
60+
[compiler tools directory](stack_root.md#compiler-tools-directory-optional)
61+
for the specified compiler version.
5962

6063
!!! info
6164

62-
If you wish to override a tool that is included in the specified compiler's
63-
binary directory, put a copy of the alternative tool (or a link to it) in
64-
the compiler tools directory.
65+
If you wish to override a tool that is co-located with the specified
66+
compiler's executable file, put a copy of the alternative tool (or a link to
67+
it) in the
68+
[compiler tools directory](stack_root.md#compiler-tools-directory-optional)
69+
for the specified compiler version.
6570

6671
## The compiler binary's directory
6772

68-
The directory in which the GHC binary that will be used by Stack is located.
69-
Command [`stack path --compiler-bin`](../commands/path_command.md) to see
70-
that directory.
73+
The directory in which the GHC executable file (binary) that will be used by
74+
Stack is located. Command
75+
[`stack path --compiler-bin`](../commands/path_command.md) to see that
76+
directory.
7177

7278
## GHC's MinGW `bin` directory (Windows only)
7379

doc/topics/stack_root.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,27 @@ default, in the Stack root.
191191
If the work directory is deleted, and Stack needs that work directory, then
192192
Stack will recreate it.
193193

194+
### `compiler-tools` directory (optional)
195+
196+
When it exists, this contains a directory for the platform. That directory
197+
contains (if it has been created) a directory for a compiler version
198+
that, in turn, contains a `bin` directory (the compiler tools directory for that
199+
compiler version).
200+
201+
If the compiler tools directory for a specified compiler version does not exist,
202+
and Stack needs that directory, then Stack will create it.
203+
204+
In the [Stack environment](stack_environment.md#the-compiler-tools-directory),
205+
the compiler tools directory for the specified compiler version is on the PATH.
206+
207+
For further information see:
208+
209+
* The [Stack environment](stack_environment.md#the-compiler-tools-directory);
210+
* Stack's [`path --compiler-tools-bin` command](../commands/path_command.md);
211+
and
212+
* Stack's
213+
[`build --copy-compiler-tool` command](../commands/build_command.md#-no-copy-compiler-tool-flag).
214+
194215
### `global-project` directory
195216

196217
This contains:

0 commit comments

Comments
 (0)