Skip to content

Commit

Permalink
Auto merge of rust-lang#116532 - onur-ozkan:enable-rustflags-bootstra…
Browse files Browse the repository at this point in the history
…p-on-bootstrap, r=albertlarsan68

Add RUSTFLAGS_BOOTSTRAP to RUSTFLAGS for bootstrap compilation

Adds `RUSTFLAGS_BOOTSTRAP` to `RUSTFLAGS` for bootstrap compilation when `RUSTFLAGS_BOOTSTRAP` exists in the environment. With this PR, `RUSTFLAGS_BOOTSTRAP` will affect every build(as we already do for rustc and std) compiled with stage0 compiler.

Resolves rust-lang#94234
  • Loading branch information
bors committed Oct 9, 2023
2 parents 1f48cbc + 89d610c commit 35af2c6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,13 @@ def build_bootstrap_cmd(self, env):
if deny_warnings:
env["RUSTFLAGS"] += " -Dwarnings"

# 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).
if "RUSTFLAGS_BOOTSTRAP" in env:
env["RUSTFLAGS"] += " " + env["RUSTFLAGS_BOOTSTRAP"]

env["PATH"] = os.path.join(self.bin_root(), "bin") + \
os.pathsep + env["PATH"]
if not os.path.isfile(self.cargo()):
Expand Down

0 comments on commit 35af2c6

Please sign in to comment.