Skip to content

Commit ee370a1

Browse files
committed
Consistently unset RUSTC_BOOTSTRAP when compiling bootstrap
1 parent 1ead476 commit ee370a1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/bootstrap/bootstrap.py

+13
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,19 @@ def build_bootstrap_cmd(self, env):
917917
if toml_val is not None:
918918
env["{}_{}".format(var_name, host_triple_sanitized)] = toml_val
919919

920+
# In src/etc/rust_analyzer_settings.json, we configure rust-analyzer to
921+
# pass RUSTC_BOOTSTRAP=1 to all cargo invocations because the standard
922+
# library uses unstable Cargo features. Without RUSTC_BOOTSTRAP,
923+
# rust-analyzer would fail to fetch workspace layout when the system's
924+
# default toolchain is not nightly.
925+
#
926+
# But that setting has the collateral effect of rust-analyzer also
927+
# passing RUSTC_BOOTSTRAP=1 to all x.py invocations too (the various
928+
# overrideCommand). For compiling bootstrap, that is unwanted and can
929+
# cause spurious rebuilding of bootstrap when rust-analyzer x.py
930+
# invocations are interleaved with handwritten ones on the command line.
931+
env.pop("RUSTC_BOOTSTRAP", None)
932+
920933
# preserve existing RUSTFLAGS
921934
env.setdefault("RUSTFLAGS", "")
922935

0 commit comments

Comments
 (0)