Skip to content

Commit c492216

Browse files
committed
expand RUSTC_WRAPPER docs
1 parent ba5b192 commit c492216

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

src/doc/src/reference/config.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,15 +361,17 @@ Sets the executable to use for `rustc`.
361361
* Environment: `CARGO_BUILD_RUSTC_WRAPPER` or `RUSTC_WRAPPER`
362362

363363
Sets a wrapper to execute instead of `rustc`. The first argument passed to the
364-
wrapper is the path to the actual `rustc`.
364+
wrapper is the path to the actual executable to use
365+
(i.e., `build.rustc`, if that is set, or `"rustc"` otherwise).
365366

366367
##### `build.rustc-workspace-wrapper`
367368
* Type: string (program path)
368369
* Default: none
369370
* Environment: `CARGO_BUILD_RUSTC_WORKSPACE_WRAPPER` or `RUSTC_WORKSPACE_WRAPPER`
370371

371372
Sets a wrapper to execute instead of `rustc`, for workspace members only.
372-
The first argument passed to the wrapper is the path to the actual `rustc`.
373+
The first argument passed to the wrapper is the path to the actual
374+
executable to use (i.e., `build.rustc`, if that is set, or `"rustc"` otherwise).
373375
It affects the filename hash so that artifacts produced by the wrapper are cached separately.
374376

375377
##### `build.rustdoc`

src/doc/src/reference/environment-variables.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,18 @@ system:
2121
* `RUSTC` — Instead of running `rustc`, Cargo will execute this specified
2222
compiler instead. See [`build.rustc`] to set via config.
2323
* `RUSTC_WRAPPER` — Instead of simply running `rustc`, Cargo will execute this
24-
specified wrapper instead, passing as its command-line arguments the rustc
25-
invocation, with the first argument being `rustc`. Useful to set up a build
26-
cache tool such as `sccache`. See [`build.rustc-wrapper`] to set via config.
27-
* `RUSTC_WORKSPACE_WRAPPER` — Instead of simply running `rustc`, Cargo will
28-
execute this specified wrapper instead for workspace members only, passing
24+
specified wrapper, passing as its command-line arguments the rustc
25+
invocation, with the first argument being the path to the actual rustc.
26+
Useful to set up a build cache tool such as `sccache`. See
27+
[`build.rustc-wrapper`] to set via config. Setting this to the empty string
28+
overwrites the config and resets cargo to not use a wrapper.
29+
* `RUSTC_WORKSPACE_WRAPPER` — Instead of simply running `rustc`, for workspace
30+
members Cargo will execute this specified wrapper, passing
2931
as its command-line arguments the rustc invocation, with the first argument
30-
being `rustc`. It affects the filename hash so that artifacts produced by
31-
the wrapper are cached separately. See [`build.rustc-workspace-wrapper`]
32-
to set via config.
32+
being the path to the actual rustc. It affects the filename hash
33+
so that artifacts produced by the wrapper are cached separately.
34+
See [`build.rustc-workspace-wrapper`] to set via config. Setting this to the empty string
35+
overwrites the config and resets cargo to not use a wrapper for workspace members.
3336
* `RUSTDOC` — Instead of running `rustdoc`, Cargo will execute this specified
3437
`rustdoc` instance instead. See [`build.rustdoc`] to set via config.
3538
* `RUSTDOCFLAGS` — A space-separated list of custom flags to pass to all `rustdoc`

0 commit comments

Comments
 (0)