mercurial/mercurial-rust-metadata.patch

30 lines
1.2 KiB
Diff
Raw Normal View History

Patch cargo metadata for Fedora build
Update zstd to 0.12.0 (upstream is stuck on 0.5 because MSRV)
- adapt for breaking changes in zstd 0.10.0
diff --git a/rust/hg-core/Cargo.toml b/rust/hg-core/Cargo.toml
--- a/rust/hg-core/Cargo.toml
+++ b/rust/hg-core/Cargo.toml
2022-11-19 21:46:44 +00:00
@@ -34,7 +34,7 @@
2022-09-04 10:00:43 +00:00
micro-timer = "0.4.0"
log = "0.4.8"
2022-09-04 10:00:43 +00:00
memmap2 = { version = "0.5.3", features = ["stable_deref_trait"] }
-zstd = "0.5.3"
+zstd = "0.12"
format-bytes = "0.3.0"
2022-11-14 11:27:42 +00:00
# once_cell 1.15 uses edition 2021, while the heptapod CI
# uses an old version of Cargo that doesn't support it.
diff --git a/rust/hg-core/src/revlog/revlog.rs b/rust/hg-core/src/revlog/revlog.rs
--- a/rust/hg-core/src/revlog/revlog.rs
+++ b/rust/hg-core/src/revlog/revlog.rs
2022-07-11 16:04:12 +00:00
@@ -513,7 +513,7 @@ impl<'a> RevlogEntry<'a> {
} else {
let cap = self.uncompressed_len.max(0) as usize;
let mut buf = vec![0; cap];
- let len = zstd::block::decompress_to_buffer(self.bytes, &mut buf)
+ let len = zstd::bulk::decompress_to_buffer(self.bytes, &mut buf)
2022-07-11 16:04:12 +00:00
.map_err(|e| corrupted(e.to_string()))?;
if len != self.uncompressed_len as usize {
2022-07-11 16:04:12 +00:00
Err(corrupted("uncompressed length does not match"))