]> git.lizzy.rs Git - rust.git/commitdiff
bootstrap: mirror mk's local-rebuild changes
authorJosh Stone <cuviper@gmail.com>
Sat, 21 May 2016 23:46:04 +0000 (16:46 -0700)
committerJosh Stone <cuviper@gmail.com>
Sun, 22 May 2016 07:09:33 +0000 (00:09 -0700)
The rustc for a local-rebuild is assumed to use the current bootstrap
key and already match the current stage1 features.

src/bootstrap/build/config.rs
src/bootstrap/build/mod.rs

index 3c35b9a95169a908478b0fcf9ce0d7a156f4e775..060fb5b8ef3d6af27b30586a6aa2b0a1c432c5d7 100644 (file)
@@ -67,6 +67,7 @@ pub struct Config {
     pub target: Vec<String>,
     pub rustc: Option<String>,
     pub cargo: Option<String>,
+    pub rebuild: bool,
 
     // libstd features
     pub debug_jemalloc: bool,
@@ -315,6 +316,7 @@ macro_rules! check {
                 ("RPATH", self.rust_rpath),
                 ("OPTIMIZE_TESTS", self.rust_optimize_tests),
                 ("DEBUGINFO_TESTS", self.rust_debuginfo_tests),
+                ("LOCAL_REBUILD", self.rebuild),
             }
 
             match key {
index ebc05c5f61c50784a9eccd3a7d2c88b760582f57..9d5a093ab9e096b9d42dc19775feac49908b6b03 100644 (file)
@@ -510,6 +510,14 @@ fn cargo(&self,
              .arg("-j").arg(self.jobs().to_string())
              .arg("--target").arg(target);
 
+        let stage;
+        if compiler.stage == 0 && self.config.rebuild {
+            // Assume the local-rebuild rustc already has stage1 features.
+            stage = 1;
+        } else {
+            stage = compiler.stage;
+        }
+
         // Customize the compiler we're running. Specify the compiler to cargo
         // as our shim and then pass it some various options used to configure
         // how the actual compiler itself is called.
@@ -518,7 +526,7 @@ fn cargo(&self,
         // src/bootstrap/{rustc,rustdoc.rs}
         cargo.env("RUSTC", self.out.join("bootstrap/debug/rustc"))
              .env("RUSTC_REAL", self.compiler_path(compiler))
-             .env("RUSTC_STAGE", compiler.stage.to_string())
+             .env("RUSTC_STAGE", stage.to_string())
              .env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string())
              .env("RUSTC_CODEGEN_UNITS",
                   self.config.rust_codegen_units.to_string())
@@ -744,7 +752,7 @@ fn add_bootstrap_key(&self, compiler: &Compiler, cmd: &mut Command) {
         // In stage0 we're using a previously released stable compiler, so we
         // use the stage0 bootstrap key. Otherwise we use our own build's
         // bootstrap key.
-        let bootstrap_key = if compiler.is_snapshot(self) {
+        let bootstrap_key = if compiler.is_snapshot(self) && !self.config.rebuild {
             &self.bootstrap_key_stage0
         } else {
             &self.bootstrap_key