Repository navigation
Conversation
…tart The macOS release is signed with --options runtime (hardened runtime) but without any entitlements. Hardened runtime blocks anonymous executable memory, so when pyobjc is imported during startup, libffi cannot allocate closure memory and falls into an endless temp-file retry loop. The app hangs after logging 'Runtime started': no server port, no window, and the macOS single-instance lock makes every later launch exit silently (issue OpenBMB#35). Add packaging/macos.entitlements (allow-unsigned-executable-memory and allow-jit) and pass it to codesign in sign_code(). Verified on macOS 13.7.8 (Intel): re-signing the released 1.0.0-preview app with these entitlements lets it start normally (server binds 127.0.0.1:5174, UI returns HTTP 200), while the shipped signature hangs indefinitely.
This branch has not been deployed
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.
问题
macOS 正式包在 Hardened Runtime 签名下启动即卡死:日志停在
Runtime started,不监听端口、不出现窗口;且首个卡死实例持有单实例锁,导致后续启动静默退出。详见 #291。根因
sign_code()用--options runtime签名但未传任何 entitlements。Hardened Runtime 阻止匿名可执行内存映射,pyobjc 导入时 libffi closure 分配失败,转入临时文件回退路径并无限重试(sample可见主线程 100% 位于PyObjC_RegisterStructType → dlmmap_locked → mmap/write/unlink循环),应用永远无法到达服务器启动阶段。改动
packaging/macos.entitlements:com.apple.security.cs.allow-unsigned-executable-memory+com.apple.security.cs.allow-jit(PyInstaller + pyobjc 应用的标准配置,与公证兼容)sign_code()签名时传入该 entitlements(sign_app_bundle对每个 Mach-O 及主 bundle 的签名均生效);无MAC_SIGN_ID的 ad-hoc 分支行为不变验证(macOS 13.7.8 / Intel iMac)
Server starting host=127.0.0.1 port=5174,/chat/返回 HTTP 200bash -n/plutil -lint通过Fixes #291