Skip to content

Commit

Permalink
chore: replace rust-lzma with liblzma
Browse files Browse the repository at this point in the history
The reason for this is to have an lzma dependency,
which supports vendoring.
  • Loading branch information
ctron committed Jul 11, 2024
1 parent 5d160d1 commit cf8372a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 21 deletions.
37 changes: 24 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ itertools = "0.13"
jsn = "0.14"
jsonpath-rust = "0.6.1"
lenient_semver = "0.4.2"
liblzma = "0.3"
libz-sys = "*"
log = "0.4.19"
native-tls = "0.2"
Expand All @@ -84,7 +85,6 @@ regex = "1.10.3"
reqwest = "0.12"
ring = "0.17.8"
rstest = "0.21"
rust-lzma = "0.6.0"
sbom-walker = { version = "0.8.6", default-features = false, features = ["crypto-openssl", "cyclonedx-bom", "spdx-rs"] }
schemars = "0.8"
sea-orm = "0.12"
Expand Down
11 changes: 6 additions & 5 deletions test-context/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ trustify-common = { workspace = true }
trustify-migration = { workspace = true }
trustify-module-ingestor = { workspace = true }
trustify-module-storage = { workspace = true }
test-context = { workspace = true }
postgresql_embedded = { workspace = true }
tracing = { workspace = true }

anyhow = { workspace = true }
rust-lzma = { workspace = true }
futures = { workspace = true }
liblzma = { workspace = true }
log = { workspace = true }
postgresql_embedded = { workspace = true }
test-context = { workspace = true }
tokio = { workspace = true }
tokio-stream = { workspace = true }
tokio-util = { workspace = true }
futures = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
#chrono = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion test-context/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl TrustifyContext {
let mut bytes = Vec::new();
file.read_to_end(&mut bytes).await?;
if path.ends_with(".xz") {
bytes = lzma::decompress(&bytes)?;
bytes = liblzma::decode_all(&*bytes)?;
}
Ok(Bytes::copy_from_slice(&bytes))
}
Expand Down
4 changes: 3 additions & 1 deletion trustd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ url = { workspace = true }

openssl = { workspace = true }
libz-sys = { workspace = true }
liblzma = { workspace = true }

[dev-dependencies]
temp-env = { workspace = true }
Expand All @@ -36,7 +37,8 @@ vendored = [
"openssl/vendored",
# when using a vendored approach, we need to statically link zlib, otherwise we get some strange linker error
# unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stack_chk_guard@@GLIBC_2.17'
"libz-sys/static"
"libz-sys/static",
"liblzma/static",
]
pm = [
"garage-door",
Expand Down

0 comments on commit cf8372a

Please sign in to comment.