refactor(cli): Upgrade to clap v4#11159
Merged
bors merged 2 commits intorust-lang:masterfrom Sep 29, 2022
Merged
Conversation
|
r? @weihanglo (rust-highfive has picked a reviewer for you, use r? to override) |
weihanglo
reviewed
Sep 29, 2022
Contributor
Author
epage
added a commit
to epage/clap
that referenced
this pull request
Sep 29, 2022
8649be0 to
69ba69f
Compare
weihanglo
approved these changes
Sep 29, 2022
Member
weihanglo
left a comment
There was a problem hiding this comment.
After reading through the clap v4 changelog, I don't think there is something would break Cargo's argument parsing behavior.
I totally trust and appreciate the great works by clap team and epage. Just not sure about others' stances of Cargo being a pioneer adopting new release of a crate. I am happy to merge it now. If anyone feels uncertain we can always revert it.
Member
|
@bors r+ |
Contributor
Contributor
Contributor
|
☀️ Test successful - checks-actions |
weihanglo
added a commit
to weihanglo/rust
that referenced
this pull request
Oct 4, 2022
8 commits in f5fed93ba24607980647962c59863bbabb03ce14..0b84a35c2c7d70df4875a03eb19084b0e7a543ef 2022-09-27 12:03:57 +0000 to 2022-10-03 19:13:21 +0000 - Provide a better error message when mixing dep: with / (rust-lang/cargo#11172) - Remove lingering unstable flag `-Zfeatures` (rust-lang/cargo#11168) - Tweak wording (rust-lang/cargo#11164) - Expose libgit2-sys/vendored feature as vendored-libgit2 (rust-lang/cargo#11162) - refactor(cli): Upgrade to clap v4 (rust-lang/cargo#11159) - Expose guide to adding a new edition as rustdoc (rust-lang/cargo#11157) - Remove `multitarget` from -Zhelp (rust-lang/cargo#11158) - Remove outdated comments (rust-lang/cargo#11155)
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 5, 2022
Update cargo 8 commits in f5fed93ba24607980647962c59863bbabb03ce14..0b84a35c2c7d70df4875a03eb19084b0e7a543ef 2022-09-27 12:03:57 +0000 to 2022-10-03 19:13:21 +0000 - Provide a better error message when mixing dep: with / (rust-lang/cargo#11172) - Remove lingering unstable flag `-Zfeatures` (rust-lang/cargo#11168) - Tweak wording (rust-lang/cargo#11164) - Expose libgit2-sys/vendored feature as vendored-libgit2 (rust-lang/cargo#11162) - refactor(cli): Upgrade to clap v4 (rust-lang/cargo#11159) - Expose guide to adding a new edition as rustdoc (rust-lang/cargo#11157) - Remove `multitarget` from -Zhelp (rust-lang/cargo#11158) - Remove outdated comments (rust-lang/cargo#11155)
epage
added a commit
to epage/cargo
that referenced
this pull request
Oct 7, 2022
When working on clap v4, it appeared that `last` and `trailing_var_arg` are mutually exclusive, so I called that out in the debug asserts in clap-rs/clap#4187. Unfortunately, I didn't document my research on this as my focus was elsewhere. When updating cargo to use clap v4 in rust-lang#11159, I found `last` and `trailing_var_arg` were used together. I figured this was what I was trying to catch with above and I went off of my intuitive sense of these commands and assumed `trailing_var_arg` was intended, not knowing about the `testname` positional that is mostly just a forward to `libtest`, there for documentation purposes, except for a small optimization. This restores us to behavior from 531ce13 which is what I originally wrote the tests against.
epage
added a commit
to epage/cargo
that referenced
this pull request
Oct 7, 2022
When working on clap v4, it appeared that `last` and `trailing_var_arg` are mutually exclusive, so I called that out in the debug asserts in clap-rs/clap#4187. Unfortunately, I didn't document my research on this as my focus was elsewhere. When updating cargo to use clap v4 in rust-lang#11159, I found `last` and `trailing_var_arg` were used together. I figured this was what I was trying to catch with above and I went off of my intuitive sense of these commands and assumed `trailing_var_arg` was intended, not knowing about the `testname` positional that is mostly just a forward to `libtest`, there for documentation purposes, except for a small optimization. So it looks like we just need the `last` call and not the `trailing_var_arg` call. This restores us to behavior from 531ce13 which is what I originally wrote the tests against.
bors
added a commit
that referenced
this pull request
Oct 7, 2022
fix(test): Distinguish 'testname' from escaped arguments When working on clap v4, it appeared that `last` and `trailing_var_arg` are mutually exclusive, so I called that out in the debug asserts in #4187. Unfortunately, I didn't document my research on this as my focus was elsewhere. When updating cargo to use clap v4 in #11159, I found `last` and `trailing_var_arg` were used together. I figured this was what I was trying to catch with above and I went off of my intuitive sense of these commands and assumed `trailing_var_arg` was intended, not knowing about the `testname` positional that is mostly just a forward to `libtest`, there for documentation purposes, except for a small optimization. So it looks like we just need the `last` call and not the `trailing_var_arg` call. This restores us to behavior from 531ce13 which is what I originally wrote the tests against. It looks like #11159 was merged after the last beta branch was made, so we shouldn't need to cherry-pick this into any other release. For reviewing this, I made the test updates in the first commit, showing the wrong behavior. The following commit fixes the behavior and updates the tests to expected behavior. Fixes #11191
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.

No description provided.