diff --git a/src/doc/src/reference/config.md b/src/doc/src/reference/config.md index ee4430fb3..365ca5daa 100644 --- a/src/doc/src/reference/config.md +++ b/src/doc/src/reference/config.md @@ -361,7 +361,8 @@ Sets the executable to use for `rustc`. * Environment: `CARGO_BUILD_RUSTC_WRAPPER` or `RUSTC_WRAPPER` Sets a wrapper to execute instead of `rustc`. The first argument passed to the -wrapper is the path to the actual `rustc`. +wrapper is the path to the actual executable to use +(i.e., `build.rustc`, if that is set, or `"rustc"` otherwise). ##### `build.rustc-workspace-wrapper` * Type: string (program path) @@ -369,7 +370,8 @@ wrapper is the path to the actual `rustc`. * Environment: `CARGO_BUILD_RUSTC_WORKSPACE_WRAPPER` or `RUSTC_WORKSPACE_WRAPPER` Sets a wrapper to execute instead of `rustc`, for workspace members only. -The first argument passed to the wrapper is the path to the actual `rustc`. +The first argument passed to the wrapper is the path to the actual +executable to use (i.e., `build.rustc`, if that is set, or `"rustc"` otherwise). It affects the filename hash so that artifacts produced by the wrapper are cached separately. ##### `build.rustdoc` diff --git a/src/doc/src/reference/environment-variables.md b/src/doc/src/reference/environment-variables.md index fc184e3b4..b1a5db4c4 100644 --- a/src/doc/src/reference/environment-variables.md +++ b/src/doc/src/reference/environment-variables.md @@ -21,15 +21,18 @@ system: * `RUSTC` — Instead of running `rustc`, Cargo will execute this specified compiler instead. See [`build.rustc`] to set via config. * `RUSTC_WRAPPER` — Instead of simply running `rustc`, Cargo will execute this - specified wrapper instead, passing as its command-line arguments the rustc - invocation, with the first argument being `rustc`. Useful to set up a build - cache tool such as `sccache`. See [`build.rustc-wrapper`] to set via config. -* `RUSTC_WORKSPACE_WRAPPER` — Instead of simply running `rustc`, Cargo will - execute this specified wrapper instead for workspace members only, passing + specified wrapper, passing as its command-line arguments the rustc + invocation, with the first argument being the path to the actual rustc. + Useful to set up a build cache tool such as `sccache`. See + [`build.rustc-wrapper`] to set via config. Setting this to the empty string + overwrites the config and resets cargo to not use a wrapper. +* `RUSTC_WORKSPACE_WRAPPER` — Instead of simply running `rustc`, for workspace + members Cargo will execute this specified wrapper, passing as its command-line arguments the rustc invocation, with the first argument - being `rustc`. It affects the filename hash so that artifacts produced by - the wrapper are cached separately. See [`build.rustc-workspace-wrapper`] - to set via config. + being the path to the actual rustc. It affects the filename hash + so that artifacts produced by the wrapper are cached separately. + See [`build.rustc-workspace-wrapper`] to set via config. Setting this to the empty string + overwrites the config and resets cargo to not use a wrapper for workspace members. * `RUSTDOC` — Instead of running `rustdoc`, Cargo will execute this specified `rustdoc` instance instead. See [`build.rustdoc`] to set via config. * `RUSTDOCFLAGS` — A space-separated list of custom flags to pass to all `rustdoc`