Skip to content

Commit

Permalink
Consistently unset RUSTC_BOOTSTRAP when compiling bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jan 15, 2024
1 parent 1ead476 commit ee370a1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,19 @@ def build_bootstrap_cmd(self, env):
if toml_val is not None:
env["{}_{}".format(var_name, host_triple_sanitized)] = toml_val

# In src/etc/rust_analyzer_settings.json, we configure rust-analyzer to
# pass RUSTC_BOOTSTRAP=1 to all cargo invocations because the standard
# library uses unstable Cargo features. Without RUSTC_BOOTSTRAP,
# rust-analyzer would fail to fetch workspace layout when the system's
# 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", "")

Expand Down

0 comments on commit ee370a1

Please sign in to comment.