From b7444e8090ce7f0ce207c69de27764002ab48cf9 Mon Sep 17 00:00:00 2001 From: Christ Date: Wed, 12 Aug 2026 01:57:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=20macOS=20Chromium=20?= =?UTF-8?q?=E5=B5=8C=E5=A5=97=E7=AD=BE=E5=90=8D=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 跳过 Chromium bundle 内部 Mach-O 的提前单独签名,避免主程序触发未完成 Framework 校验。 - 仅签名 bundle 外的独立二进制,并按目录深度递归签名 app、framework 和 xpc 组件。 --- packaging/macos/build-pkg.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packaging/macos/build-pkg.sh b/packaging/macos/build-pkg.sh index fdb3078..4ddd625 100755 --- a/packaging/macos/build-pkg.sh +++ b/packaging/macos/build-pkg.sh @@ -66,20 +66,20 @@ if [ -n "${MACOS_SIGNING_IDENTITY:-}" ]; then fi } - # Playwright runtime 中包含 Node 和 Chromium.app,必须在 App 签名之前完成签名。 - # 先签每个 Mach-O 文件,再按目录深度从内到外签 bundle。Chromium 的 - # .app 内还嵌套了 .framework/.xpc 和其他 helper .app;必须先签 Mach-O, - # 再按目录深度对每个 bundle 递归签名,最后才签外层应用。 + # Playwright runtime 中包含独立 Node 和 Chromium.app。bundle 主程序不能 + # 提前作为单个 Mach-O 签名,否则 codesign 会先校验尚未签名的内层 Framework。 + # 因此这里只签 bundle 外的独立 Mach-O,再按目录深度递归签名所有 bundle。 signing_list="$(mktemp)" trap 'rm -f "$signing_list"' EXIT find "$APP/Contents/Resources/playwright-runtime" -type f -print > "$signing_list" while IFS= read -r executable; do + case "$executable" in + *.app/*|*.framework/*|*.xpc/*) continue ;; + esac if file "$executable" | grep -q 'Mach-O'; then sign_code "$executable" fi - # `set -e` is not reliable for a while loop in a pipeline on macOS /bin/sh. - # Exit explicitly so a failed child signature reaches the parent script. done < "$signing_list" find "$APP/Contents/Resources/playwright-runtime" -depth -type d \