fix(host-config): fix panic when cross-compiling with host-config#16674
Merged
epage merged 3 commits intorust-lang:masterfrom Feb 24, 2026
Merged
fix(host-config): fix panic when cross-compiling with host-config#16674epage merged 3 commits intorust-lang:masterfrom
epage merged 3 commits intorust-lang:masterfrom
Conversation
Collaborator
| r? @weihanglo rustbot has assigned @weihanglo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
epage reviewed Feb 24, 2026
Contributor Author
| Note that I'm not very familiar with this area of cargo, and there have been a chain of regressions and fixes here. |
epage reviewed Feb 24, 2026
ad2ba4d to 2bbf46c Compare epage approved these changes Feb 24, 2026
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.
2bbf46c to 92ffa00 Compare Collaborator
| 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. |
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 |
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)
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_kindsincludes 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