]> git.lizzy.rs Git - rust.git/commitdiff
rustbuild: Enable bootstrapping new hosts
authorAlex Crichton <alex@alexcrichton.com>
Wed, 24 Feb 2016 07:00:48 +0000 (23:00 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Sun, 28 Feb 2016 18:50:13 +0000 (10:50 -0800)
This commit fixes a longstanding issue with the makefiles where all host
platforms bootstrap themselves. This commit alters the build logic for the
bootstrap to instead only bootstrap the build triple, and all other compilers
are compiled from that one compiler.

The benefit of this change is that we can cross-compile compilers which cannot
run on the build platform. For example our builders could start creating
`arm-unknown-linux-gnueabihf` compilers.

This reduces the amount of bootstrapping we do, reducing the amount of test
coverage, but overall it should largely just end in faster build times for
multi-host compiles as well as enabling a feature which can't be done today.

cc #5258

src/bootstrap/build/step.rs

index 2fbf1a6ad1db251240d34a560176241d0ca5e602..6c0c55fddeea35939e149eba27290d7f2beac295 100644 (file)
@@ -151,15 +151,12 @@ fn target(&self, target: &'a str) -> Step<'a> {
     pub fn deps(&self, build: &'a Build) -> Vec<Step<'a>> {
         match self.src {
             Source::Rustc { stage: 0 } => {
-                if self.target == build.config.build {
-                    Vec::new()
-                } else {
-                    let compiler = Compiler::new(0, &build.config.build);
-                    vec![self.librustc(0, compiler)]
-                }
+                assert!(self.target == build.config.build);
+                Vec::new()
             }
             Source::Rustc { stage } => {
-                vec![self.librustc(stage - 1, self.compiler(stage - 1))]
+                let compiler = Compiler::new(stage - 1, &build.config.build);
+                vec![self.librustc(stage - 1, compiler)]
             }
             Source::Librustc { stage, compiler } => {
                 vec![self.libstd(stage, compiler), self.llvm(())]