Use ccache for stage0 tool and rustc builds
This commit is contained in:
parent
52882f6522
commit
0505ee514b
2 changed files with 22 additions and 0 deletions
|
|
@ -1278,6 +1278,17 @@ pub fn rustc_cargo(
|
|||
));
|
||||
}
|
||||
|
||||
// The stage0 compiler changes infrequently and does not directly depend on code
|
||||
// in the current working directory. Therefore, caching it with sccache should be
|
||||
// useful.
|
||||
// This is only performed for non-incremental builds, as ccache cannot deal with these.
|
||||
if let Some(ref ccache) = builder.config.ccache
|
||||
&& compiler.stage == 0
|
||||
&& !builder.config.incremental
|
||||
{
|
||||
cargo.env("RUSTC_WRAPPER", ccache);
|
||||
}
|
||||
|
||||
rustc_cargo_env(builder, cargo, target, compiler.stage);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -148,6 +148,17 @@ impl Step for ToolBuild {
|
|||
&self.extra_features,
|
||||
);
|
||||
|
||||
// The stage0 compiler changes infrequently and does not directly depend on code
|
||||
// in the current working directory. Therefore, caching it with sccache should be
|
||||
// useful.
|
||||
// This is only performed for non-incremental builds, as ccache cannot deal with these.
|
||||
if let Some(ref ccache) = builder.config.ccache
|
||||
&& matches!(self.mode, Mode::ToolBootstrap)
|
||||
&& !builder.config.incremental
|
||||
{
|
||||
cargo.env("RUSTC_WRAPPER", ccache);
|
||||
}
|
||||
|
||||
// Rustc tools (miri, clippy, cargo, rustfmt, rust-analyzer)
|
||||
// could use the additional optimizations.
|
||||
if self.mode == Mode::ToolRustc && is_lto_stage(&self.compiler) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue