Skip to content

Commit 674241b

Browse files
committed
Document the rustc-wrapper configuration.
1 parent 97d9608 commit 674241b

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/doc/src/guide/build-cache.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ a similar result can be achieved by using a third party tool, [sccache].
77
To setup `sccache`, install it with `cargo install sccache` and set
88
`RUSTC_WRAPPER` environmental variable to `sccache` before invoking Cargo.
99
If you use bash, it makes sense to add `export RUSTC_WRAPPER=sccache` to
10-
`.bashrc`. Refer to sccache documentation for more details.
10+
`.bashrc`. Alternatively, you can set `build.rustc-wrapper` in the
11+
[Cargo configuration][config]. Refer to sccache documentation for more
12+
details.
1113

1214
[sccache]: https://github.com/mozilla/sccache
13-
14-
15+
[config]: ../reference/config.md

src/doc/src/reference/config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ debug = false
130130
[build]
131131
jobs = 1 # number of parallel jobs, defaults to # of CPUs
132132
rustc = "rustc" # the rust compiler tool
133+
rustc-wrapper = ".." # run this wrapper instead of `rustc`; useful to set up a
134+
# build cache tool such as `sccache`
133135
rustdoc = "rustdoc" # the doc generator tool
134136
target = "triple" # build for the target triple (ignored by `cargo install`)
135137
target-dir = "target" # path of where to place all generated artifacts

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ system:
2020
compiler instead.
2121
* `RUSTC_WRAPPER` — Instead of simply running `rustc`, Cargo will execute this
2222
specified wrapper instead, passing as its commandline arguments the rustc
23-
invocation, with the first argument being rustc.
23+
invocation, with the first argument being `rustc`. Useful to set up a build
24+
cache tool such as `sccache`.
2425
* `RUSTDOC` — Instead of running `rustdoc`, Cargo will execute this specified
2526
`rustdoc` instance instead.
2627
* `RUSTDOCFLAGS` — A space-separated list of custom flags to pass to all `rustdoc`

0 commit comments

Comments
 (0)