cargo add - fix for adding features from repository with multiple packages.#13213
Merged
bors merged 2 commits intorust-lang:masterfrom Dec 29, 2023
Merged
Conversation
Collaborator
|
r? @epage (rustbot has picked a reviewer for you, use r? to override) |
epage
reviewed
Dec 28, 2023
tests/testsuite/cargo_add/git_multiple_packages_features/mod.rs
Outdated
Show resolved
Hide resolved
epage
reviewed
Dec 28, 2023
tests/testsuite/cargo_add/git_multiple_packages_features/mod.rs
Outdated
Show resolved
Hide resolved
epage
reviewed
Dec 28, 2023
Contributor
|
Thanks for picking this up and moving it along! |
23e60d6 to
760b752
Compare
…date test fix target output
760b752 to
e46d80e
Compare
Contributor
Author
|
have made the changes. first commit - add a test that expects failure from said command (test passes) |
Contributor
|
Thanks! @bors r+ |
Contributor
Contributor
Contributor
|
☀️ Test successful - checks-actions |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 1, 2024
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
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 3, 2024
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)
22 tasks
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.
Fixes #13121
As discussed in the issue, when using
cargo addto 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
Fuzzysearch which might lead to searching for features in a wrong member package. If we change it to anExactquery, we get back the proper member to search within.