Skip to content

Commit 89d610c

Browse files
committed
Add RUSTFLAGS_BOOTSTRAP to RUSTFLAGS for bootstrap compilation
Note that RUSTFLAGS_BOOTSTRAP should always be added to the end of RUSTFLAGS to be actually effective (e.g., if we have `-Dwarnings` in RUSTFLAGS, passing `-Awarnings` from RUSTFLAGS_BOOTSTRAP should override it). Signed-off-by: onur-ozkan <[email protected]>
1 parent 91db3bd commit 89d610c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/bootstrap/bootstrap.py

+7
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,13 @@ def build_bootstrap_cmd(self, env):
954954
if deny_warnings:
955955
env["RUSTFLAGS"] += " -Dwarnings"
956956

957+
# Add RUSTFLAGS_BOOTSTRAP to RUSTFLAGS for bootstrap compilation.
958+
# Note that RUSTFLAGS_BOOTSTRAP should always be added to the end of
959+
# RUSTFLAGS to be actually effective (e.g., if we have `-Dwarnings` in
960+
# RUSTFLAGS, passing `-Awarnings` from RUSTFLAGS_BOOTSTRAP should override it).
961+
if "RUSTFLAGS_BOOTSTRAP" in env:
962+
env["RUSTFLAGS"] += " " + env["RUSTFLAGS_BOOTSTRAP"]
963+
957964
env["PATH"] = os.path.join(self.bin_root(), "bin") + \
958965
os.pathsep + env["PATH"]
959966
if not os.path.isfile(self.cargo()):

0 commit comments

Comments
 (0)