Skip to content

Commit

Permalink
Rollup merge of #116532 - onur-ozkan:enable-rustflags-bootstrap-on-bo…
Browse files Browse the repository at this point in the history
…otstrap, 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 #94234
  • Loading branch information
matthiaskrgr authored Oct 8, 2023
2 parents e711ead + 89d610c commit d16f1cc
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 d16f1cc

Please sign in to comment.