A version of tokio can't be selected?

Hey, everyone! There's something thats' been driving me mad and that's tokio not being able to be resolved to just one version in my project:

error: failed to select a version for `tokio`.
    ... required by package `coap v0.12.0 (https://github.com/Covertness/coap-rs#459a546a)`
    ... which satisfies git dependency `coap` of package `vap-skill-register v0.1.0 (https://github.com/secretsauceai/voice-assistant-protocol/#d39e2f99)`
    ... which satisfies git dependency `vap-skill-register` of package `lily v0.6.0 (/mnt/external_storage/Code/Voice_Assistants/lily)`
versions that meet the requirements `^1.11` are: 1.29.1, 1.29.0, 1.28.2, 1.28.1, 1.28.0, 1.27.0, 1.26.0, 1.25.1, 1.25.0, 1.24.2, 1.24.1, 1.24.0, 1.23.1, 1.23.0, 1.22.0, 1.21.2, 1.21.1, 1.21.0, 1.20.5, 1.20.4, 1.20.3, 1.20.2, 1.20.1, 1.20.0, 1.19.2, 1.19.1, 1.19.0, 1.18.6, 1.18.5, 1.18.4, 1.18.3, 1.18.2, 1.18.1, 1.18.0, 1.17.0, 1.16.1, 1.15.0, 1.14.1, 1.14.0, 1.13.1, 1.13.0, 1.12.0, 1.11.0

all possible versions conflict with previously selected packages.

  previously selected package `tokio v1.28.1`
    ... which satisfies dependency `tokio = "^1.11"` of package `coap v0.12.0 (https://github.com/Covertness/coap-rs#459a546a)`
    ... which satisfies git dependency `coap` of package `vap-skill-register v0.1.0 (https://github.com/secretsauceai/voice-assistant-protocol/#d39e2f99)`
    ... which satisfies git dependency `vap-skill-register` of package `lily v0.6.0 (/mnt/external_storage/Code/Voice_Assistants/lily)`

  previously selected package `coap v0.12.0 (https://github.com/Covertness/coap-rs#459a546a)`
    ... which satisfies git dependency `coap` of package `vap-skill-register v0.1.0 (https://github.com/secretsauceai/voice-assistant-protocol/#d39e2f99)`
    ... which satisfies git dependency `vap-skill-register` of package `lily v0.6.0 (/mnt/external_storage/Code/Voice_Assistants/lily)`

For clarification:

lily/Cargo.toml:

tokio = { version = "^1.20", features = ["macros", "rt", "sync", "time"] }

vap_skill_register/Cargo.toml:

tokio = {version = "^1.15", features = ["macros", "time"] }

coap-rs/Cargo.toml:

tokio =  {version = "^1.20", features = ["full"]}

It would be great if anyone could point on the direction of what's happening.

I can build lily from the master branch without version conflict. Could you try cleaning your project and building it from scratch? cargo clean && cargo build.

Try if removing Cargo.lock helps. Cargo's dependency resolver may accidentally keep a couple of versions locked that need to be changed for all version requirements to be met.

2 Likes

Sorry for the late reply, but tried everything you told me and explored a little bit more.

It does build as long as you dont touch anything, and cargo update seems enough to break everything and show that error.

So far I've tried removing Cargo.lock, target and even the registry of Rust itself (though not all of then athe same time, but shouldnt be necessary).