From 25e73d3bd6a104110f801a17a0db04cb8b63c93c Mon Sep 17 00:00:00 2001 From: Hauser Date: Fri, 9 Oct 2026 16:25:24 +0800 Subject: [PATCH] fix(zip): statically link liblzma on macOS (#8434) * fix(zip): statically link liblzma on macOS Co-Authored-By: heihutu Co-Authored-By: zhi22915 * fix(zip): pin macOS liblzma minimum to 0.4.8 Co-Authored-By: heihutu Co-Authored-By: zhi22915 * fix(admin): route bucket recovery errors through facade Co-Authored-By: heihutu Co-Authored-By: zhi22915 * fix(ecstore): group version pagination markers Co-Authored-By: heihutu Co-Authored-By: zhi22915 * fix(heal): avoid cloning copy purge identity Co-Authored-By: heihutu Co-Authored-By: zhi22915 --------- Co-authored-by: heihutu Co-authored-by: zhi22915 --- .github/workflows/build.yml | 11 +++++++++++ Cargo.lock | 1 + crates/zip/Cargo.toml | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7c442afa..a647019c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -440,6 +440,17 @@ jobs: fi done + - name: Verify macOS binary has no dynamic liblzma dependency + if: matrix.platform == 'macos' + shell: bash + run: | + binary="target/${{ matrix.target }}/release/rustfs" + if otool -L "$binary" | grep -E 'liblzma.*\.dylib'; then + echo "macOS release binary must not depend on a dynamic liblzma library" >&2 + exit 1 + fi + "$binary" --version + - name: Generate the CPU symbol catalog if: endsWith(matrix.target, '-linux-gnu') && matrix.features == 'pyroscope' shell: bash diff --git a/Cargo.lock b/Cargo.lock index 249730c39..8cbaf850c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11060,6 +11060,7 @@ dependencies = [ "async-compression", "futures", "hotpath", + "liblzma", "rustfs-rio", "rustfs-tokio-tar", "serde", diff --git a/crates/zip/Cargo.toml b/crates/zip/Cargo.toml index c0b21eb0e..24871f654 100644 --- a/crates/zip/Cargo.toml +++ b/crates/zip/Cargo.toml @@ -49,6 +49,10 @@ rustfs-rio.workspace = true tokio = { workspace = true, features = ["io-util", "macros", "rt"] } thiserror = { workspace = true } +[target.'cfg(target_os = "macos")'.dependencies] +# Keep XZ decoding self-contained in macOS binaries instead of linking Homebrew liblzma. +liblzma = { version = "0.4.8", features = ["static"] } + [dev-dependencies] rustfs-tokio-tar = { workspace = true } futures = { workspace = true }