Skip to content

Commit

Permalink
Rollup merge of #111982 - jyn514:disable-incremental, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Revert "Enable incremental independent of stage"

This reverts commit 827f656.

Incremental is not sound to use across stages. Arbitrary changes to the compiler can invalidate the incremental cache - even changes to normal queries, not incremental itself! - and we do not currently enable `incremental-verify-ich` in bootstrap. Since 2018, we highly recommend and nudge users towards stage 1 builds instead of stage 2, and using `keep-stage` for anything other than libstd is very rare.

I don't think the risk of unsoundness is worth the very minor speedup when building libstd. Disable incremental to avoid spurious panics and miscompilations when building with the stage 1 and 2 sysroot.

Combined with #111329, this should fix #76720.

r? `@Mark-Simulacrum`
  • Loading branch information
matthiaskrgr authored Jun 4, 2023
2 parents f2f0e6c + b42ff20 commit d545220
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,10 @@ impl<'a> Builder<'a> {
cargo.env("RUSTC_TLS_MODEL_INITIAL_EXEC", "1");
}

if self.config.incremental {
// Ignore incremental modes except for stage0, since we're
// not guaranteeing correctness across builds if the compiler
// is changing under your feet.
if self.config.incremental && compiler.stage == 0 {
cargo.env("CARGO_INCREMENTAL", "1");
} else {
// Don't rely on any default setting for incr. comp. in Cargo
Expand Down

0 comments on commit d545220

Please sign in to comment.