-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo add
- fix for adding features from repository with multiple packages.
#13213
cargo add
- fix for adding features from repository with multiple packages.
#13213
Conversation
r? @epage (rustbot has picked a reviewer for you, use r? to override) |
tests/testsuite/cargo_add/git_multiple_packages_features/mod.rs
Outdated
Show resolved
Hide resolved
tests/testsuite/cargo_add/git_multiple_packages_features/mod.rs
Outdated
Show resolved
Hide resolved
Thanks for picking this up and moving it along! |
23e60d6
to
760b752
Compare
…date test fix target output
760b752
to
e46d80e
Compare
have made the changes. first commit - add a test that expects failure from said command (test passes) |
Thanks! @bors r+ |
☀️ Test successful - checks-actions |
Update cargo 7 commits in ac6bbb33293d8d424c17ecdb42af3aac25fb7295..ef94adb92704acf3967be8cf73ac0b01d818c47a 2023-12-26 23:22:08 +0000 to 2023-12-31 02:20:45 +0000 - cleanup: Remove error-format special-case in `cargo fix` (rust-lang/cargo#13224) - `cargo fix`: always inherit the jobserver (rust-lang/cargo#13225) - Bump cargo-credential to 0.4.3 (rust-lang/cargo#13221) - `cargo add` - fix for adding features from repository with multiple packages. (rust-lang/cargo#13213) - Remove repetitive words (rust-lang/cargo#13216) - Add cargo:rustc-cdylib-link-arg into RESERVED_PREFIXES list (rust-lang/cargo#13212) - chore(doc): doc for custom subcommands look up. (rust-lang/cargo#13203) r? ghost
Update cargo 11 commits in ac6bbb33293d8d424c17ecdb42af3aac25fb7295..add15366eaf3f3eb84717d3b8b71902ca36a7c84 2023-12-26 23:22:08 +0000 to 2024-01-02 03:24:42 +0000 - chore(deps): update gix (rust-lang/cargo#13230) - chore(deps): update alpine docker tag to v3.19 (rust-lang/cargo#13228) - rustfix: Support inserting new lines. (rust-lang/cargo#13226) - Fix fix::fix_in_dependency to not rely on rustc (rust-lang/cargo#13220) - cleanup: Remove error-format special-case in `cargo fix` (rust-lang/cargo#13224) - `cargo fix`: always inherit the jobserver (rust-lang/cargo#13225) - Bump cargo-credential to 0.4.3 (rust-lang/cargo#13221) - `cargo add` - fix for adding features from repository with multiple packages. (rust-lang/cargo#13213) - Remove repetitive words (rust-lang/cargo#13216) - Add cargo:rustc-cdylib-link-arg into RESERVED_PREFIXES list (rust-lang/cargo#13212) - chore(doc): doc for custom subcommands look up. (rust-lang/cargo#13203)
Fixes #13121
As discussed in the issue, when using
cargo add
to add a package with features from a git repository from one of it's members, the command might fail due to improper target for querying for said features.This PR adds a test for this edge-case where we expect it to fail with current code. It also adds a fix for this, and updates the test to expect success.
While populating available features, the current code does a
Fuzzy
search which might lead to searching for features in a wrong member package. If we change it to anExact
query, we get back the proper member to search within.