Repository navigation
fix: return correct package specs when resolving workspace deps - #17469
Conversation
Keeping the project source code contents empty makes it clearer that we're only testing the behavior of `cargo tree`. Also, use the `--format` flag to display features as `-e features` is unaffected by the different feature unification modes.
|
r? @weihanglo rustbot has assigned @weihanglo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| pkg_set.warn_no_lib_packages_and_artifact_libs_overlapping_deps( | ||
| ws, | ||
| &resolved_with_overrides, | ||
| &member_ids, | ||
| has_dev_units, | ||
| requested_targets, | ||
| target_data, | ||
| force_all_targets, | ||
| )?; | ||
|
|
There was a problem hiding this comment.
Maybe the move of warn_no_lib_packages_and_artifact_libs_overlapping_deps can be split into its own fix commit I guess. It indeed fixes a duplicate warning issue. I don't think it worth a test though.
There was a problem hiding this comment.
I couldn't figure out a good way to split this out into a separate commit so I'm just keeping it as is.
There was a problem hiding this comment.
Mind me splitting it and push directly to your branch? You can re-commit and rewrite afterward if you like or don't like.
There was a problem hiding this comment.
I did that. Let me know if you are find merging as-is or you want to do any cleanup.
There was a problem hiding this comment.
Oh why didn't I think of that 🤦♂️. Yeah LGTM, thanks!
8adf998 to
92acf45
Compare
| pkg_set.warn_no_lib_packages_and_artifact_libs_overlapping_deps( | ||
| ws, | ||
| &resolved_with_overrides, | ||
| &member_ids, | ||
| has_dev_units, | ||
| requested_targets, | ||
| target_data, | ||
| force_all_targets, | ||
| )?; | ||
|
|
There was a problem hiding this comment.
Mind me splitting it and push directly to your branch? You can re-commit and rewrite afterward if you like or don't like.
| ├── common feature "a" | ||
| │ └── common v0.1.0 ([ROOT]/foo/common) | ||
| ├── common feature "default" (command-line) | ||
| ├── common feature "default" |
There was a problem hiding this comment.
Just want to call out this UI change. I am not even sure if this is a fix or a regression. Not a blocker though.
There was a problem hiding this comment.
I think technically this is a fix since it restores the old behavior.
92acf45 to
d3a1adb
Compare
| pkg_set.warn_no_lib_packages_and_artifact_libs_overlapping_deps( | ||
| ws, | ||
| &resolved_with_overrides, | ||
| &member_ids, | ||
| has_dev_units, | ||
| requested_targets, | ||
| target_data, | ||
| force_all_targets, | ||
| )?; | ||
|
|
There was a problem hiding this comment.
I did that. Let me know if you are find merging as-is or you want to do any cleanup.
Update cargo submodule 9 commits in 7941be6fb416b4cd9666aef7b858dfea25587a8c..495c385d0875c4ba51eb72ea0448a2d4c018b8d4 2026-09-11 20:47:37 +0000 to 2026-09-16 12:48:58 +0000 - Report the number of errors with `build.warnings='deny'` (rust-lang/cargo#17479) - fix: return correct package specs when resolving workspace deps (rust-lang/cargo#17469) - refactor(config): Consolidate more config table definitions (rust-lang/cargo#17480) - fix(git): For git cli, tell users what config we aren't forwarding on error (rust-lang/cargo#17477) - Lower the lint level of `manual_readme` and `non_kebab_case_bins` to `allow` (rust-lang/cargo#17478) - fix(trim-paths)!: unremap file in one JSON doc (rust-lang/cargo#17476) - feat(manifest): support `feature-documentation` in manifests (rust-lang/cargo#17447) - chore: Add Muscraft to the review rotation (rust-lang/cargo#17471) - Specify `--edition` in `messages` tests (rust-lang/cargo#17470) r? Urgau for the debugger script part --- 🤖 LLM disclosure: I probably should have tested this change manually, though I let LLM verify it working, sorry. Will do a manual test when I have time or if somebody beats me on that.
Update cargo submodule 9 commits in 7941be6fb416b4cd9666aef7b858dfea25587a8c..495c385d0875c4ba51eb72ea0448a2d4c018b8d4 2026-09-11 20:47:37 +0000 to 2026-09-16 12:48:58 +0000 - Report the number of errors with `build.warnings='deny'` (rust-lang/cargo#17479) - fix: return correct package specs when resolving workspace deps (rust-lang/cargo#17469) - refactor(config): Consolidate more config table definitions (rust-lang/cargo#17480) - fix(git): For git cli, tell users what config we aren't forwarding on error (rust-lang/cargo#17477) - Lower the lint level of `manual_readme` and `non_kebab_case_bins` to `allow` (rust-lang/cargo#17478) - fix(trim-paths)!: unremap file in one JSON doc (rust-lang/cargo#17476) - feat(manifest): support `feature-documentation` in manifests (rust-lang/cargo#17447) - chore: Add Muscraft to the review rotation (rust-lang/cargo#17471) - Specify `--edition` in `messages` tests (rust-lang/cargo#17470) r? Urgau for the debugger script part --- 🤖 LLM disclosure: I probably should have tested this change manually, though I let LLM verify it working, sorry. Will do a manual test when I have time or if somebody beats me on that.
Update cargo submodule 9 commits in 7941be6fb416b4cd9666aef7b858dfea25587a8c..495c385d0875c4ba51eb72ea0448a2d4c018b8d4 2026-09-11 20:47:37 +0000 to 2026-09-16 12:48:58 +0000 - Report the number of errors with `build.warnings='deny'` (rust-lang/cargo#17479) - fix: return correct package specs when resolving workspace deps (rust-lang/cargo#17469) - refactor(config): Consolidate more config table definitions (rust-lang/cargo#17480) - fix(git): For git cli, tell users what config we aren't forwarding on error (rust-lang/cargo#17477) - Lower the lint level of `manual_readme` and `non_kebab_case_bins` to `allow` (rust-lang/cargo#17478) - fix(trim-paths)!: unremap file in one JSON doc (rust-lang/cargo#17476) - feat(manifest): support `feature-documentation` in manifests (rust-lang/cargo#17447) - chore: Add Muscraft to the review rotation (rust-lang/cargo#17471) - Specify `--edition` in `messages` tests (rust-lang/cargo#17470) r? Urgau for the debugger script part --- 🤖 LLM disclosure: I probably should have tested this change manually, though I let LLM verify it working, sorry. Will do a manual test when I have time or if somebody beats me on that.
What does this PR try to resolve?
Fixes a bug introduced by #15684 where the incorrect list of package specs was being returned from
resolve_ws_with_optsdepending on the feature unification mode. This resulted in things likecargo treeproducing the wrong output under workspace feature unification mode. #16584 attempted to address this but it didn't fix the root cause of the issue.I also cleaned up some of the logic in
resolve_ws_with_optsso it's less confusing.Fixes #16583.
How to test and review this PR?
Verify that the changes to
resolve_ws_with_optslook correct. Feature unification tests should pass for each individual commit.