about summary refs log tree commit diff
diff options
context:
space:
mode:
authoronur-ozkan <work@onurozkan.dev>2024-03-08 22:20:51 +0300
committeronur-ozkan <work@onurozkan.dev>2024-03-14 00:50:32 +0300
commit5aece7fad06baaa745784d118db862b3e3ccf7f8 (patch)
tree83ea838b8a8de163dcdb82744e613de0ef0ac7fe
parent735f7589e3d7d28c2e1bc5c241750ee069d0d65a (diff)
downloadrust-5aece7fad06baaa745784d118db862b3e3ccf7f8.tar.gz
rust-5aece7fad06baaa745784d118db862b3e3ccf7f8.zip
ensure std for cross-targets
Previously, doing `x test compiler/*` would fail the build due to missing std.
This change ensures that it is prepared.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
-rw-r--r--src/bootstrap/src/core/build_steps/test.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
index 4a4497e57db..14a6ee22de6 100644
--- a/src/bootstrap/src/core/build_steps/test.rs
+++ b/src/bootstrap/src/core/build_steps/test.rs
@@ -2564,8 +2564,12 @@ impl Step for Crate {
         let mode = self.mode;
 
         // See [field@compile::Std::force_recompile].
-        builder.ensure(compile::Std::force_recompile(compiler, target));
-        builder.ensure(RemoteCopyLibs { compiler, target });
+        builder.ensure(compile::Std::force_recompile(compiler, compiler.host));
+
+        if builder.config.build != target {
+            builder.ensure(compile::Std::force_recompile(compiler, target));
+            builder.ensure(RemoteCopyLibs { compiler, target });
+        }
 
         // If we're not doing a full bootstrap but we're testing a stage2
         // version of libstd, then what we're actually testing is the libstd