From 85d8a6951b15562387826f889466243dbd8c8da1 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Tue, 7 Jan 2025 11:28:34 -0500 Subject: [PATCH] Attempt to enable zlib-ng on all platforms --- Cargo.lock | 1 - .../uv-performance-flate2-backend/Cargo.lock | 41 +++++++++++++++++++ .../uv-performance-flate2-backend/Cargo.toml | 12 +++--- 3 files changed, 46 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7a16a53e5a04..35f969d7f195 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5282,7 +5282,6 @@ name = "uv-performance-flate2-backend" version = "0.1.0" dependencies = [ "flate2", - "libz-ng-sys", ] [[package]] diff --git a/crates/uv-performance-flate2-backend/Cargo.lock b/crates/uv-performance-flate2-backend/Cargo.lock index 718b75bef8b4..753bcbcd4953 100644 --- a/crates/uv-performance-flate2-backend/Cargo.lock +++ b/crates/uv-performance-flate2-backend/Cargo.lock @@ -8,12 +8,30 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +[[package]] +name = "cc" +version = "1.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" +dependencies = [ + "shlex", +] + [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cmake" +version = "0.1.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c682c223677e0e5b6b7f63a64b9351844c3f1b1678a68b7ee617e30fb082620e" +dependencies = [ + "cc", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -30,10 +48,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", + "libz-ng-sys", "libz-rs-sys", "miniz_oxide", ] +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libz-ng-sys" +version = "1.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cee1488e961a80d172564fd6fcda11d8a4ac6672c06fe008e9213fa60520c2b" +dependencies = [ + "cmake", + "libc", +] + [[package]] name = "libz-rs-sys" version = "0.4.1" @@ -52,6 +87,12 @@ dependencies = [ "adler2", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "uv-performance-flate2-backend" version = "0.1.0" diff --git a/crates/uv-performance-flate2-backend/Cargo.toml b/crates/uv-performance-flate2-backend/Cargo.toml index 7f137bfe652f..790463894b72 100644 --- a/crates/uv-performance-flate2-backend/Cargo.toml +++ b/crates/uv-performance-flate2-backend/Cargo.toml @@ -7,12 +7,10 @@ edition = "2021" [lib] doctest = false -# Use `zlib-ng` on x86_64 targets, apart from FreeBSD. -[target.'cfg(all(target_arch = "x86_64", not(target_os = "freebsd")))'.dependencies] -flate2 = { version = "1.0.28", default-features = false, features = ["zlib-ng"] } -# See: https://github.com/rust-lang/libz-sys/issues/225 -libz-ng-sys = { version = "<1.1.20" } - # Use `zlib-rs` everywhere else. -[target.'cfg(not(all(target_arch = "x86_64", not(target_os = "freebsd"))))'.dependencies] +[target.'cfg(any(target_os = "freebsd"))'.dependencies] flate2 = { version = "1.0.28", default-features = false, features = ["zlib-rs"] } + +# Use `zlib-ng` on all supported platforms. +[target.'cfg(not(any(target_os = "freebsd")))'.dependencies] +flate2 = { version = "1.0.28", default-features = false, features = ["zlib-ng"] }