From a231e517c3b371e1bf0ee8af71ed807424a9a05d Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Thu, 5 Nov 2026 13:20:56 +0100 Subject: [PATCH] craft-update: zip without zlib-rs so apps keep flate2's miniz backend (#608) zip's `deflate` feature pulls in deflate-flate2-zlib-rs (and zopfli). Cargo unifies flate2's features across the whole app, so on Windows every flate2 user in an app depending on craft-update switched to zlib-rs, whose level 1 is a static-Huffman quick mode that can produce output larger than its input (Lightcraft's 16-bit ZIP TIFFs on Windows came out bigger than uncompressed). Use `deflate-flate2` with flate2's default miniz_oxide backend instead; the updater only reads Deflate zips, which that covers. --- Cargo.lock | 13 ------------- crates/update/Cargo.toml | 7 ++++++- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c9994c6..9cb7a068 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7441,7 +7441,6 @@ dependencies = [ "nix", "typed-path", "windows-sys 0.61.2", - "zopfli", ] [[package]] @@ -7456,18 +7455,6 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" -[[package]] -name = "zopfli" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf7fc5d30c28483d93805c4a5e12b05bbb52407fa67c5f8bd552374cd01fb11" -dependencies = [ - "bumpalo", - "crc32fast", - "log", - "simd-adler32", -] - [[package]] name = "zune-core" version = "0.5.3" diff --git a/crates/update/Cargo.toml b/crates/update/Cargo.toml index 4e074060..8d375275 100644 --- a/crates/update/Cargo.toml +++ b/crates/update/Cargo.toml @@ -47,6 +47,11 @@ plist = "1" [target.'cfg(target_os = "windows")'.dependencies] winreg = "0.55" dunce = "1" -zip = { version = "9", default-features = false, features = ["deflate"] } +# `deflate-flate2` with flate2's default miniz_oxide backend, not zip's `deflate` (zopfli and +# zlib-rs): Cargo unifies flate2's features across an app, and zlib-rs would switch the whole +# app's flate2 to it, where level 1 is a static-Huffman mode that can make output larger than +# its input (Lightcraft's 16-bit ZIP TIFFs on Windows). +zip = { version = "9", default-features = false, features = ["deflate-flate2"] } +flate2 = "1" winsafe = { version = "0.0.29", features = ["advapi", "kernel", "shell", "version"] } verifysign = "1"