Skip to content

Commit 93053d0

Browse files
fix(build): sign non-standard framework binary via temp copy to avoid ambiguity (#1250)
codesign refuses to sign Python.framework/Python in-place when the binary is inside a .framework directory — it sees the directory context and reports 'bundle format is ambiguous (could be app or framework)'. The #1249 fallback correctly detected this case but then called sign_binary on the same path, which hits the same codesign check. Fix: copy the binary to a temp path outside any .framework dir, sign it there, then copy the signed binary back. Code signatures are embedded in the Mach-O binary (not path-dependent), so the result is identical. This should be the final fix needed to unblock the Build Tauri master CI and allow the Thursday 2026-04-09 12:00 UTC scheduled dev release to run.
1 parent 6d836c0 commit 93053d0

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

scripts/package/build_app_tauri.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,20 @@ if [ -n "$APPLE_PERSONALID" ]; then
153153
--sign "$APPLE_PERSONALID" \
154154
"$fw" 2>&1) && echo " Signed bundle: $fw" || {
155155
if echo "$sign_output" | grep -q "bundle format is ambiguous"; then
156-
echo " Note: $fw lacks standard bundle structure; signing main binary inside directly"
156+
echo " Note: $fw lacks standard bundle structure; signing main binary via temp copy"
157157
fw_name="$(basename "${fw%.*}")"
158158
fw_binary="$fw/$fw_name"
159159
if [ -f "$fw_binary" ]; then
160-
sign_binary "$fw_binary"
160+
# codesign refuses to sign Python.framework/Python in-place because
161+
# it sees the parent .framework dir and reports "bundle format is
162+
# ambiguous". Copy to a temp path outside any bundle directory,
163+
# sign there, then copy back. Code signatures are embedded in the
164+
# binary (not path-dependent), so the result is identical.
165+
tmp_binary=$(mktemp)
166+
cp "$fw_binary" "$tmp_binary"
167+
sign_binary "$tmp_binary"
168+
cp "$tmp_binary" "$fw_binary"
169+
rm -f "$tmp_binary"
161170
else
162171
echo "ERROR: Expected main binary not found at $fw_binary" >&2
163172
echo " PyInstaller may have changed its output structure. Inspect $fw" >&2

0 commit comments

Comments
 (0)