Skip to content

fix: patch Darwin liblzma linkage - #53

Merged
houseme merged 1 commit into
mainfrom
houseme/fix-darwin-liblzma
Aug 5, 2026
Merged

fix: patch Darwin liblzma linkage#53
houseme merged 1 commit into
mainfrom
houseme/fix-darwin-liblzma

Conversation

@houseme

@houseme houseme commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix the aarch64-darwin package so the prebuilt RustFS binary no longer depends on Homebrew's absolute liblzma path at runtime.

Root Cause

The upstream macOS aarch64 release binary currently contains this Mach-O load command:

/opt/homebrew/opt/xz/lib/liblzma.5.dylib

The flake installs the downloaded binary unchanged, so packages.aarch64-darwin.default can fail in a clean Nix environment where Homebrew's xz is not installed at that exact path.

Changes

  • Add Darwin-only install_name_tool support during the package install phase.
  • Copy Nixpkgs' xz liblzma.5.dylib into $out/lib.
  • Rewrite the RustFS binary to load @executable_path/../lib/liblzma.5.dylib.
  • Leave Linux package behavior unchanged.

Validation

  • git diff --check
  • jq empty sources.json
  • actionlint
  • Ruby YAML parse for .github/workflows/*.yml
  • PR CI passed:
    • Lint and Evaluate
    • Build Linux package
  • Local Mach-O patch simulation against the current 1.0.0-beta.12 macOS aarch64 asset:
    • source zip SHA256 matched sources.json
    • otool -L changed from /opt/homebrew/opt/xz/lib/liblzma.5.dylib to @executable_path/../lib/liblzma.5.dylib
    • codesign --verify --verbose remained valid
    • patched $out/bin/rustfs --help ran successfully

Local nix is not installed in this checkout environment, and the existing repository CI does not include a macOS package build job. A full nix build .#packages.aarch64-darwin.default still needs to be run in a Nix-enabled macOS environment.

Fixes #51.

Co-Authored-By: heihutu <heihutu@gmail.com>
@houseme
houseme force-pushed the houseme/fix-darwin-liblzma branch from ad93238 to 2792e03 Compare August 5, 2026 10:35
@houseme
houseme marked this pull request as ready for review August 5, 2026 10:43
@houseme
houseme merged commit e71e6be into main Aug 5, 2026
2 checks passed
@houseme
houseme deleted the houseme/fix-darwin-liblzma branch August 5, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aarch64-darwin package depends on hard link homebrew liblzma and cannot run in a clean Nix environment

1 participant