rust-ammonia / ammonia

Repair and secure untrusted HTML
Apache License 2.0
524 stars 43 forks source link

Consider upgrading dependency once_cell #168

Closed jblachly closed 2 years ago

jblachly commented 2 years ago

once_cell (https://github.com/matklad/once_cell) is locked to version 1.10.

clap (https://github.com/clap-rs/clap) a popular command line parser, requires ^1.12.0 of once_cell.

notriddle commented 2 years ago

Is this resulting in your project pulling in both crates? It shouldn't. Those two are semver-compatible.

jblachly commented 2 years ago

It is a transitive dependency problem (but solved, see below)

(base) james@jsbmbp16 wodehouse % cargo build
error: failed to select a version for `once_cell`.
    ... required by package `clap v3.2.20`
    ... which satisfies dependency `clap = "^3.2.20"` (locked to 3.2.20) of package `wodehouse v0.1.0 (/Users/james/src/wodehouse)`
versions that meet the requirements `^1.12.0` are: 1.14.0, 1.13.1, 1.13.0, 1.12.1, 1.12.0

all possible versions conflict with previously selected packages.

  previously selected package `once_cell v1.10.0`
    ... which satisfies dependency `once_cell = "^1.10"` (locked to 1.10.0) of package `ammonia v3.2.0`
    ... which satisfies dependency `ammonia = "^3.2.0"` (locked to 3.2.0) of package `wodehouse v0.1.0 (/Users/james/src/wodehouse)`

failed to select a version for `once_cell` which could resolve this conflict

but thanks to your comment I realized ammonia was requiring "1.10.0", not "=1.10.0". Solved with cargo update -p ammonia (can't do pan cargo upgrade due to some other prerelease crates that will break)