Skip to content
Permalink
Browse files

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!
  • Loading branch information...
alexcrichton committed May 26, 2019
1 parent d96c01e commit ad52c77a46593f2ebd4ae5a291f1a698527bb123
Showing with 15 additions and 15 deletions.
  1. +15 −15 src/bootstrap/tool.rs
@@ -539,9 +539,9 @@ impl Step for Cargo {
}

fn run(self, builder: &Builder<'_>) -> PathBuf {
// Cargo depends on procedural macros, which requires a full host
// compiler to be available, so we need to depend on that.
builder.ensure(compile::Rustc {
// Cargo depends on procedural macros, so make sure the host
// libstd/libproc_macro is available.
builder.ensure(compile::Test {
compiler: self.compiler,
target: builder.config.build,
});
@@ -613,26 +613,26 @@ macro_rules! tool_extended {
tool_extended!((self, builder),
Cargofmt, rustfmt, "src/tools/rustfmt", "cargo-fmt", {};
CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", {
// Clippy depends on procedural macros (serde), which requires a full host
// compiler to be available, so we need to depend on that.
builder.ensure(compile::Rustc {
// Clippy depends on procedural macros, so make sure that's built for
// the compiler itself.
builder.ensure(compile::Test {
compiler: self.compiler,
target: builder.config.build,
});
};
Clippy, clippy, "src/tools/clippy", "clippy-driver", {
// Clippy depends on procedural macros (serde), which requires a full host
// compiler to be available, so we need to depend on that.
builder.ensure(compile::Rustc {
// Clippy depends on procedural macros, so make sure that's built for
// the compiler itself.
builder.ensure(compile::Test {
compiler: self.compiler,
target: builder.config.build,
});
};
Miri, miri, "src/tools/miri", "miri", {};
CargoMiri, miri, "src/tools/miri", "cargo-miri", {
// Miri depends on procedural macros (serde), which requires a full host
// compiler to be available, so we need to depend on that.
builder.ensure(compile::Rustc {
// Miri depends on procedural macros, so make sure that's built for
// the compiler itself.
builder.ensure(compile::Test {
compiler: self.compiler,
target: builder.config.build,
});
@@ -646,9 +646,9 @@ tool_extended!((self, builder),
if clippy.is_some() {
self.extra_features.push("clippy".to_owned());
}
// RLS depends on procedural macros, which requires a full host
// compiler to be available, so we need to depend on that.
builder.ensure(compile::Rustc {
// RLS depends on procedural macros, so make sure that's built for
// the compiler itself.
builder.ensure(compile::Test {
compiler: self.compiler,
target: builder.config.build,
});

0 comments on commit ad52c77

Please sign in to comment.
You can’t perform that action at this time.