-
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
Update clap requirement from 2.34.0 to 3.0.4 #10259
Conversation
Updates the requirements on [clap](https://github.com/clap-rs/clap) to permit the latest version. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](clap-rs/clap@clap_generate-v3.0.0-rc.0...v3.0.4) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]>
r? @ehuss (rust-highfive has picked a reviewer for you, use r? to override) |
I'm going to close this because I don't think that we want a new PR for each patch release. |
OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting If you change your mind, just re-open this PR and I'll resolve any conflicts on it. |
Port cargo to clap3 ### What does this PR try to resolve? This moves cargo to the latest major version of clap. This supersedes #10259 and #10262 ### How should we test and review this PR? For testing, I mostly relied on existing tests. I did manually validate that `cargo run <non-escaped command args>` behaved the same between both ```console $ cargo run release --help Finished dev [unoptimized + debuginfo] target(s) in 0.22s Running `target/debug/cargo-release release --help` cargo-release 0.18.8 ... $ cargo run --manifest-path ../cargo/Cargo.toml -- run release --help Finished dev [unoptimized + debuginfo] target(s) in 0.05s Running `/home/epage/src/personal/cargo/target/debug/cargo run release --help` Finished dev [unoptimized + debuginfo] target(s) in 1.31s Running `target/debug/cargo-release release --help` cargo-release 0.18.8 ... ``` For reviewing, I split out each deprecation resolution into a separate commit so its easy to focus on more mechanical changes (most of the deprecation fixes) from interesting ones (the port, the `Arg::multiple` deprecation) ### Additional information - One parser change found by `cargo_config::includes` is that clap 2 would ignore any values after a `=` for flags. `cargo config --show-origin` is a flag but the test passed `--show-origin=yes` which happens to give the desired result for that test but is the same as `--show-origin=no` or `--show-origin=alien-invasion`. - `ArgMatches` now panics when accessing an undefined argument but clap takes advantage of that for sharing code across commands that have different subsets of arguments defined. I've extended clap so we can "look before you leap" and put the checks at the argument calls to start off with so its very clear what is tenuously shared. This allows us to go in either direction in the future, either addressing how we are sharing between commands or by moving this down into the extension methods and pretending this clap feature doesn't exist - On that topic, a test found clap-rs/clap#3263. For now, there is a hack in clap. Depending on how we fix that in clap for clap 4.0, we might need to re-address things in cargo. - `value_of_os` now requires setting `allow_invalid_utf8`, otherwise it asserts. To help catch this, I updated the argument definitions associated with lookups reported by: - `rg 'values?_os' src/` - `rg 'values?_of_os' src/` - clap now reports `2` for usage errors, so we had to bypass clap's `exit` call to keep the same exit code. - `cargo vendor --sync` did not use `multi_opt` and so it has both multiple occurrences **and** multiple values. If we want to deprecate this, we'll need `unstable-grouped` to be stablized (or pin our clap version) and ensure each group has only 1 value.
Updates the requirements on clap to permit the latest version.
Release notes
Sourced from clap's releases.
Changelog
Sourced from clap's changelog.
... (truncated)
Commits
4ea1965
chore: Releasec92b916
docs: Update changelog0a7e751
Merge pull request #3255 from epage/reflect7e4cd43
feat(parser): Allow users to avoid undefined arg asserts9daefba
chore: Release6522eb1
docs: Update changelog9e7ee85
Merge pull request #3253 from epage/assert91de3eb
fix: Clarify cause of debug assertsd9906eb
chore: Release8830afb
docs: Update changeogDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)