Skip to content

Commit 90d28ec

Browse files
committed
rustbuild: Enable bootstrapping new hosts
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
1 parent 095f5e7 commit 90d28ec

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/bootstrap/build/step.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,12 @@ impl<'a> Step<'a> {
151151
pub fn deps(&self, build: &'a Build) -> Vec<Step<'a>> {
152152
match self.src {
153153
Source::Rustc { stage: 0 } => {
154-
if self.target == build.config.build {
155-
Vec::new()
156-
} else {
157-
let compiler = Compiler::new(0, &build.config.build);
158-
vec![self.librustc(0, compiler)]
159-
}
154+
assert!(self.target == build.config.build);
155+
Vec::new()
160156
}
161157
Source::Rustc { stage } => {
162-
vec![self.librustc(stage - 1, self.compiler(stage - 1))]
158+
let compiler = Compiler::new(stage - 1, &build.config.build);
159+
vec![self.librustc(stage - 1, compiler)]
163160
}
164161
Source::Librustc { stage, compiler } => {
165162
vec![self.libstd(stage, compiler), self.llvm(())]

0 commit comments

Comments
 (0)