Skip to content

fix(release): add @executable_path rpath so the app finds Sparkle - #71

Merged
bbjansen merged 1 commit into
mainfrom
fix/sparkle-rpath
Oct 30, 2026
Merged

bbjansen merged 1 commit into
mainfrom
fix/sparkle-rpath

Conversation

@bbjansen

Copy link
Copy Markdown
Owner

Why

v0.1.6 (built via the new xcodebuild path) still crashed at launch —
but with a different, clearer fault than the v0.1.5 Bundle.module
crash (which is now fixed). The new crash:

Termination Reason: DYLD, Library missing
Library not loaded: @rpath/Sparkle.framework/Versions/B/Sparkle
Reason: tried: '.../Simpleton.app/Contents/lib/Sparkle.framework/...' (no such file)

The binary links Sparkle as @rpath/Sparkle.framework. xcodebuild gives
the binary only @executable_path/../lib as a relocatable rpath (→
Contents/lib), but make-app-bundle.sh embeds Sparkle.framework in
Contents/MacOS. So @rpath never resolved to the embedded framework.
(swift build binaries carry an rpath that already resolves to
Contents/MacOS, which is why dev builds launched.)

Fix

Add a plain @executable_path rpath (= Contents/MacOS) to the binary
in make-app-bundle.sh, so @rpath/Sparkle.framework finds the embedded
copy. Only added when the exact entry is absent (install_name_tool
errors on a duplicate; swift build binaries already have a working
rpath), and before signing since it invalidates the signature.

Verification (local, against the real published v0.1.6 products)

  • Reproduced the DYLD abort from the downloaded Simpleton-0.1.6.zip.
  • Applied the rpath + re-sign → app launches and stays alive with no
    new crash report
    .
  • Ran the updated make-app-bundle.sh end-to-end against a
    reconstructed products dir → produced app launches clean.
  • shellcheck clean; rpath guard correctly detects present/absent.

v0.1.6 built via xcodebuild aborted at launch with a DYLD error
("Library not loaded: @rpath/Sparkle.framework/Versions/B/Sparkle").
The binary links Sparkle as @rpath/Sparkle.framework, but xcodebuild's
only relocatable rpath is @executable_path/../lib (→ Contents/lib),
while make-app-bundle embeds Sparkle at Contents/MacOS. dyld therefore
looked in Contents/lib and found nothing.

Add a plain @executable_path rpath (= Contents/MacOS) to the binary so
@rpath resolves to the embedded framework. Only added when the exact
entry is absent (install_name_tool errors on a duplicate; swift build
binaries already resolve it), and before signing since it invalidates
the signature.

Verified locally against the published v0.1.6 products: the app now
launches and stays running with no DYLD abort.
@bbjansen
bbjansen merged commit 3ac996e into main Oct 30, 2026
5 checks passed
@bbjansen
bbjansen deleted the fix/sparkle-rpath branch October 30, 2026 15:50
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.

2 participants