From fc0d1dc99bc579b07ad59733d74e9ec6e823d6e9 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Sat, 13 Jul 2024 10:04:33 +0300 Subject: [PATCH 1/2] use `ModeToolBootstrap` for run-make-support's crate tests We don't need to ensure std (and rustc) for testing run-make-support's unit tests. Using stage 0 compiler is already enough and speeds up `x test run-make-support` invocations on a clean build. Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/test.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 0b60587bb792b..33517c5e2e440 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -1325,13 +1325,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", From 41070bd9381bc0604171eba9308869eecd94b20b Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Sat, 13 Jul 2024 19:58:36 +0300 Subject: [PATCH 2/2] explain why we use in-tree std for compiletest Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/test.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 33517c5e2e440..1fa58040a1195 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -686,6 +686,8 @@ impl Step for CompiletestTest { let mut cargo = tool::prepare_tool_cargo( builder, compiler, + // compiletest uses libtest internals; make it use the in-tree std to make sure it never breaks + // when std sources change. Mode::ToolStd, host, "test",