jonhoo / msql-srv

Bindings for writing a server that can act as MySQL/MariaDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error: failed to select a version for `time`

iporollo opened this issue · comments

When adding the msql-srv dependency to my project, I get this error

error: failed to select a version for `time`.
    ... required by package `cookie v0.14.1`
    ... which is depended on by `actix-http v2.0.0`
    ... which is depended on by `actix-web v3.0.0`
    ... which is depended on by `qz-server v0.1.0`
versions that meet the requirements `^0.2.11` are: 0.2.24, 0.2.25, 0.2.23, 0.2.22, 0.2.21, 0.2.20, 0.2.19, 0.2.18, 0.2.17, 0.2.16, 0.2.15, 0.2.14, 0.2.13, 0.2.12, 0.2.11

all possible versions conflict with previously selected packages.

  previously selected package `time v0.2.7`
    ... which is depended on by `msql-srv v0.9.2`
    ... which is depended on by `qz-drivers v0.1.0`
    ... which is depended on by `qz-server v0.1.0`

Wondering if anyone else is seeing this?

Ah, this was due to a bug a while back that made the time crate impossible to compile with certain other dependencies. You could take a stab at removing the = from

time = "=0.2.7"

And see if that compiles now? Really we should just update to tokio 1.0, but that is a big change.

So it looks like that cookie v0.14.1 dependency requires a version of time that's one of 0.2.24, 0.2.25, 0.2.23, 0.2.22, 0.2.21, 0.2.20, 0.2.19, 0.2.18, 0.2.17, 0.2.16, 0.2.15, 0.2.14, 0.2.13, 0.2.12, 0.2.11. Seems like the 0.2.7 that msql-srv uses is not part of the allowed versions, hence this error appears.

I forked the repository, changed the time to be time = "0.2.25", and set the fork as the origin of the package using

[patch.crates-io]
msql-srv = { git = '<my-fork>' }

With that change,msql-srv seems to compile just fine, and removes the error in my original project.

Should I spin up a small PR for this repository as well to update that time version?

I think all you should need to do is remove the leading = in the specified, and things should work. But yes please to a PR!

I tried removing just the leading = but it was unfortunately still erroring, which is why I bumped the version up...
And will do 👍

Huh, interesting. Okay, sounds good 👍