emrg: pkg 内嵌 runtime codesign — .so/dylib/python 二进制 Developer ID 签名(第 10 次构建公证 Invalid 根因) - #475
Merged
Merged
Conversation
…第 10 次构建公证 Invalid 根因)
argszero
commented
Aug 6, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 20260806-1534
独立复核:
- 根因链完整:第 10 次构建 notarytool Invalid → Apple 日志实锤 .so 未签名(_speedups/websockets/yaml 原生扩展)——公证要求 pkg 内所有 Mach-O 有 Developer ID + timestamp
- 修复位置正确:make-installer.sh payload 组装后 pkgbuild 前(签名在打包前生效)
- 收集逻辑验证:fat binary file 多行输出('for architecture' 后缀行)已用 grep -v 过滤,本机实测去重正确
- 排除 EMRG.app(electron-builder 已签)与卸载 app(无 Mach-O)合理
- 身份从默认 keychain 自动获取(CI Import step 已设 default-keychain)✅
- 未找到身份降级不失败(非 macOS 构建不受影响)✅
- bash -n ✅ / pytest 473 ✅ / actionlint ✅
…建公证 Invalid 第三类错误:executable does not have the hardened runtime enabled)
argszero
commented
Aug 6, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 1540
独立复核 + 补充:
- 补 hardened runtime:原提交 codesign 缺 --options runtime——Apple 公证 Invalid 有第三类错误 'executable does not have the hardened runtime enabled'(12 个文件 × 3 类错,notarytool log statusCode 4000 实测)。已补上并 push(c39183f)
- 实测验证(正反两态 #455):
- find 匹配:python3.13/dylib/so 三类 Mach-O 正确选中;bash 脚本(emrg-uninstall)与 EMRG.app 正确排除
- codesign:3 类文件全部签名成功,flags=0x10000(runtime) 确认 hardened runtime + timestamp
- pytest 473 passed + bash -n 通过
- 与第 10 次构建 notarytool log 的 12 个文件 3 类错误一一对应
LGTM。
argszero
commented
Aug 6, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 20260806-1543
独立复核(第 3 票):
- 判别逻辑正反实测(#455/#461/#464/#476 教训):
- find 收集:
-path '*EMRG.app' -prune排除已签 GUI(electron-builder 签),-name 'python*'匹配 python3.13 但-type f不跟软链(python 软链不误匹配)✅ - file 输出管线:fat binary 多行
(for architecture ...)被 grep -v 过滤,主行 cut -d: -f1 取路径,sort -u 去重——模拟 fat+单架构混排实测输出正确 ✅ - SIGN_ID 提取:
security find-identitygrep 'Developer ID Application'(不含 Installer 身份)→ sed 取 common name,codesign -s 可用 ✅ - 反向态:无身份时 echo 警告跳过不 fail-fast(留宿主可见信号)✅
- find 收集:
- 根因对应:第 10 次构建 notarytool Invalid statusCode 4000 三类错(未签名/无 timestamp/无 hardened runtime)——--force --timestamp --options runtime 三件套全覆盖 ✅
- 签名时机:payload 组装后 pkgbuild 前(签名进包)✅;bash -n 通过;Test CI 31082094689 success ✅
This was referenced Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景:第 10 次构建(141688c 双 p12 方案)首次走完整个签名链——Import 双证书 ✅ → electron-builder 签 .app ✅ → productsign 签 .pkg ✅ → notarytool 返回 Invalid。抓 Apple 公证日志定位根因:
根因:pkg 内嵌的 Python runtime(dist/runtime/)含多个原生扩展 .so(markupsafe/websockets/yaml 等),这些二进制未 codesign——macOS 公证要求 pkg 内所有 Mach-O 二进制必须有 Developer ID 签名 + 时间戳。
修复(make-installer.sh darwin 分支):payload 组装后、pkgbuild 前,对 runtime 内所有 Mach-O 二进制 codesign:
find .so/.dylib/python*/emrgd/emrg/emrg-uninstall+file过滤 Mach-O(排除 EMRG.app 已签 + 卸载 app 无 Mach-O)codesign --force --timestamp --sign $(Developer ID Application)grep -v 'for architecture'去重验证: