From 0b55b0146809ea6013951b92e1405218f2d02fef 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..0fac913e44905 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::Rustc::new(compiler, target)); + } + let mut cargo = builder::Cargo::new( builder, compiler,