From 070bd644339ad11d687211c6294c12dff9a26e99 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Tue, 12 Apr 2022 22:26:49 -0500 Subject: [PATCH] Make `x test --stage 2 compiler/rustc_XXX` faster to run Previously, bootstrap unconditionally rebuilt the stage 2 compiler, even if it had previously built stage 1. This changes it to reuse stage 1 if possible. --- src/bootstrap/test.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index b88684791bc6d..476777f9ef3c6 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1899,7 +1899,8 @@ impl Step for CrateLibrustc { fn make_run(run: RunConfig<'_>) { let builder = run.builder; - let compiler = builder.compiler(builder.top_stage, run.build_triple()); + let host = run.build_triple(); + let compiler = builder.compiler_for(builder.top_stage, host, host); let krate = builder.crate_paths[&run.path]; let test_kind = builder.kind.into(); @@ -1936,7 +1937,8 @@ impl Step for Crate { fn make_run(run: RunConfig<'_>) { let builder = run.builder; - let compiler = builder.compiler(builder.top_stage, run.build_triple()); + let host = run.build_triple(); + let compiler = builder.compiler_for(builder.top_stage, host, host); let test_kind = builder.kind.into(); let krate = builder.crate_paths[&run.path];