Cargo dependencies override conflict question

Hi there,

Let's say I have a project that uses tokio 0.2.2 (directly or inderectly) and ldap3.

ldap3 is using a lot of depecrated tokio_* stuff and moreover, has a bug: https://github.com/inejge/ldap3/issues/38

the workaround being doing:

[dependencies]
tokio = "=0.1.11"

Which clashes with my dep to tokio 0.2.2, doesn't it?

Is there a way to get out of this easily?

If you depend on Tokio 0.2, and a crate depends on =0.1.11, then cargo should include Tokio twice in the binary. Note that 0.2.2 is not the newest version of Tokio.

Thank you for your answer!

I'm sorry I wasn't precise enough: ldap3 doesn't explicitely depends on version 0.1.11, but a workaround for a bug it to force it to use 0.1.11 of the 0.1.x series.

Thanks for the highlight on 0.2.2 not being the latest :slight_smile:

You can try adding Tokio as a dependency twice. I think it looks like this:

[dependencies]
tokio = "0.2"
tokio01 = { version = "=0.1.11", package = "tokio" }
1 Like

Thanks, I'll try this!

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