2

I have two dependencies, actix-web and sled. Both rely on zstd, however they rely on zstd-sys v2.0.4 and zstd-sys 1.6.1 respectively. Is there a way I can "link" actix-web to one version of zstd, and sled to another?

I attempted to import both actix-web and sled (using the compression build feature), but I got an error while running cargo run saying:

Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the links ='zstd-sys' value.

EDIT: cargo.toml:

[dependencies]
actix = "0.13.0"
actix-web = { version = "4", features = ["rustls"] }
actix-web-actors = "4.1.0"
awc = { version = "3", features = ["rustls"] }
tokio = { version = "1.23.1", features = ["sync"] }
url = { version = "2.2", features = ["serde"] }
env_logger = "0.10.0"
sled = { version = "0.34.7", features = ["compression"], links = "zstd-sys=1.6.1"}
bincode = "1.3.3"
serde = {version = "1.0", features = ["derive"]}
futures-util = "0.3.25"
actix-codec = "0.5.0"
rustls = "0.20.8"
concurrent-map = "5.0.6"
lazy_static = "1.4.0"

[dependencies.xxhash-rust]
version = "0.8.5"
features = ["xxh3", "const_xxh3"]

cargo.lock: https://paste.sh/-iT7By7H#LtyAzaZV5qTT-5w5F4qXoG0h

  • Would you mind posting your `Cargo.toml` (and possibly `.lock` too)? I tried reproducing this, but actix-web 3 works fine, and for actix-web 4 I get dependency resolution errors. – Caesar Jan 17 '23 at 00:45
  • Hey @Caesar, thank you for asking, I have edited it! Yes, I am using actix-web 4. – blurt.washday Jan 17 '23 at 00:59

0 Answers0