Skip to content

Fix macOS runner dylib install name for portable bundles#15

Merged
JAORMX merged 1 commit into
mainfrom
macos_loader
Mar 5, 2026
Merged

Fix macOS runner dylib install name for portable bundles#15
JAORMX merged 1 commit into
mainfrom
macos_loader

Conversation

@jhrozek

@jhrozek jhrozek commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Rewrite runner's libkrun load command from absolute Homebrew path to @loader_path/libkrun.dylib using install_name_tool in build-runner-darwin
  • Re-codesign after modification (required since install_name_tool invalidates the Mach-O signature)
  • Use cp -f for dylib copies to handle read-only files on rebuild

Test plan

  • task build-runner-darwin succeeds
  • otool -L bin/propolis-runner | grep krun shows @loader_path/libkrun.dylib
  • Manually replaced cached runtime in ~/.cache/broodbox/runtime/ — dyld no longer errors on libkrun.1.dylib

Fixes #14

🤖 Generated with Claude Code

Homebrew bakes an absolute path (/opt/homebrew/opt/libkrun/lib/libkrun.1.dylib)
into the runner's Mach-O load command. When the runner is extracted from an
embedded bundle into a cache directory, dyld fails to find libkrun.1.dylib
because the shipped file is named libkrun.dylib.

Use install_name_tool to rewrite the load command to @loader_path/libkrun.dylib
during build-runner-darwin, then re-codesign since install_name_tool invalidates
the signature. Also use cp -f to handle read-only Homebrew dylibs on rebuild.

Fixes #14

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JAORMX JAORMX merged commit 195fce1 into main Mar 5, 2026
7 checks passed
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.

macOS runner has wrong dylib install name, fails to find libkrun at runtime

2 participants