Skip to content

Commit 1484cf6

Browse files
committed
fix: add Frameworks rpath to bundle — Sparkle now loadable
Every release bundle since we switched to Sparkle has shipped broken: SPM's linker only stamps @loader_path into LC_RPATH, which resolves to Contents/MacOS/. Sparkle.framework lives at Contents/Frameworks/, so dyld halts at launch with Library not loaded: @rpath/Sparkle.framework/Versions/B/Sparkle Reason: tried '.../Contents/MacOS/Sparkle.framework/...' (no such file) and macOS shows \"Kiln cannot be opened because of a problem\" with no hint as to what went wrong. make-app-bundle.sh now patches the binary with `install_name_tool -add_rpath @executable_path/../Frameworks` right after copying it, before codesign runs — so the fix survives signing.
1 parent 9a7205a commit 1484cf6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

scripts/make-app-bundle.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources" "$APP/Contents/Framewor
6161

6262
cp "$EXECUTABLE" "$APP/Contents/MacOS/$APP_NAME"
6363

64+
# SPM builds only stamp `@loader_path` into LC_RPATH. Once the binary lives
65+
# in Contents/MacOS/, that resolves to MacOS/ — but Sparkle.framework lives
66+
# one level up in Contents/Frameworks/, so dyld can't find it and the app
67+
# dies at launch with "Library not loaded: @rpath/Sparkle.framework/…".
68+
# Add the Frameworks search path explicitly. `|| true` keeps reruns idempotent.
69+
install_name_tool -add_rpath '@executable_path/../Frameworks' \
70+
"$APP/Contents/MacOS/$APP_NAME" 2>/dev/null || true
71+
6472
# 3. Bundle Sparkle.framework. Pull the matching arch slice out of the
6573
# xcframework if available; otherwise fall back to whatever's there.
6674
SPARKLE_FW=""

0 commit comments

Comments
 (0)