Skip to content

Commit e376d6c

Browse files
fix(build): skip framework main binaries in codesign Step 1 to avoid ambiguity error (#1247)
The inside-out signing loop from #1246 signs ALL Mach-O files in Step 1, then .framework bundles in Step 2. But Python.framework/Python is both a Mach-O binary AND the main binary of a .framework bundle — codesign errors with "bundle format is ambiguous (could be app or framework)" when it's signed as a standalone file. Fix: Skip files whose parent directory is a .framework, .bundle, or .plugin in Step 1. These are correctly signed as part of their bundle in Step 2. Also extends Step 2 to cover .bundle and .plugin directories (not just .framework) for completeness. Fixes the Build Tauri master CI failure after #1246 merge.
1 parent a41abfb commit e376d6c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

scripts/package/build_app_tauri.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,20 @@ if [ -n "$APPLE_PERSONALID" ]; then
116116
# Use `xargs file` to batch all type queries in O(1) subprocess calls instead of
117117
# one `file` invocation per binary (PyInstaller bundles can contain hundreds of files).
118118
# Sort by path length descending so deeper binaries are signed before shallower containers.
119+
# IMPORTANT: Skip the main binary of .framework bundles (e.g. Python.framework/Python).
120+
# codesign treats those as ambiguous ("could be app or framework") when signed as
121+
# standalone files. They are correctly signed in Step 2 as part of the framework bundle.
119122
echo " Signing Mach-O binary files..."
120123
while IFS= read -r f; do
124+
# Skip main binaries of bundle directories (.framework, .bundle, .plugin) —
125+
# they'll be signed as part of the bundle in Step 2. Signing them standalone
126+
# causes "bundle format is ambiguous" errors from codesign.
127+
parent_dir="$(dirname "$f")"
128+
if [[ "$parent_dir" == *.framework ]] || [[ "$parent_dir" == *.framework/Versions/* ]] \
129+
|| [[ "$parent_dir" == *.bundle ]] || [[ "$parent_dir" == *.plugin ]]; then
130+
echo " Skipping bundle binary (signed in Step 2): $f"
131+
continue
132+
fi
121133
sign_binary "$f"
122134
done < <(find "dist/${APP_NAME}.app" -type f \
123135
| xargs file \

0 commit comments

Comments
 (0)