Fixed Compilation::deps_output only taking the last dep#17164
Merged
Conversation
Collaborator
|
r? @epage rustbot has assigned @epage. Use Why was this reviewer chosen?The reviewer was selected based on:
|
epage
approved these changes
Jul 1, 2026
Contributor
|
Yes, this fixes the root cause of rust-lang/rust#158526 from my side. I tested that locally with: Both passed. The new And rust-lang/rust#158530 would be closed. Thanks for your review! |
rust-bors Bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Jul 2, 2026
Update cargo submodule 13 commits in a335d47ff8036918d3d548dabd513dc0444096a9..f40cc7a13a8ebe3dd0a35b1e0e37a1e26c8bb0e5 2026-06-26 20:39:41 +0000 to 2026-07-01 18:57:21 +0000 - chore(deps): update rust crate gix to 0.85.0 (rust-lang/cargo#17159) - Fixed `Compilation::deps_output` only taking the last dep (rust-lang/cargo#17164) - chore(deps): update taiki-e/install-action action to v2.82.7 (rust-lang/cargo#17163) - chore(deps): update rust crate rusqlite to 0.40.0 (rust-lang/cargo#17162) - chore(deps): update rust crate itertools to 0.15.0 (rust-lang/cargo#17160) - chore(deps): update compatible (rust-lang/cargo#17156) - chore(deps): update crate-ci/typos action to v1.48.0 (rust-lang/cargo#17158) - chore(deps): update alpine docker tag to v3.24 (rust-lang/cargo#17157) - chore(deps): update actions/checkout action to v6.0.3 (rust-lang/cargo#17155) - chore: upgrade to [email protected] (rust-lang/cargo#17152) - test(help): Don't hang on Mac with a custom man pager (rust-lang/cargo#17151) - docs(lints): Add a false-positive example solution (rust-lang/cargo#17147) - docs(lints): Reduce the superfluous whitespace by grouping bullet items (rust-lang/cargo#17146) r? ghost
rust-bors Bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Jul 2, 2026
Update cargo submodule 13 commits in a335d47ff8036918d3d548dabd513dc0444096a9..f40cc7a13a8ebe3dd0a35b1e0e37a1e26c8bb0e5 2026-06-26 20:39:41 +0000 to 2026-07-01 18:57:21 +0000 - chore(deps): update rust crate gix to 0.85.0 (rust-lang/cargo#17159) - Fixed `Compilation::deps_output` only taking the last dep (rust-lang/cargo#17164) - chore(deps): update taiki-e/install-action action to v2.82.7 (rust-lang/cargo#17163) - chore(deps): update rust crate rusqlite to 0.40.0 (rust-lang/cargo#17162) - chore(deps): update rust crate itertools to 0.15.0 (rust-lang/cargo#17160) - chore(deps): update compatible (rust-lang/cargo#17156) - chore(deps): update crate-ci/typos action to v1.48.0 (rust-lang/cargo#17158) - chore(deps): update alpine docker tag to v3.24 (rust-lang/cargo#17157) - chore(deps): update actions/checkout action to v6.0.3 (rust-lang/cargo#17155) - chore: upgrade to [email protected] (rust-lang/cargo#17152) - test(help): Don't hang on Mac with a custom man pager (rust-lang/cargo#17151) - docs(lints): Add a false-positive example solution (rust-lang/cargo#17147) - docs(lints): Reduce the superfluous whitespace by grouping bullet items (rust-lang/cargo#17146) r? ghost
rust-bors Bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Jul 3, 2026
Update cargo submodule 13 commits in a335d47ff8036918d3d548dabd513dc0444096a9..f40cc7a13a8ebe3dd0a35b1e0e37a1e26c8bb0e5 2026-06-26 20:39:41 +0000 to 2026-07-01 18:57:21 +0000 - chore(deps): update rust crate gix to 0.85.0 (rust-lang/cargo#17159) - Fixed `Compilation::deps_output` only taking the last dep (rust-lang/cargo#17164) - chore(deps): update taiki-e/install-action action to v2.82.7 (rust-lang/cargo#17163) - chore(deps): update rust crate rusqlite to 0.40.0 (rust-lang/cargo#17162) - chore(deps): update rust crate itertools to 0.15.0 (rust-lang/cargo#17160) - chore(deps): update compatible (rust-lang/cargo#17156) - chore(deps): update crate-ci/typos action to v1.48.0 (rust-lang/cargo#17158) - chore(deps): update alpine docker tag to v3.24 (rust-lang/cargo#17157) - chore(deps): update actions/checkout action to v6.0.3 (rust-lang/cargo#17155) - chore: upgrade to [email protected] (rust-lang/cargo#17152) - test(help): Don't hang on Mac with a custom man pager (rust-lang/cargo#17151) - docs(lints): Add a false-positive example solution (rust-lang/cargo#17147) - docs(lints): Reduce the superfluous whitespace by grouping bullet items (rust-lang/cargo#17146) r? ghost
rust-bors Bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Jul 3, 2026
Update cargo submodule 13 commits in a335d47ff8036918d3d548dabd513dc0444096a9..f40cc7a13a8ebe3dd0a35b1e0e37a1e26c8bb0e5 2026-06-26 20:39:41 +0000 to 2026-07-01 18:57:21 +0000 - chore(deps): update rust crate gix to 0.85.0 (rust-lang/cargo#17159) - Fixed `Compilation::deps_output` only taking the last dep (rust-lang/cargo#17164) - chore(deps): update taiki-e/install-action action to v2.82.7 (rust-lang/cargo#17163) - chore(deps): update rust crate rusqlite to 0.40.0 (rust-lang/cargo#17162) - chore(deps): update rust crate itertools to 0.15.0 (rust-lang/cargo#17160) - chore(deps): update compatible (rust-lang/cargo#17156) - chore(deps): update crate-ci/typos action to v1.48.0 (rust-lang/cargo#17158) - chore(deps): update alpine docker tag to v3.24 (rust-lang/cargo#17157) - chore(deps): update actions/checkout action to v6.0.3 (rust-lang/cargo#17155) - chore: upgrade to [email protected] (rust-lang/cargo#17152) - test(help): Don't hang on Mac with a custom man pager (rust-lang/cargo#17151) - docs(lints): Add a false-positive example solution (rust-lang/cargo#17147) - docs(lints): Reduce the superfluous whitespace by grouping bullet items (rust-lang/cargo#17146) r? ghost
rust-bors Bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Jul 5, 2026
Update cargo submodule 13 commits in a335d47ff8036918d3d548dabd513dc0444096a9..f40cc7a13a8ebe3dd0a35b1e0e37a1e26c8bb0e5 2026-06-26 20:39:41 +0000 to 2026-07-01 18:57:21 +0000 - chore(deps): update rust crate gix to 0.85.0 (rust-lang/cargo#17159) - Fixed `Compilation::deps_output` only taking the last dep (rust-lang/cargo#17164) - chore(deps): update taiki-e/install-action action to v2.82.7 (rust-lang/cargo#17163) - chore(deps): update rust crate rusqlite to 0.40.0 (rust-lang/cargo#17162) - chore(deps): update rust crate itertools to 0.15.0 (rust-lang/cargo#17160) - chore(deps): update compatible (rust-lang/cargo#17156) - chore(deps): update crate-ci/typos action to v1.48.0 (rust-lang/cargo#17158) - chore(deps): update alpine docker tag to v3.24 (rust-lang/cargo#17157) - chore(deps): update actions/checkout action to v6.0.3 (rust-lang/cargo#17155) - chore: upgrade to [email protected] (rust-lang/cargo#17152) - test(help): Don't hang on Mac with a custom man pager (rust-lang/cargo#17151) - docs(lints): Add a false-positive example solution (rust-lang/cargo#17147) - docs(lints): Reduce the superfluous whitespace by grouping bullet items (rust-lang/cargo#17146) r? ghost
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?
This PR fixes a bug in the compilation logic that causes the
compilation.dep_outputbeing overwritten instead of appending the directories. (HashMap::insertcalled in a loop, causing only the last element to be added)This is normally not reachable for most uses as dylibs are uplifted, so the uplifted dylibs usually land on the search path masking the bug. I believe its only a problem when
__CARGO_DEFAULT_LIB_METADATA=1is set as the metadata hash causing the bin or test to fail to find the dylib if there are more than one.Reported in rust-lang/rust#158526
I guess this will further put pressure on the Windows
PATH, it seems necessary for correctness. :-(How to test and review this PR?
The change is fairly straight forward, just make the hashmap value a set so it could hold multiple paths.
I added a regression test that verifies
cargo testruns for a crate with multiple dylibs.cc: @yuzibo @HNO3Miracle (would appreciate if you would be able check if this change fixes your issue reported in rust-lang/rust#158526)