Ship the Homebrew native runtime intact past keg relocation - #25
Open
danielwinterw wants to merge 1 commit into
Open
Ship the Homebrew native runtime intact past keg relocation#25danielwinterw wants to merge 1 commit into
danielwinterw wants to merge 1 commit into
Conversation
The formula installed native-runtimes/ directly into libexec. Homebrew then relocates the keg: it rewrites install names and re-signs every Mach-O file it finds. The runtime's manifest.json records a SHA-256 for every runtime file and the loader refuses a runtime whose files no longer match, so every published Homebrew install has shipped a runtime the host rejects: warning: skipping malformed native runtime ...: native runtime file checksum mismatch for lib/libggml-base.0.17.0.dylib No local native runtimes found Stage the runtime as an archive during install and unpack it in post_install_steps, after relocation has run. The runtime needs none of that relocation: its libraries link only against system libraries and resolve each other through @loader_path. The formula test did not catch this because `runtime list` exits 0 and prints a warning naming the runtime it rejected, so `assert_match "native runtime"` matched the failure text. Assert on the discovered runtime id and on the absence of the rejection warning instead. Verified against the published v0.75.1 Apple Silicon archive: brew style, brew audit --strict, brew install and brew test all pass, and `runtime list` now reports the Metal runtime as available. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
Every published Homebrew install ships a native runtime the host rejects. On a clean
brew install Mesh-LLM/tap/mesh-llm(v0.75.1, Apple Silicon):The formula installed
native-runtimes/directly intolibexec. Homebrew then relocates the keg: it rewrites install names and re-signs every Mach-O file it finds. All 24 runtime libraries change — the keg copies carryflags=0x2(adhoc)where the shipped ones are0x20002(adhoc,linker-signed).manifest.jsonrecords a SHA-256 for every runtime file, and the loader refuses a runtime whose files no longer match, so the Metal runtime is discarded and the CLI has no local runtime.The fix
Stage the runtime as an archive during
installand unpack it inpost_install_steps, after relocation has run. The runtime needs none of that relocation: its libraries link only against system libraries and resolve each other through@loader_path. This keeps the shipped bytes — and the manifest's integrity guarantee — intact.Why CI did not catch it
runtime listexits 0 and prints a warning naming the runtime it rejected, soassert_match "native runtime"matched the failure text just as happily as a success. The test now asserts on the discovered runtime id and on the absence of the rejection warning, andtests/homebrew-release.test.tspins both that and the archive/post-install shape so this cannot regress.Verification
Against the published v0.75.1 Apple Silicon archive, on macOS 26.2 (arm64), using this repo's own CI sequence:
brew style— cleanbrew audit --strict mesh-llm/packaging-validation/mesh-llm— cleanbrew install --formula mesh-llm/packaging-validation/mesh-llm— okbrew test mesh-llm/packaging-validation/mesh-llm— passes, including the existing client-readiness smokemesh-llm runtime listnow reports✅ meshllm-native-runtime-darwin-aarch64-metal 0.75.1 (metal)node --experimental-strip-types --test tests/*.test.ts: 92 pass, 2 fail. Both failures are pre-existing onmainintests/workflow-provenance.test.tsand unrelated to this change — they shell out tomapfile, which macOS's bash 3.2 does not provide.🤖 Generated with Claude Code