Skip to content

Fix cross-compilation of Cargo - #145083

Merged
bors merged 2 commits into
rust-lang:masterfrom
Kobzol:fix-cargo-cross-build
Aug 9, 2025
Merged

Fix cross-compilation of Cargo#145083
bors merged 2 commits into
rust-lang:masterfrom
Kobzol:fix-cargo-cross-build

Conversation

@Kobzol

Copy link
Copy Markdown
Member

Regressed in #144303. I guess this wasn't seen in other ToolTarget tools, because they are more dependent on the compiler and are ~always built together with other stuff that also built the std, while Cargo is relatively self-contained.

Fixes: #145059

r? @jieyouxu

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Aug 8, 2025

@jieyouxujieyouxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jieyouxu

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Aug 8, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 9eb9b5a has been approved by jieyouxu

It is now in the queue for this repository.

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 8, 2025
tgross35 added a commit to tgross35/rust that referenced this pull request Aug 8, 2025
…eyouxu
Fix cross-compilation of Cargo
Regressed in rust-lang#144303. I guess this wasn't seen in other `ToolTarget` tools, because they are more dependent on the compiler and are ~always built together with other stuff that also built the std, while Cargo is relatively self-contained.
Fixes: rust-lang#145059
r? `@jieyouxu`
@tgross35tgross35 mentioned this pull request Aug 8, 2025
bors added a commit that referenced this pull request Aug 8, 2025
Rollup of 7 pull requests
Successful merges:
- #144039 (Use `tcx.short_string()` in more diagnostics)
- #144192 (atomicrmw on pointers: move integer-pointer cast hacks into backend)
- #144823 (coverage: Extract HIR-related helper code out of the main module)
- #144987 (Enable f16 and f128 on targets that were fixed in LLVM21)
- #145001 (regression test for intrinsics may not inline properly on pclmulqdq)
- #145080 (Escape diff strings in MIR dataflow graphviz)
- #145083 (Fix cross-compilation of Cargo)
r? `@ghost`
`@rustbot` modify labels: rollup
@ZalatharZalathar mentioned this pull request Aug 9, 2025
bors added a commit that referenced this pull request Aug 9, 2025
Rollup of 23 pull requests
Successful merges:
- #141658 (rustdoc search: prefer stable items in search results)
- #141828 (Add diagnostic explaining STATUS_STACK_BUFFER_OVERRUN not only being used for stack buffer overruns if link.exe exits with that exit code)
- #144823 (coverage: Extract HIR-related helper code out of the main module)
- #144883 (Remove unneeded `drop_in_place` calls)
- #144923 (Move several more float tests to floats/mod.rs)
- #144988 (Add annotations to the graphviz region graph on region origins)
- #145010 (Couple of minor abi handling cleanups)
- #145017 (Explicitly disable vector feature on s390x baseline of bad-reg test)
- #145027 (Optimize `char::is_alphanumeric`)
- #145050 (add member constraints tests)
- #145073 (update enzyme submodule to handle llvm 21)
- #145080 (Escape diff strings in MIR dataflow graphviz)
- #145082 (Fix some bad formatting in `-Zmacro-stats` output.)
- #145083 (Fix cross-compilation of Cargo)
- #145096 (Fix wasm target build with atomics feature)
- #145097 (remove unnecessary `TypeFoldable` impls)
- #145100 (Rank doc aliases lower than equivalently matched items)
- #145103 (rustc_metadata: remove unused private trait impls)
- #145115 (defer opaque type errors, generally greatly reduce tainting)
- #145119 (rustc_public: fix missing parenthesis in pretty discriminant)
- #145124 (Recover `for PAT = EXPR {}`)
- #145132 (Refactor map_unit_fn lint)
- #145134 (Reduce indirect assoc parent queries)
r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Aug 9, 2025
Rollup of 23 pull requests
Successful merges:
- #141658 (rustdoc search: prefer stable items in search results)
- #141828 (Add diagnostic explaining STATUS_STACK_BUFFER_OVERRUN not only being used for stack buffer overruns if link.exe exits with that exit code)
- #144823 (coverage: Extract HIR-related helper code out of the main module)
- #144883 (Remove unneeded `drop_in_place` calls)
- #144923 (Move several more float tests to floats/mod.rs)
- #144988 (Add annotations to the graphviz region graph on region origins)
- #145010 (Couple of minor abi handling cleanups)
- #145017 (Explicitly disable vector feature on s390x baseline of bad-reg test)
- #145027 (Optimize `char::is_alphanumeric`)
- #145050 (add member constraints tests)
- #145073 (update enzyme submodule to handle llvm 21)
- #145080 (Escape diff strings in MIR dataflow graphviz)
- #145082 (Fix some bad formatting in `-Zmacro-stats` output.)
- #145083 (Fix cross-compilation of Cargo)
- #145096 (Fix wasm target build with atomics feature)
- #145097 (remove unnecessary `TypeFoldable` impls)
- #145100 (Rank doc aliases lower than equivalently matched items)
- #145103 (rustc_metadata: remove unused private trait impls)
- #145115 (defer opaque type errors, generally greatly reduce tainting)
- #145119 (rustc_public: fix missing parenthesis in pretty discriminant)
- #145124 (Recover `for PAT = EXPR {}`)
- #145132 (Refactor map_unit_fn lint)
- #145134 (Reduce indirect assoc parent queries)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 0b28978 into rust-lang:masterAug 9, 2025
10 checks passed
@rustbotrustbot added this to the 1.91.0 milestone Aug 9, 2025
rust-timer added a commit that referenced this pull request Aug 9, 2025
Rollup merge of #145083 - Kobzol:fix-cargo-cross-build, r=jieyouxu
Fix cross-compilation of Cargo
Regressed in #144303. I guess this wasn't seen in other `ToolTarget` tools, because they are more dependent on the compiler and are ~always built together with other stuff that also built the std, while Cargo is relatively self-contained.
Fixes: #145059
r? ``@jieyouxu``
@Kobzol
Kobzol deleted the fix-cargo-cross-build branch August 9, 2025 12:19
@jieyouxu

Copy link
Copy Markdown
Member

Fix already-merged PRs of bors
@bors r-

@borsbors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 9, 2025
@jieyouxu

Copy link
Copy Markdown
Member

@rustbot label: -S-waiting-on-author +S-waiting-on-bors +merged-by-bors

@rustbotrustbot added merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 9, 2025
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 11, 2025
Fix Cargo cross-compilation (take two)
In rust-lang#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 fixesrust-lang#145059 for good.
rust-timer added a commit that referenced this pull request Aug 11, 2025
Rollup merge of #145221 - Kobzol:cargo-dist-fix-2, r=jieyouxu
Fix Cargo cross-compilation (take two)
In #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#145059 for good.
rust-cloud-vmsBot pushed a commit to makai410/rustc_public that referenced this pull request Aug 16, 2025
Rollup of 23 pull requests
Successful merges:
- rust-lang/rust#141658 (rustdoc search: prefer stable items in search results)
- rust-lang/rust#141828 (Add diagnostic explaining STATUS_STACK_BUFFER_OVERRUN not only being used for stack buffer overruns if link.exe exits with that exit code)
- rust-lang/rust#144823 (coverage: Extract HIR-related helper code out of the main module)
- rust-lang/rust#144883 (Remove unneeded `drop_in_place` calls)
- rust-lang/rust#144923 (Move several more float tests to floats/mod.rs)
- rust-lang/rust#144988 (Add annotations to the graphviz region graph on region origins)
- rust-lang/rust#145010 (Couple of minor abi handling cleanups)
- rust-lang/rust#145017 (Explicitly disable vector feature on s390x baseline of bad-reg test)
- rust-lang/rust#145027 (Optimize `char::is_alphanumeric`)
- rust-lang/rust#145050 (add member constraints tests)
- rust-lang/rust#145073 (update enzyme submodule to handle llvm 21)
- rust-lang/rust#145080 (Escape diff strings in MIR dataflow graphviz)
- rust-lang/rust#145082 (Fix some bad formatting in `-Zmacro-stats` output.)
- rust-lang/rust#145083 (Fix cross-compilation of Cargo)
- rust-lang/rust#145096 (Fix wasm target build with atomics feature)
- rust-lang/rust#145097 (remove unnecessary `TypeFoldable` impls)
- rust-lang/rust#145100 (Rank doc aliases lower than equivalently matched items)
- rust-lang/rust#145103 (rustc_metadata: remove unused private trait impls)
- rust-lang/rust#145115 (defer opaque type errors, generally greatly reduce tainting)
- rust-lang/rust#145119 (rustc_public: fix missing parenthesis in pretty discriminant)
- rust-lang/rust#145124 (Recover `for PAT = EXPR {}`)
- rust-lang/rust#145132 (Refactor map_unit_fn lint)
- rust-lang/rust#145134 (Reduce indirect assoc parent queries)
r? `@ghost`
`@rustbot` modify labels: rollup
rust-cloud-vmsBot pushed a commit to makai410/rustc_public that referenced this pull request Aug 20, 2025
Rollup of 23 pull requests
Successful merges:
- rust-lang/rust#141658 (rustdoc search: prefer stable items in search results)
- rust-lang/rust#141828 (Add diagnostic explaining STATUS_STACK_BUFFER_OVERRUN not only being used for stack buffer overruns if link.exe exits with that exit code)
- rust-lang/rust#144823 (coverage: Extract HIR-related helper code out of the main module)
- rust-lang/rust#144883 (Remove unneeded `drop_in_place` calls)
- rust-lang/rust#144923 (Move several more float tests to floats/mod.rs)
- rust-lang/rust#144988 (Add annotations to the graphviz region graph on region origins)
- rust-lang/rust#145010 (Couple of minor abi handling cleanups)
- rust-lang/rust#145017 (Explicitly disable vector feature on s390x baseline of bad-reg test)
- rust-lang/rust#145027 (Optimize `char::is_alphanumeric`)
- rust-lang/rust#145050 (add member constraints tests)
- rust-lang/rust#145073 (update enzyme submodule to handle llvm 21)
- rust-lang/rust#145080 (Escape diff strings in MIR dataflow graphviz)
- rust-lang/rust#145082 (Fix some bad formatting in `-Zmacro-stats` output.)
- rust-lang/rust#145083 (Fix cross-compilation of Cargo)
- rust-lang/rust#145096 (Fix wasm target build with atomics feature)
- rust-lang/rust#145097 (remove unnecessary `TypeFoldable` impls)
- rust-lang/rust#145100 (Rank doc aliases lower than equivalently matched items)
- rust-lang/rust#145103 (rustc_metadata: remove unused private trait impls)
- rust-lang/rust#145115 (defer opaque type errors, generally greatly reduce tainting)
- rust-lang/rust#145119 (rustc_public: fix missing parenthesis in pretty discriminant)
- rust-lang/rust#145124 (Recover `for PAT = EXPR {}`)
- rust-lang/rust#145132 (Refactor map_unit_fn lint)
- rust-lang/rust#145134 (Reduce indirect assoc parent queries)
r? `@ghost`
`@rustbot` modify labels: rollup
makai410 pushed a commit to makai410/rust that referenced this pull request Nov 8, 2025
Rollup of 23 pull requests
Successful merges:
- rust-lang#141658 (rustdoc search: prefer stable items in search results)
- rust-lang#141828 (Add diagnostic explaining STATUS_STACK_BUFFER_OVERRUN not only being used for stack buffer overruns if link.exe exits with that exit code)
- rust-lang#144823 (coverage: Extract HIR-related helper code out of the main module)
- rust-lang#144883 (Remove unneeded `drop_in_place` calls)
- rust-lang#144923 (Move several more float tests to floats/mod.rs)
- rust-lang#144988 (Add annotations to the graphviz region graph on region origins)
- rust-lang#145010 (Couple of minor abi handling cleanups)
- rust-lang#145017 (Explicitly disable vector feature on s390x baseline of bad-reg test)
- rust-lang#145027 (Optimize `char::is_alphanumeric`)
- rust-lang#145050 (add member constraints tests)
- rust-lang#145073 (update enzyme submodule to handle llvm 21)
- rust-lang#145080 (Escape diff strings in MIR dataflow graphviz)
- rust-lang#145082 (Fix some bad formatting in `-Zmacro-stats` output.)
- rust-lang#145083 (Fix cross-compilation of Cargo)
- rust-lang#145096 (Fix wasm target build with atomics feature)
- rust-lang#145097 (remove unnecessary `TypeFoldable` impls)
- rust-lang#145100 (Rank doc aliases lower than equivalently matched items)
- rust-lang#145103 (rustc_metadata: remove unused private trait impls)
- rust-lang#145115 (defer opaque type errors, generally greatly reduce tainting)
- rust-lang#145119 (rustc_public: fix missing parenthesis in pretty discriminant)
- rust-lang#145124 (Recover `for PAT = EXPR {}`)
- rust-lang#145132 (Refactor map_unit_fn lint)
- rust-lang#145134 (Reduce indirect assoc parent queries)
r? `@ghost`
`@rustbot` modify labels: rollup
makai410 pushed a commit to makai410/rust that referenced this pull request Nov 10, 2025
Rollup of 23 pull requests
Successful merges:
- rust-lang#141658 (rustdoc search: prefer stable items in search results)
- rust-lang#141828 (Add diagnostic explaining STATUS_STACK_BUFFER_OVERRUN not only being used for stack buffer overruns if link.exe exits with that exit code)
- rust-lang#144823 (coverage: Extract HIR-related helper code out of the main module)
- rust-lang#144883 (Remove unneeded `drop_in_place` calls)
- rust-lang#144923 (Move several more float tests to floats/mod.rs)
- rust-lang#144988 (Add annotations to the graphviz region graph on region origins)
- rust-lang#145010 (Couple of minor abi handling cleanups)
- rust-lang#145017 (Explicitly disable vector feature on s390x baseline of bad-reg test)
- rust-lang#145027 (Optimize `char::is_alphanumeric`)
- rust-lang#145050 (add member constraints tests)
- rust-lang#145073 (update enzyme submodule to handle llvm 21)
- rust-lang#145080 (Escape diff strings in MIR dataflow graphviz)
- rust-lang#145082 (Fix some bad formatting in `-Zmacro-stats` output.)
- rust-lang#145083 (Fix cross-compilation of Cargo)
- rust-lang#145096 (Fix wasm target build with atomics feature)
- rust-lang#145097 (remove unnecessary `TypeFoldable` impls)
- rust-lang#145100 (Rank doc aliases lower than equivalently matched items)
- rust-lang#145103 (rustc_metadata: remove unused private trait impls)
- rust-lang#145115 (defer opaque type errors, generally greatly reduce tainting)
- rust-lang#145119 (rustc_public: fix missing parenthesis in pretty discriminant)
- rust-lang#145124 (Recover `for PAT = EXPR {}`)
- rust-lang#145132 (Refactor map_unit_fn lint)
- rust-lang#145134 (Reduce indirect assoc parent queries)
r? `@ghost`
`@rustbot` modify labels: rollup
makai410 pushed a commit to makai410/rustc_public that referenced this pull request Nov 16, 2025
Rollup of 23 pull requests
Successful merges:
- rust-lang/rust#141658 (rustdoc search: prefer stable items in search results)
- rust-lang/rust#141828 (Add diagnostic explaining STATUS_STACK_BUFFER_OVERRUN not only being used for stack buffer overruns if link.exe exits with that exit code)
- rust-lang/rust#144823 (coverage: Extract HIR-related helper code out of the main module)
- rust-lang/rust#144883 (Remove unneeded `drop_in_place` calls)
- rust-lang/rust#144923 (Move several more float tests to floats/mod.rs)
- rust-lang/rust#144988 (Add annotations to the graphviz region graph on region origins)
- rust-lang/rust#145010 (Couple of minor abi handling cleanups)
- rust-lang/rust#145017 (Explicitly disable vector feature on s390x baseline of bad-reg test)
- rust-lang/rust#145027 (Optimize `char::is_alphanumeric`)
- rust-lang/rust#145050 (add member constraints tests)
- rust-lang/rust#145073 (update enzyme submodule to handle llvm 21)
- rust-lang/rust#145080 (Escape diff strings in MIR dataflow graphviz)
- rust-lang/rust#145082 (Fix some bad formatting in `-Zmacro-stats` output.)
- rust-lang/rust#145083 (Fix cross-compilation of Cargo)
- rust-lang/rust#145096 (Fix wasm target build with atomics feature)
- rust-lang/rust#145097 (remove unnecessary `TypeFoldable` impls)
- rust-lang/rust#145100 (Rank doc aliases lower than equivalently matched items)
- rust-lang/rust#145103 (rustc_metadata: remove unused private trait impls)
- rust-lang/rust#145115 (defer opaque type errors, generally greatly reduce tainting)
- rust-lang/rust#145119 (rustc_public: fix missing parenthesis in pretty discriminant)
- rust-lang/rust#145124 (Recover `for PAT = EXPR {}`)
- rust-lang/rust#145132 (Refactor map_unit_fn lint)
- rust-lang/rust#145134 (Reduce indirect assoc parent queries)
r? `@ghost`
`@rustbot` modify labels: rollup
makai410 pushed a commit to makai410/rustc_public that referenced this pull request Mar 27, 2026
Rollup of 23 pull requests
Successful merges:
- rust-lang/rust#141658 (rustdoc search: prefer stable items in search results)
- rust-lang/rust#141828 (Add diagnostic explaining STATUS_STACK_BUFFER_OVERRUN not only being used for stack buffer overruns if link.exe exits with that exit code)
- rust-lang/rust#144823 (coverage: Extract HIR-related helper code out of the main module)
- rust-lang/rust#144883 (Remove unneeded `drop_in_place` calls)
- rust-lang/rust#144923 (Move several more float tests to floats/mod.rs)
- rust-lang/rust#144988 (Add annotations to the graphviz region graph on region origins)
- rust-lang/rust#145010 (Couple of minor abi handling cleanups)
- rust-lang/rust#145017 (Explicitly disable vector feature on s390x baseline of bad-reg test)
- rust-lang/rust#145027 (Optimize `char::is_alphanumeric`)
- rust-lang/rust#145050 (add member constraints tests)
- rust-lang/rust#145073 (update enzyme submodule to handle llvm 21)
- rust-lang/rust#145080 (Escape diff strings in MIR dataflow graphviz)
- rust-lang/rust#145082 (Fix some bad formatting in `-Zmacro-stats` output.)
- rust-lang/rust#145083 (Fix cross-compilation of Cargo)
- rust-lang/rust#145096 (Fix wasm target build with atomics feature)
- rust-lang/rust#145097 (remove unnecessary `TypeFoldable` impls)
- rust-lang/rust#145100 (Rank doc aliases lower than equivalently matched items)
- rust-lang/rust#145103 (rustc_metadata: remove unused private trait impls)
- rust-lang/rust#145115 (defer opaque type errors, generally greatly reduce tainting)
- rust-lang/rust#145119 (rustc_public: fix missing parenthesis in pretty discriminant)
- rust-lang/rust#145124 (Recover `for PAT = EXPR {}`)
- rust-lang/rust#145132 (Refactor map_unit_fn lint)
- rust-lang/rust#145134 (Reduce indirect assoc parent queries)
r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nightly cross build started failing 2025-08-06

5 participants

@Kobzol@jieyouxu@bors@bit-aloo@rustbot