diff options
| author | The Miri Conjob Bot <miri@cron.bot> | 2024-01-21 05:45:45 +0000 |
|---|---|---|
| committer | The Miri Conjob Bot <miri@cron.bot> | 2024-01-21 05:45:45 +0000 |
| commit | 3c055f73feade43ca73d47fce55d0add9cebd07f (patch) | |
| tree | 52dc53152f535fad994d8975e519e3c1942fc931 /src/bootstrap/bootstrap.py | |
| parent | 384b2ab37529ba0ad07ea8271baf0f212bab2e5a (diff) | |
| parent | 6d7e80c5bc3cc3b176834322afc50dc8dd100599 (diff) | |
| download | rust-3c055f73feade43ca73d47fce55d0add9cebd07f.tar.gz rust-3c055f73feade43ca73d47fce55d0add9cebd07f.zip | |
Merge from rustc
Diffstat (limited to 'src/bootstrap/bootstrap.py')
| -rw-r--r-- | src/bootstrap/bootstrap.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index fea194a80ef..28d96cb1cfe 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -917,8 +917,24 @@ class RustBuild(object): if toml_val is not None: env["{}_{}".format(var_name, host_triple_sanitized)] = toml_val - # preserve existing RUSTFLAGS - env.setdefault("RUSTFLAGS", "") + # In src/etc/rust_analyzer_settings.json, we configure rust-analyzer to + # pass RUSTC_BOOTSTRAP=1 to all cargo invocations because the standard + # library uses unstable Cargo features. Without RUSTC_BOOTSTRAP, + # rust-analyzer would fail to fetch workspace layout when the system's + # 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. + # + # Set RUSTC_BOOTSTRAP=1 consistently. + env["RUSTC_BOOTSTRAP"] = "1" + + default_rustflags = "" if env.get("RUSTFLAGS_BOOTSTRAP", "") else "-Zallow-features=" + + env.setdefault("RUSTFLAGS", default_rustflags) target_features = [] if self.get_toml("crt-static", build_section) == "true": |
