From 8d4d0502bda4910d25261f34e6fc22e2e5b829e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 3 Jul 2025 18:28:00 +0200 Subject: [PATCH] Update `Mode::ToolStd` comment --- src/bootstrap/src/core/build_steps/check.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs index 28644ecc340a..555a02ac5872 100644 --- a/src/bootstrap/src/core/build_steps/check.rs +++ b/src/bootstrap/src/core/build_steps/check.rs @@ -251,10 +251,15 @@ fn prepare_compiler_for_check( match mode { Mode::ToolBootstrap => builder.compiler(0, host), Mode::ToolStd => { - // A small number of tools rely on in-tree standard - // library crates (e.g. compiletest needs libtest). + // These tools require the local standard library to be checked let build_compiler = builder.compiler(builder.top_stage, host); + + // We need to build the host stdlib to check the tool itself. + // We need to build the target stdlib so that the tool can link to it. builder.std(build_compiler, host); + // We could only check this library in theory, but `check::Std` doesn't copy rmetas + // into `build_compiler`'s sysroot to avoid clashes with `.rlibs`, so we build it + // instead. builder.std(build_compiler, target); build_compiler }