-
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
refactor(cli): Upgrade to clap v4 #11159
Conversation
r? @weihanglo (rust-highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8649be0
to
69ba69f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@bors r+ |
☀️ Test successful - checks-actions |
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)
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)
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.
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.
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
No description provided.