Skip to content

Commit b42ff20

Browse files
committed
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.
1 parent 0004b3b commit b42ff20

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/bootstrap/builder.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1783,7 +1783,10 @@ impl<'a> Builder<'a> {
17831783
cargo.env("RUSTC_TLS_MODEL_INITIAL_EXEC", "1");
17841784
}
17851785

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

0 commit comments

Comments
 (0)