PrivateRookie / ws-tool

High perform & easy to use websocket client/server
Apache License 2.0
193 stars 23 forks source link

tokio version conflict #3

Closed raphaelsoul closed 3 years ago

raphaelsoul commented 3 years ago
Execution failed (exit code 101).
/Users/raphaelsoul/.cargo/bin/cargo metadata --verbose --format-version 1 --all-features
stdout :     Updating `https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index` index
error: failed to select a version for `tokio`.
    ... required by package `async-http-proxy v1.0.0`
    ... which is depended on by `ws-tool v0.2.0`
    ... which is depended on by `synchronizer v0.1.0 (/Users/raphaelsoul/projects/github.com/raphaelsoul/prophet/synchronizer)`
    ... which is depended on by `cmd v0.1.0 (/Users/raphaelsoul/projects/github.com/raphaelsoul/prophet/cmd)`
versions that meet the requirements `~1.0.2` are: 1.0.3, 1.0.2

all possible versions conflict with previously selected packages.

  previously selected package `tokio v1.8.1`
    ... which is depended on by `synchronizer v0.1.0 (/Users/raphaelsoul/projects/github.com/raphaelsoul/prophet/synchronizer)`
    ... which is depended on by `cmd v0.1.0 (/Users/raphaelsoul/projects/github.com/raphaelsoul/prophet/cmd)`

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

stderr : 
PrivateRookie commented 3 years ago

please paste your project Cargo.toml file content

raphaelsoul commented 3 years ago
[package]
name = "reproduce"
version = "0.1.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tokio = { version = "1.8.1", features = ["full"] }
ws-tool = "*"

this fails with output above

[package]
name = "reproduce"
version = "0.1.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tokio = { version = "*", features = ["full"] }
ws-tool = "*"

this works, and installed tokio version is 1.6.3

// cargo.lock
[[package]]
name = "tokio"
version = "1.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bddec43e7d9e77f958e866be951607158ceb2475c4bbdc0b5f68cd5b47d82d89"
dependencies = [
 "autocfg",
 "bytes",
 "libc",
 "memchr",
 "mio",
 "num_cpus",
 "once_cell",
 "parking_lot",
 "pin-project-lite",
 "signal-hook-registry",
 "tokio-macros",
 "winapi",
]
PrivateRookie commented 3 years ago

I prefer to specify major version, let cargo choose compatible dependency version, see Dependency Resolution for more info.