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 }