We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ced8e65 + 344800b commit ed2acf1Copy full SHA for ed2acf1
src/bootstrap/src/core/build_steps/tool.rs
@@ -164,6 +164,16 @@ pub fn prepare_tool_cargo(
164
}
165
166
167
+ // The stage0 compiler changes infrequently and does not directly depend on code
168
+ // in the current working directory. Therefore, caching it with sccache should be
169
+ // useful.
170
+ // This is only performed for non-incremental builds, as ccache cannot deal with these.
171
+ if let Some(ref ccache) = builder.config.ccache {
172
+ if matches!(mode, Mode::ToolBootstrap) && !builder.config.incremental {
173
+ cargo.env("RUSTC_WRAPPER", ccache);
174
+ }
175
176
+
177
// clippy tests need to know about the stage sysroot. Set them consistently while building to
178
// avoid rebuilding when running tests.
179
cargo.env("SYSROOT", builder.sysroot(compiler));
0 commit comments