ntex-rs / ntex

framework for composable networking services
Apache License 2.0
2.05k stars 110 forks source link

Fail to import ntex from git #419

Closed Anivie closed 2 months ago

Anivie commented 2 months ago

I am trying to import this crate like this:

[dependencies.ntex]
git = "https://github.com/ntex-rs/ntex.git"
features = ["tokio", "tls-rustls", "rustls", "compress"]

But I will get this error:

error: failed to select a version for `ntex-io`.
    ... required by package `ntex-h2 v1.1.0`
    ... which satisfies dependency `ntex-h2 = "^1.1"` (locked to 1.1.0) of package `ntex v2.4.0 (https://github.com/ntex-rs/ntex.git#69f150e3)`
    ... which satisfies git dependency `ntex` of package `gpt-cat v0.1.0 (/home/gpt-cat)`
versions that meet the requirements `^2` (locked to 2.4.0) are: 2.4.0

all possible versions conflict with previously selected packages.

  previously selected package `ntex-io v2.5.0`
    ... which satisfies dependency `ntex-io = "^2.5"` of package `ntex v2.4.0 (https://github.com/ntex-rs/ntex.git#69f150e3)`
    ... which satisfies git dependency `ntex` of package `gpt-cat v0.1.0 (/home/gpt-cat)`

failed to select a version for `ntex-io` which could resolve this conflict

How can I fix this?Thanks!

leon3s commented 2 months ago

Hey, could you share you entire Cargo.toml

I tried with this one:

[package]
name = "test2"
version = "0.1.0"
edition = "2021"

[dependencies]

[dependencies.ntex]
git = "https://github.com/ntex-rs/ntex.git"
features = ["tokio", "tls-rustls", "rustls", "compress"]

And i didn't run into any issue

fafhrd91 commented 2 months ago

I just released ntex-io 2.5.0, you can just run "cargo update" it should fix the problem

Anivie commented 2 months ago

Thanks! Alright, I'm not sure if it's because of the cache or if the author provided a new version of ntex-io, but it worked fine after I just executed cargo clean and then cargo build again