From 2031546098060f4350831a5d19c22a275f6088ed Mon Sep 17 00:00:00 2001 From: Gerald Berger Date: Fri, 28 Aug 2026 10:01:27 +0200 Subject: [PATCH] Switch flate2 backend from zlib-ng to zlib-rs flate2's zlib-ng feature pulls in libz-ng-sys, which compiles zlib-ng's C source via CMake. On BinaryBuilder's aarch64-apple-darwin toolchain (Clang 22), this fails: zlib-ng's CMake ARMv8 CRC32 feature-detection incorrectly concludes the compiler lacks native __crc32b/__crc32h/ __crc32w intrinsics, so it includes its own polyfill header (acle_intrins.h) -- which then collides with Clang's own arm_acle.h, which already defines them, producing "redefinition of '__crc32b'" compile errors. zlib-rs (a pure-Rust zlib reimplementation, no C compiler needed) is already used elsewhere in this same dependency graph -- parquet (via iceberg-rust, a downstream consumer of this crate through iceberg_rust_ffi) enables flate2's zlib-rs feature. Before this change both backends were being compiled into the same binary simultaneously, which flate2's own documentation flags as producing undefined ordering behavior when more than one backend is enabled at once. Switching to zlib-rs here removes the C dependency entirely and unifies on the backend already in use. `cargo update -p flate2` was needed since the lockfile still had the pre-zlib-rs 1.0.28 release pinned; it resolved to 1.1.10, dropping `cmake` and `libz-ng-sys` from the dependency tree and adding `zlib-rs`, `miniz_oxide`, `adler2`, and `simd-adler32` (all pure Rust). Verified: `cargo test --lib` (37 passed), `cargo build --release`, both clean. Co-Authored-By: Claude Sonnet 5 --- Cargo.lock | 59 +++++++++++++++++++++++++++++++----------------------- Cargo.toml | 4 ++-- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b9a8d4..22f3be3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + [[package]] name = "ahash" version = "0.8.11" @@ -209,7 +215,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.7.1", "object", "rustc-demangle", ] @@ -378,15 +384,6 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" -[[package]] -name = "cmake" -version = "0.1.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" -dependencies = [ - "cc", -] - [[package]] name = "colorchoice" version = "1.0.2" @@ -605,13 +602,13 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.28" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb" dependencies = [ "crc32fast", - "libz-ng-sys", - "miniz_oxide", + "miniz_oxide 0.9.1", + "zlib-rs", ] [[package]] @@ -1156,16 +1153,6 @@ version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" -[[package]] -name = "libz-ng-sys" -version = "1.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6409efc61b12687963e602df8ecf70e8ddacf95bc6576bcf16e3ac6328083c5" -dependencies = [ - "cmake", - "libc", -] - [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1281,6 +1268,16 @@ dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c" +dependencies = [ + "adler2", + "simd-adler32", +] + [[package]] name = "mio" version = "0.8.10" @@ -1404,7 +1401,7 @@ dependencies = [ [[package]] name = "object_store_ffi" -version = "0.12.8" +version = "0.12.9" dependencies = [ "anyhow", "async-channel", @@ -2093,6 +2090,12 @@ dependencies = [ "libc", ] +[[package]] +name = "simd-adler32" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" + [[package]] name = "sketches-ddsketch" version = "0.2.2" @@ -2834,6 +2837,12 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zlib-rs" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34b31d188d9d685a4f9c7b46d6e36631b07058d2cfe190267adce54dc230bf12" + [[package]] name = "zstd" version = "0.13.0" diff --git a/Cargo.toml b/Cargo.toml index d838829..3a0d436 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "object_store_ffi" -version = "0.12.8" +version = "0.12.9" edition = "2021" [[bench]] @@ -57,7 +57,7 @@ serde_json = "1" regex = "1.10" backoff = "0.4" hyper = { version = "1.2", default-features = false } -flate2 = { version = "1.0.28", features=["zlib-ng"], default-features = false} +flate2 = { version = "1.0.28", features=["zlib-rs"], default-features = false} async-compression = { version = "0.4.6", default-features = false, features = ["tokio", "gzip", "zlib", "deflate", "zstd"] } flume = "0.11.0" pin-project = "1.1.5"