Skip to content

Commit

Permalink
use ModeToolBootstrap for compiletest and run-make-support
Browse files Browse the repository at this point in the history
We don't need to ensure std (and rustc) for running run-make-support
and compiletest unit tests. Using stage 0 compiler is already enough and
speeds up `x test compiletest`/`x test run-make-support` invocations on a
clean build.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Jul 13, 2024
1 parent e1f45a1 commit 08f9994
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,15 +678,11 @@ impl Step for CompiletestTest {
/// Runs `cargo test` for compiletest.
fn run(self, builder: &Builder<'_>) {
let host = self.host;
let compiler = builder.compiler(builder.top_stage, host);

// We need `ToolStd` for the locally-built sysroot because
// compiletest uses unstable features of the `test` crate.
builder.ensure(compile::Std::new(compiler, host));
let compiler = builder.compiler(0, host);
let mut cargo = tool::prepare_tool_cargo(
builder,
compiler,
Mode::ToolStd,
Mode::ToolBootstrap,
host,
"test",
"src/tools/compiletest",
Expand Down Expand Up @@ -1325,13 +1321,12 @@ impl Step for CrateRunMakeSupport {
/// Runs `cargo test` for run-make-support.
fn run(self, builder: &Builder<'_>) {
let host = self.host;
let compiler = builder.compiler(builder.top_stage, host);
let compiler = builder.compiler(0, host);

builder.ensure(compile::Std::new(compiler, host));
let mut cargo = tool::prepare_tool_cargo(
builder,
compiler,
Mode::ToolStd,
Mode::ToolBootstrap,
host,
"test",
"src/tools/run-make-support",
Expand Down

0 comments on commit 08f9994

Please sign in to comment.