Skip to content

Commit ad52c77

Browse files
committed
ci: Attempt to skip a full rustc compile on dist*
Currently when we're preparing cross-compiled compilers it can take quite some time because we have to build the compiler itself three different times. The first is the normal bootstrap, the second is a second build for the build platform, and the third is the actual target architecture compiler. The second compiler was historically built exclusively for procedural macros, and long ago we didn't actually need it. This commit tries out avoiding that second compiled compiler, meaning we only compile rustc for the build platform only once. Some local testing shows that this is promising, but bors is of course the ultimate test!
1 parent d96c01e commit ad52c77

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/bootstrap/tool.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,9 @@ impl Step for Cargo {
539539
}
540540

541541
fn run(self, builder: &Builder<'_>) -> PathBuf {
542-
// Cargo depends on procedural macros, which requires a full host
543-
// compiler to be available, so we need to depend on that.
544-
builder.ensure(compile::Rustc {
542+
// Cargo depends on procedural macros, so make sure the host
543+
// libstd/libproc_macro is available.
544+
builder.ensure(compile::Test {
545545
compiler: self.compiler,
546546
target: builder.config.build,
547547
});
@@ -613,26 +613,26 @@ macro_rules! tool_extended {
613613
tool_extended!((self, builder),
614614
Cargofmt, rustfmt, "src/tools/rustfmt", "cargo-fmt", {};
615615
CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", {
616-
// Clippy depends on procedural macros (serde), which requires a full host
617-
// compiler to be available, so we need to depend on that.
618-
builder.ensure(compile::Rustc {
616+
// Clippy depends on procedural macros, so make sure that's built for
617+
// the compiler itself.
618+
builder.ensure(compile::Test {
619619
compiler: self.compiler,
620620
target: builder.config.build,
621621
});
622622
};
623623
Clippy, clippy, "src/tools/clippy", "clippy-driver", {
624-
// Clippy depends on procedural macros (serde), which requires a full host
625-
// compiler to be available, so we need to depend on that.
626-
builder.ensure(compile::Rustc {
624+
// Clippy depends on procedural macros, so make sure that's built for
625+
// the compiler itself.
626+
builder.ensure(compile::Test {
627627
compiler: self.compiler,
628628
target: builder.config.build,
629629
});
630630
};
631631
Miri, miri, "src/tools/miri", "miri", {};
632632
CargoMiri, miri, "src/tools/miri", "cargo-miri", {
633-
// Miri depends on procedural macros (serde), which requires a full host
634-
// compiler to be available, so we need to depend on that.
635-
builder.ensure(compile::Rustc {
633+
// Miri depends on procedural macros, so make sure that's built for
634+
// the compiler itself.
635+
builder.ensure(compile::Test {
636636
compiler: self.compiler,
637637
target: builder.config.build,
638638
});
@@ -646,9 +646,9 @@ tool_extended!((self, builder),
646646
if clippy.is_some() {
647647
self.extra_features.push("clippy".to_owned());
648648
}
649-
// RLS depends on procedural macros, which requires a full host
650-
// compiler to be available, so we need to depend on that.
651-
builder.ensure(compile::Rustc {
649+
// RLS depends on procedural macros, so make sure that's built for
650+
// the compiler itself.
651+
builder.ensure(compile::Test {
652652
compiler: self.compiler,
653653
target: builder.config.build,
654654
});

0 commit comments

Comments
 (0)