diff options
| author | bors <bors@rust-lang.org> | 2024-01-23 08:07:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-01-23 08:07:12 +0000 |
| commit | b5a3acfe2b39c40d220bb9fc26b0719a7e073ac3 (patch) | |
| tree | 5cd6a94a8128abc999b9353f31dd2b5413582fb9 /src/bootstrap/bootstrap.py | |
| parent | 3d63f426160f9b276cc425d394bc88bf26942d60 (diff) | |
| parent | cc08dd189895b47117c99d1765c7d2fdb6fb8e1c (diff) | |
| download | rust-b5a3acfe2b39c40d220bb9fc26b0719a7e073ac3.tar.gz rust-b5a3acfe2b39c40d220bb9fc26b0719a7e073ac3.zip | |
Auto merge of #3273 - rust-lang:rustup-2024-01-23, r=RalfJung
Automatic Rustup
Diffstat (limited to 'src/bootstrap/bootstrap.py')
| -rw-r--r-- | src/bootstrap/bootstrap.py | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 28d96cb1cfe..83fdcddecf2 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -924,17 +924,29 @@ class RustBuild(object): # default toolchain is not nightly. # # But that setting has the collateral effect of rust-analyzer also - # passing RUSTC_BOOTSTRAP=1 to all x.py invocations too (the various overrideCommand). - # For compiling bootstrap that can cause spurious rebuilding of bootstrap when - # rust-analyzer x.py invocations are interleaved with handwritten ones on the - # command line. + # passing RUSTC_BOOTSTRAP=1 to all x.py invocations too (the various + # overrideCommand). # - # Set RUSTC_BOOTSTRAP=1 consistently. + # Set a consistent RUSTC_BOOTSTRAP=1 here to prevent spurious rebuilds + # of bootstrap when rust-analyzer x.py invocations are interleaved with + # handwritten ones on the command line. env["RUSTC_BOOTSTRAP"] = "1" - default_rustflags = "" if env.get("RUSTFLAGS_BOOTSTRAP", "") else "-Zallow-features=" - - env.setdefault("RUSTFLAGS", default_rustflags) + # If any of RUSTFLAGS or RUSTFLAGS_BOOTSTRAP are present and nonempty, + # we allow arbitrary compiler flags in there, including unstable ones + # such as `-Zthreads=8`. + # + # But if there aren't custom flags being passed to bootstrap, then we + # cancel the RUSTC_BOOTSTRAP=1 from above by passing `-Zallow-features=` + # to ensure unstable language or library features do not accidentally + # get introduced into bootstrap over time. Distros rely on being able to + # compile bootstrap with a variety of their toolchains, not necessarily + # the same as Rust's CI uses. + if env.get("RUSTFLAGS", "") or env.get("RUSTFLAGS_BOOTSTRAP", ""): + # Preserve existing RUSTFLAGS. + env.setdefault("RUSTFLAGS", "") + else: + env["RUSTFLAGS"] = "-Zallow-features=" target_features = [] if self.get_toml("crt-static", build_section) == "true": |
