Rollup merge of #120096 - onur-ozkan:rustc_bootstrap, r=dtolnay

Set RUSTC_BOOTSTRAP=1 consistently

Fixes https://internals.rust-lang.org/t/rust-compiler-with-parallel-build/20099 which is a regression from #120001

cc `@dtolnay` `@petrochenkov`
This commit is contained in:
Matthias Krüger 2024-01-18 20:56:21 +01:00 committed by GitHub
commit c6d25cf1b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -924,14 +924,17 @@ class RustBuild(object):
# default toolchain is not nightly.
#
# But that setting has the collateral effect of rust-analyzer also
# passing RUSTC_BOOTSTRAP=1 to all x.py invocations too (the various
# overrideCommand). For compiling bootstrap, that is unwanted and can
# cause spurious rebuilding of bootstrap when rust-analyzer x.py
# invocations are interleaved with handwritten ones on the command line.
env.pop("RUSTC_BOOTSTRAP", None)
# passing RUSTC_BOOTSTRAP=1 to all x.py invocations too (the various overrideCommand).
# For compiling bootstrap that can cause spurious rebuilding of bootstrap when
# rust-analyzer x.py invocations are interleaved with handwritten ones on the
# command line.
#
# Set RUSTC_BOOTSTRAP=1 consistently.
env["RUSTC_BOOTSTRAP"] = "1"
# preserve existing RUSTFLAGS
env.setdefault("RUSTFLAGS", "")
default_rustflags = "" if env.get("RUSTFLAGS_BOOTSTRAP", "") else "-Zallow-features="
env.setdefault("RUSTFLAGS", default_rustflags)
target_features = []
if self.get_toml("crt-static", build_section) == "true":