You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dependency conflict with rquest due to async-compression and xz2 linking to lzma #15342
When using rquest with datafusion, a dependency conflict occurs because both crates depend on libraries that link to the native lzma library.
Steps to Reproduce
Create a new Rust project:
cargo new reproduce_conflict
cd reproduce_conflict
Cargo.toml:
[package]
name = "reproduce_conflict"
version = "0.1.0"
edition = "2024"
[dependencies]
rquest = { version = "3.0.5", features = ["full"] }
datafusion = "46.0.1"
Run cargo run
Actual Behavior:
error: failed to select a version for `xz2`.
... required by package `datafusion v46.0.1`
... which satisfies dependency `datafusion = "^46.0.1"` of package `reproduce_conflict v0.1.0 (/path/to/reproduce_conflict)`
versions that meet the requirements `^0.1` are: 0.1.7, 0.1.6, 0.1.5, 0.1.4, 0.1.3, 0.1.2, 0.1.1, 0.1.0
the package `xz2` links to the native library `lzma`, but it conflicts with a previous package which links to `lzma` as well:
package `datafusion-datasource v46.0.1`
... which satisfies dependency `datafusion-datasource = "^46.0.1"` of package `datafusion v46.0.1`
... which satisfies dependency `datafusion = "^46.0.1"` of package `reproduce_conflict v0.1.0 (/path/to/reproduce_conflict)`
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 = "lzma"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.
the package `datafusion` depends on `xz2`, with features: `static` but `xz2` does not have these features.
all possible versions conflict with previously selected packages.
previously selected package `async-compression v0.4.21`
... which satisfies dependency `async-compression = "^0.4.20"` of package `rquest v3.0.5`
... which satisfies dependency `rquest = "^3.0.5"` of package `reproduce_conflict v0.1.0 (/path/to/reproduce_conflict)`
failed to select a version for `xz2` which could resolve this conflict
Is there any way to resolve this conflict to build this successfully?
I agree. If the default features aren’t needed, they can be disabled by turning off default-features. The dependency conflict arises because async-compression has updated its upstream xz dependency: Nullus157/async-compression@c174981.
This is a result of a rift in the ecosystem. The xz2 crate has been forked and re-released under new name liblzma. The both have companion sys crates (lzma-sys and liblzma-sys respectively), which both define same static linking links = "lzma".
While xz2 is not actively maintained, it's not considered abandoned by its maintainer -- alexcrichton/xz2-rs#128. On the other hand, last release was 3 years ago.
Recently, the zip crate has migrated to the forked version (zip-rs/zip2#326), making it impossible to use datafusion and zip in one build. In particular, I became aware of this problem because of a dependency which transitively requires latest zip 0.4.3.
All in all, not an awesome situation with no really good solution. I wish this fork didn't happen.
I think we need to decide what to do with xz2 dependency that we ourselves define.
It doesn't look like the problem will go away. It doesn't look like the carpet is big enough to cover all this.
Activity
alamb commentedon Mar 21, 2025
I wonder if you can turn off the
compressionfeature in datafusionlike
default-features = false0x676e67 commentedon Mar 21, 2025
I agree. If the default features aren’t needed, they can be disabled by turning off default-features. The dependency conflict arises because
async-compressionhas updated its upstream xz dependency: Nullus157/async-compression@c174981.Omega359 commentedon Mar 21, 2025
Would forcing df to use 0.4.19 (
async-compression = { version = "=0.4.19") resolve this issue?findepi commentedon Jul 21, 2025
This is a result of a rift in the ecosystem. The
xz2crate has been forked and re-released under new nameliblzma. The both have companion sys crates (lzma-sysandliblzma-sysrespectively), which both define same static linkinglinks = "lzma".While
xz2is not actively maintained, it's not considered abandoned by its maintainer -- alexcrichton/xz2-rs#128. On the other hand, last release was 3 years ago.Recently, the
zipcrate has migrated to the forked version (zip-rs/zip2#326), making it impossible to usedatafusionandzipin one build. In particular, I became aware of this problem because of a dependency which transitively requires latestzip 0.4.3.All in all, not an awesome situation with no really good solution. I wish this fork didn't happen.
I think we need to decide what to do with
xz2dependency that we ourselves define.It doesn't look like the problem will go away. It doesn't look like the carpet is big enough to cover all this.
alamb commentedon Jul 21, 2025
Sounds like we should move to the non abandoned crate
Switch from xz2 to liblzma to reduce duplicate dependencies (#17509)
Switch from xz2 to liblzma to reduce duplicate dependencies (apache#1…
Switch from xz2 to liblzma to reduce duplicate dependencies (apache#1…
Switch from xz2 to liblzma to reduce duplicate dependencies (apache#1…
feat: Upgrade to DataFusion 51 + Arrow 57