TeXitoi / structopt

Parse command line arguments by defining a struct.
Other
2.7k stars 149 forks source link

Failed to select a version for `clap` #530

Closed crazyboycjr closed 1 year ago

crazyboycjr commented 1 year ago

I'm aware that structopt is currently in maintainence mode. I still want to report this issue caused by a change in the upstream.

To reproduce:

$ cargo new project
$ cd project
$ cargo add structopt -F lints
    Updating crates.io index
      Adding structopt v0.3.26 to dependencies.
             Features:
             + lints
             - color
             - debug
             - doc
             - no_cargo
             - paw
             - paw_dep
             - suggestions
             - wrap_help
             - yaml
error: failed to select a version for `clap`.
    ... required by package `structopt v0.3.26`
    ... which satisfies dependency `structopt = "^0.3.26"` (locked to 0.3.26) of package `tesstructopt v0.1.0 (/tmp/tesstructopt)`
versions that meet the requirements `^2.33` (locked to 2.34.0) are: 2.34.0

the package `structopt` depends on `clap`, with features: `lints` but `clap` does not have these features.

failed to select a version for `clap` which could resolve this conflict
cargo add structopt -F lints  9.99s user 2.53s system 97% cpu 12.790 total
$ cargo -vV
cargo 1.65.0 (4bc8f24d3 2022-10-20)
release: 1.65.0
commit-hash: 4bc8f24d3e899462e43621aab981f6383a370365
commit-date: 2022-10-20
host: x86_64-unknown-linux-gnu
libgit2: 1.5.0 (sys:0.15.0 vendored)
libcurl: 7.83.1-DEV (sys:0.4.55+curl-7.83.1 vendored ssl:OpenSSL/1.1.1q)
os: Arch Linux Rolling Release [64-bit]
epage commented 1 year ago

lints was removed from clap in https://github.com/clap-rs/clap/commit/2bb9180288d21d1f281e22d156ddcc37dfe90aae

Its unclear why that was considered safe to do in the 2 series. I assume it was intended only for local development of clap and wasn't intended for anyone else to use.

You can either remove lints or specify an older clap version like cargo update -p clap --precise 2.33.3

crazyboycjr commented 1 year ago

Thanks! Migrating to clap is really easy.