about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-08-11 16:19:05 +0200
committerGitHub <noreply@github.com>2025-08-11 16:19:05 +0200
commiteee9e60afb29da8b89520eca045af2d65fdc1961 (patch)
tree0d5fe39489e734ec0f99c1e35ea7eb114f4656bf /src
parent77d7a2c1ebdb1f99c5f74c1c4e7b5726d6f66ffb (diff)
parent23946b7f902d7cfa774aa38089553a8cc9e6fafb (diff)
downloadrust-eee9e60afb29da8b89520eca045af2d65fdc1961.tar.gz
rust-eee9e60afb29da8b89520eca045af2d65fdc1961.zip
Rollup merge of #145221 - Kobzol:cargo-dist-fix-2, r=jieyouxu
Fix Cargo cross-compilation (take two)

In https://github.com/rust-lang/rust/pull/145083, I fixed the case of manually invoking `x dist cargo`, but I realized that `x install` creates the `tool::Cargo` step through the `from_build_frompiler` constructor, which doesn't go through `get_tool_target_compiler`. So we just prepare both the host and target stdlibs directly before building Cargo. Ideally we would get rid of `from_build_compiler`, but that will require refactoring the dist and test steps, which is upcoming.

Hopefully fixes https://github.com/rust-lang/rust/issues/145059 for good.
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/src/core/build_steps/tool.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs
index aa00cd03c5b..42f59f00e5a 100644
--- a/src/bootstrap/src/core/build_steps/tool.rs
+++ b/src/bootstrap/src/core/build_steps/tool.rs
@@ -857,7 +857,9 @@ impl Step for Cargo {
     fn run(self, builder: &Builder<'_>) -> ToolBuildResult {
         builder.build.require_submodule("src/tools/cargo", None);
 
+        builder.std(self.build_compiler, builder.host_target);
         builder.std(self.build_compiler, self.target);
+
         builder.ensure(ToolBuild {
             build_compiler: self.build_compiler,
             target: self.target,