Repository navigation
test: add more comprehensive workspace feature unification tests - #17466
Merged
Merged
Conversation
Collaborator
|
r? @weihanglo rustbot has assigned @weihanglo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
weihanglo
approved these changes
Sep 11, 2026
| .file("b/src/lib.rs", "") | ||
| .build(); | ||
|
|
||
| p.cargo("check -p common --no-default-features") |
Member
There was a problem hiding this comment.
side note: a bit unsure about whether we want diagnostics for this kind of situation. I believe there will be some confusion when people forget they have set workspace unification, though it is a bit tricky to give good diagnostic for every case. Anyway not a blocker.
rust-bors Bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Sep 12, 2026
Update cargo submodule 6 commits in 3c0b534756e166d12eb9fd2e1abfe5b42ac6101e..7941be6fb416b4cd9666aef7b858dfea25587a8c 2026-09-04 17:03:10 +0000 to 2026-09-11 20:47:37 +0000 - fix(install): use packaged lockfile by default (rust-lang/cargo#17388) - test: add more comprehensive workspace feature unification tests (rust-lang/cargo#17466) - chore(deps): update crossbeam-epoch to 0.9.21 (rust-lang/cargo#17427) - Fixed stale comment about fingerprint checking method (rust-lang/cargo#17450) - docs(lints): how to configure Cargo lints (rust-lang/cargo#17441) - Fix relative symlink handling in write_atomic (rust-lang/cargo#17362) 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?
Followup to the discussion from #14774 (comment).
I added test cases to pin how workspace feature unification interacts with:
default-membersworkspace Cargo.toml--exclude <package>flag--all-featuresflag--no-default-featuresflagAs for the ambiguous interactions mentioned in the comment, I think the following rule of thumb makes sense: since the goal of workspace feature unification is to avoid rebuilding artifacts, any interactions with flags/configs should not cause unnecessary rebuilds regardless of what packages are currently selected. That means for flags like
--all-featuresand--no-default-features, the flag would apply to all members of the workspace despite what the documentation saying that it only applies to the selected packages. So I wrote all the tests with this in mind. Luckily this is already the current behavior of workspace feature unification and didn't require and changes to cargo.How to test and review this PR?
New tests should make sense based on how we expect workspace feature unification to behave.