Skip to content

Commit 8788874

Browse files
committed
Make liblzma an optional dependency.
It is only used when extracting binaries from the zonky repo which is already behind a feature flag. See also theseus-rs#187 for an xplanation of why this cause issues when a project also pulls in the xz2 crate (can't link the lzma C library twice). Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
1 parent 2d27e1f commit 8788874

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

postgresql_archive/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async-trait = { workspace = true }
1515
flate2 = { workspace = true }
1616
futures-util = { workspace = true }
1717
hex = { workspace = true }
18-
liblzma = { workspace = true }
18+
liblzma = { workspace = true, optional = true }
1919
md-5 = { workspace = true, optional = true }
2020
num-format = { workspace = true }
2121
quick-xml = { workspace = true, features = ["serialize"], optional = true }
@@ -49,7 +49,7 @@ tokio = { workspace = true }
4949
[features]
5050
default = [
5151
"native-tls",
52-
"theseus",
52+
"theseus"
5353
]
5454
blocking = ["dep:tokio"]
5555
github = [
@@ -77,6 +77,7 @@ theseus = [
7777
]
7878
zonky = [
7979
"maven",
80+
"liblzma"
8081
]
8182

8283
[package.metadata.docs.rs]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
mod model;
22
pub mod registry;
33
mod tar_gz_extractor;
4+
#[cfg(feature = "liblzma")]
45
mod tar_xz_extractor;
56
mod zip_extractor;
67

78
pub use model::ExtractDirectories;
89
pub use tar_gz_extractor::extract as tar_gz_extract;
10+
#[cfg(feature = "liblzma")]
911
pub use tar_xz_extractor::extract as tar_xz_extract;
1012
pub use zip_extractor::extract as zip_extract;

0 commit comments

Comments
 (0)