Skip to content

fix: bundle libpq and transitive dylibs into app for distribution#44

Merged
datlechin merged 1 commit intomainfrom
fix/bundle-dylibs-for-distribution
Feb 9, 2026
Merged

fix: bundle libpq and transitive dylibs into app for distribution#44
datlechin merged 1 commit intomainfrom
fix/bundle-dylibs-for-distribution

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

  • Fixes launch crash (SIGABRT, DYLD Library missing: libpq.5.dylib) on machines without Homebrew
  • Adds bundle_dylibs() post-build step to build-release.sh that recursively copies non-system dylibs (libpq, OpenSSL, Kerberos) into Contents/Frameworks/ and rewrites load paths to @executable_path/../Frameworks/
  • Adds CI verification in both arm64 and x86_64 builds to fail if any Homebrew paths remain in the binary

Test plan

  • Run scripts/build-release.sh arm64 and verify Contents/Frameworks/ contains bundled dylibs
  • Run otool -L on the output binary and confirm no /opt/homebrew/ or /usr/local/opt/ references
  • Launch the built app on a Mac without Homebrew's libpq installed — should no longer crash
  • Verify CI passes for both arm64 and x86_64 builds

The app crashed at launch on machines without Homebrew because libpq
(and its dependencies: OpenSSL, Kerberos) were dynamically linked with
hardcoded Homebrew paths. Add a bundle_dylibs post-build step that
copies non-system dylibs into Contents/Frameworks/ and rewrites all
load paths to @executable_path/../Frameworks/. CI now also verifies
no Homebrew references remain in the final binary.
@datlechin datlechin merged commit 1b720ea into main Feb 9, 2026
@datlechin datlechin deleted the fix/bundle-dylibs-for-distribution branch February 9, 2026 17:30
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.

1 participant