Skip to content

Commit 26e96c8

Browse files
committed
Set RUSTC_BOOTSTRAP=1 consistently
Signed-off-by: onur-ozkan <[email protected]>
1 parent c485ee7 commit 26e96c8

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/bootstrap/bootstrap.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -924,14 +924,18 @@ def build_bootstrap_cmd(self, env):
924924
# default toolchain is not nightly.
925925
#
926926
# 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)
927+
# passing RUSTC_BOOTSTRAP=1 to all x.py invocations too (the various overrideCommand).
928+
# For compiling bootstrap that can cause spurious rebuilding of bootstrap when
929+
# rust-analyzer x.py invocations are interleaved with handwritten ones on the
930+
# command line.
931+
#
932+
# Set RUSTC_BOOTSTRAP=1 consistently.
933+
env["RUSTC_BOOTSTRAP"] = "1"
934+
935+
default_rustflags = "" if env.get("RUSTFLAGS_BOOTSTRAP", "") else "-Zallow-features="
932936

933937
# preserve existing RUSTFLAGS
934-
env.setdefault("RUSTFLAGS", "")
938+
env.setdefault("RUSTFLAGS", default_rustflags)
935939

936940
target_features = []
937941
if self.get_toml("crt-static", build_section) == "true":

0 commit comments

Comments
 (0)