How Do I Handle Conflicting Crate Version Requirements

I've got an Actix web-app and, after attempting to add the jsonwebtoken crate, I get this error.

Is it impossible for it to have two incompatible versions of ring-asm installed for the different crates? I'm assuming it is because it is giving me this message.

If it is impossible, am I correct in my understanding the the proper course of action is to upgrade the scram crate to use the 0.16 version of ring?

    Updating crates.io index
error: failed to select a version for `ring`.
    ... required by package `jsonwebtoken v7.0.1`
    ... which is depended on by `myapp v0.1.0 (/code/git/rust/myapp)`
versions that meet the requirements `^0.16.5` are: 0.16.10, 0.16.9, 0.16.7, 0.16.6, 0.16.5

the package `ring` links to the native library `ring-asm`, but it conflicts with a previous package which links to `ring-asm` as well:
package `ring v0.13.5`
    ... which is depended on by `scram v0.4.0`
    ... which is depended on by `reql v0.0.26`
    ... which is depended on by `myapp v0.1.0 (/code/git/rust/myapp)`

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

Yes. This is to prevent linker conflicts over duplicate symbols. More details here.

Yes, this would be the best solution. Or, as an alternate or temporary solution, you could downgrade to jsonwebtoken 5.0.1 which was the last version to use ring 0.13.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.