about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/bootstrap.py19
-rw-r--r--src/bootstrap/src/core/builder.rs19
2 files changed, 23 insertions, 15 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index 6f3be1f6e93..28d96cb1cfe 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -924,14 +924,17 @@ 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 is unwanted and can
-        # cause spurious rebuilding of bootstrap when rust-analyzer x.py
-        # invocations are interleaved with handwritten ones on the command line.
-        env.pop("RUSTC_BOOTSTRAP", None)
-
-        # preserve existing RUSTFLAGS
-        env.setdefault("RUSTFLAGS", "")
+        # 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":
diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
index 4e20babc55a..3770d0687b2 100644
--- a/src/bootstrap/src/core/builder.rs
+++ b/src/bootstrap/src/core/builder.rs
@@ -1799,15 +1799,20 @@ impl<'a> Builder<'a> {
         }
 
         if self.config.rust_remap_debuginfo {
-            // FIXME: handle vendored sources
-            let registry_src = t!(home::cargo_home()).join("registry").join("src");
             let mut env_var = OsString::new();
-            for entry in t!(std::fs::read_dir(registry_src)) {
-                if !env_var.is_empty() {
-                    env_var.push("\t");
-                }
-                env_var.push(t!(entry).path());
+            if self.config.vendor {
+                let vendor = self.build.src.join("vendor");
+                env_var.push(vendor);
                 env_var.push("=/rust/deps");
+            } else {
+                let registry_src = t!(home::cargo_home()).join("registry").join("src");
+                for entry in t!(std::fs::read_dir(registry_src)) {
+                    if !env_var.is_empty() {
+                        env_var.push("\t");
+                    }
+                    env_var.push(t!(entry).path());
+                    env_var.push("=/rust/deps");
+                }
             }
             cargo.env("RUSTC_CARGO_REGISTRY_SRC_TO_REMAP", env_var);
         }