Skip to content

fix(host-config): fix panic when cross-compiling with host-config#16674

Merged
epage merged 3 commits intorust-lang:masterfrom
arlosi:fix-host-config
Feb 24, 2026
Merged

fix(host-config): fix panic when cross-compiling with host-config#16674
epage merged 3 commits intorust-lang:masterfrom
arlosi:fix-host-config

Conversation

@arlosi
Copy link
Contributor

@arlosi arlosi commented Feb 24, 2026

What does this PR try to resolve?

When cross compiling (with --target), cargo panics with -Zhost-config.

This changes the explicit addition of the host target to only occur if the requested_kinds includes the host.

Otherwise, looking up the target_runner for the explicit_host_kind attempts to look up an entry in the target_config map that does not exist.

How to test and review this PR?

Validate that new test passes and does not panic.

Fixes #16664

@rustbot rustbot added A-build-execution Area: anything dealing with executing the compiler S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 24, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 24, 2026

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, epage, weihanglo
@arlosi
Copy link
Contributor Author

arlosi commented Feb 24, 2026

Note that I'm not very familiar with this area of cargo, and there have been a chain of regressions and fixes here.

@epage epage enabled auto-merge February 24, 2026 21:16
Based on the comment of the test case, it appears that this should have been added
When cross compiling (with `--target`), cargo panics with -Zhost-config. This changes the explicit addition of the host target to only occur if the `requested_kinds` includes the host. Otherwise looking up the target_runner for the explicit_host_kind attempts to look up an entry in the target_config map that does not exist.
@rustbot
Copy link
Collaborator

rustbot commented Feb 24, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@epage epage disabled auto-merge February 24, 2026 21:51
@epage epage enabled auto-merge February 24, 2026 21:51
@epage epage added this pull request to the merge queue Feb 24, 2026
@weihanglo
Copy link
Member

While this is nightly feature fix, it would be great if we can do a cargo submodule bump before beta branches off.

I am not available to do that this week though

Merged via the queue into rust-lang:master with commit f298b8c Feb 24, 2026
29 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 24, 2026
arlosi added a commit to arlosi/rust that referenced this pull request Feb 25, 2026
8 commits in 8cc0cb136772b8f54eafe0d163fcb7226a06af0c..f298b8c82da0cba538516b45b04a480fc501d4c0 2026-02-17 12:16:26 +0000 to 2026-02-24 21:59:20 +0000 - fix(host-config): fix panic when cross-compiling with host-config (rust-lang/cargo#16674) - doc: improve documentation on using cfg values with build scripts (rust-lang/cargo#16671) - Fix typo in cargo-yank docs (rust-lang/cargo#16656) - fix(job_queue): Handle Clippy CLI arguments in `fix` message (rust-lang/cargo#16652) - Add a test for fingerprint checking when a symlink target changes (rust-lang/cargo#16661) - Fix parallel locking when `-Zfine-grain-locking` is enabled (rust-lang/cargo#16659) - fix(cli): Remove `--lockfile-path` (rust-lang/cargo#16621) - test(build-std): Update error message (rust-lang/cargo#16658)
rust-bors bot pushed a commit to rust-lang/rust that referenced this pull request Feb 26, 2026
Update cargo submodule 8 commits in 8cc0cb136772b8f54eafe0d163fcb7226a06af0c..f298b8c82da0cba538516b45b04a480fc501d4c0 2026-02-17 12:16:26 +0000 to 2026-02-24 21:59:20 +0000 - fix(host-config): fix panic when cross-compiling with host-config (rust-lang/cargo#16674) - doc: improve documentation on using cfg values with build scripts (rust-lang/cargo#16671) - Fix typo in cargo-yank docs (rust-lang/cargo#16656) - fix(job_queue): Handle Clippy CLI arguments in `fix` message (rust-lang/cargo#16652) - Add a test for fingerprint checking when a symlink target changes (rust-lang/cargo#16661) - Fix parallel locking when `-Zfine-grain-locking` is enabled (rust-lang/cargo#16659) - fix(cli): Remove `--lockfile-path` (rust-lang/cargo#16621) - test(build-std): Update error message (rust-lang/cargo#16658)
@rustbot rustbot added this to the 1.95.0 milestone Feb 26, 2026
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Feb 26, 2026
Update cargo submodule 8 commits in 8cc0cb136772b8f54eafe0d163fcb7226a06af0c..f298b8c82da0cba538516b45b04a480fc501d4c0 2026-02-17 12:16:26 +0000 to 2026-02-24 21:59:20 +0000 - fix(host-config): fix panic when cross-compiling with host-config (rust-lang/cargo#16674) - doc: improve documentation on using cfg values with build scripts (rust-lang/cargo#16671) - Fix typo in cargo-yank docs (rust-lang/cargo#16656) - fix(job_queue): Handle Clippy CLI arguments in `fix` message (rust-lang/cargo#16652) - Add a test for fingerprint checking when a symlink target changes (rust-lang/cargo#16661) - Fix parallel locking when `-Zfine-grain-locking` is enabled (rust-lang/cargo#16659) - fix(cli): Remove `--lockfile-path` (rust-lang/cargo#16621) - test(build-std): Update error message (rust-lang/cargo#16658)
github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Mar 2, 2026
Update cargo submodule 8 commits in 8cc0cb136772b8f54eafe0d163fcb7226a06af0c..f298b8c82da0cba538516b45b04a480fc501d4c0 2026-02-17 12:16:26 +0000 to 2026-02-24 21:59:20 +0000 - fix(host-config): fix panic when cross-compiling with host-config (rust-lang/cargo#16674) - doc: improve documentation on using cfg values with build scripts (rust-lang/cargo#16671) - Fix typo in cargo-yank docs (rust-lang/cargo#16656) - fix(job_queue): Handle Clippy CLI arguments in `fix` message (rust-lang/cargo#16652) - Add a test for fingerprint checking when a symlink target changes (rust-lang/cargo#16661) - Fix parallel locking when `-Zfine-grain-locking` is enabled (rust-lang/cargo#16659) - fix(cli): Remove `--lockfile-path` (rust-lang/cargo#16621) - test(build-std): Update error message (rust-lang/cargo#16658)
makai410 pushed a commit to makai410/rustc_public that referenced this pull request Mar 19, 2026
Update cargo submodule 8 commits in 8cc0cb136772b8f54eafe0d163fcb7226a06af0c..f298b8c82da0cba538516b45b04a480fc501d4c0 2026-02-17 12:16:26 +0000 to 2026-02-24 21:59:20 +0000 - fix(host-config): fix panic when cross-compiling with host-config (rust-lang/cargo#16674) - doc: improve documentation on using cfg values with build scripts (rust-lang/cargo#16671) - Fix typo in cargo-yank docs (rust-lang/cargo#16656) - fix(job_queue): Handle Clippy CLI arguments in `fix` message (rust-lang/cargo#16652) - Add a test for fingerprint checking when a symlink target changes (rust-lang/cargo#16661) - Fix parallel locking when `-Zfine-grain-locking` is enabled (rust-lang/cargo#16659) - fix(cli): Remove `--lockfile-path` (rust-lang/cargo#16621) - test(build-std): Update error message (rust-lang/cargo#16658)
makai410 pushed a commit to makai410/rustc_public that referenced this pull request Mar 19, 2026
Update cargo submodule 8 commits in 8cc0cb136772b8f54eafe0d163fcb7226a06af0c..f298b8c82da0cba538516b45b04a480fc501d4c0 2026-02-17 12:16:26 +0000 to 2026-02-24 21:59:20 +0000 - fix(host-config): fix panic when cross-compiling with host-config (rust-lang/cargo#16674) - doc: improve documentation on using cfg values with build scripts (rust-lang/cargo#16671) - Fix typo in cargo-yank docs (rust-lang/cargo#16656) - fix(job_queue): Handle Clippy CLI arguments in `fix` message (rust-lang/cargo#16652) - Add a test for fingerprint checking when a symlink target changes (rust-lang/cargo#16661) - Fix parallel locking when `-Zfine-grain-locking` is enabled (rust-lang/cargo#16659) - fix(cli): Remove `--lockfile-path` (rust-lang/cargo#16621) - test(build-std): Update error message (rust-lang/cargo#16658)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-build-execution Area: anything dealing with executing the compiler

4 participants