Skip to content

Commit

Permalink
fix(derive): Couple derive version to clap
Browse files Browse the repository at this point in the history
While `clap` depends on `clap_derive`, `clap_derive` inherently has a
dependency on `clap` because it generates code assuming at least a
specific clap version.  If a new `clap_derive` is used with an old
`clap`, it'll generate code that won't compile.

We've kept things loose because of
- Bad experiences with overly constrained version reqs
- To not force new `clap` versions to release `clap_derive`.
- People should have a lock file anyways

The downsides:
- `cargo install` does not use `Cargo.lock` by default, required
  `--locked`
- If we want people to not skip non-patch releases when upgrading, we
  need it to not be a pain
  • Loading branch information
epage committed Apr 15, 2022
1 parent 297b9cf commit ed57342
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ name = "06_rustup"
path = "benches/06_rustup.rs"

[dependencies]
clap_derive = { path = "./clap_derive", version = "3.1.7", optional = true }
clap_derive = { path = "./clap_derive", version = "=3.1.7", optional = true }
clap_lex = { path = "./clap_lex", version = "0.1.0" }
bitflags = "1.2"
textwrap = { version = "0.15.0", default-features = false, features = [] }
Expand Down

0 comments on commit ed57342

Please sign in to comment.