Skip to content

Commit

Permalink
Rollup merge of rust-lang#120096 - onur-ozkan:rustc_bootstrap, r=dtolnay
Browse files Browse the repository at this point in the history
Set RUSTC_BOOTSTRAP=1 consistently

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

cc `@dtolnay` `@petrochenkov`
  • Loading branch information
matthiaskrgr authored Jan 18, 2024
2 parents 135476b + 21b4fe2 commit c6d25cf
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,14 +924,17 @@ def build_bootstrap_cmd(self, env):
# 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)

# preserve existing RUSTFLAGS
env.setdefault("RUSTFLAGS", "")
# 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"

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":
Expand Down

0 comments on commit c6d25cf

Please sign in to comment.