From d6fcc88d67bad5c89f0d1a9ea3dfb00209e57953 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Fri, 8 Mar 2024 22:20:51 +0300 Subject: [PATCH] ensure that sysroot is properly set for cross-targets Previously, doing `x test compiler/*` would fail the build due to missing libraries. This change ensures that it is prepared. Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/test.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 4a4497e57db14..de48de902d55e 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -2573,6 +2573,12 @@ impl Step for Crate { // we're working with automatically. let compiler = builder.compiler_for(compiler.stage, compiler.host, target); + // During cross compilations, sysroot for the target may not be available. + // Ensure that it is prepared. + if builder.config.build != target { + builder.ensure(compile::Std::new(compiler, compiler.host)); + } + let mut cargo = builder::Cargo::new( builder, compiler,