macOS 发布改为只出 arm64 单架构(修复 Mac 管线 #7 起连续失败) #447

Merged
suzmii merged 2 commits from feat/agc-macos-arm64-only into master 2026-09-21 12:38:04 +08:00
Member

背景

Mac 管线连续失败(#7~#13)的根因是:发布目标一直是 universal-apple-darwin,而随包 Node 便携运行时取自构建宿主的官方发行版,官方 Node 没有 universal 发行版,所以 staging 只能抛「Node 运行时不支持发布目标:universal-apple-darwin」。

期间 master 上出现过一版过渡实现(targetRuntime('universal-apple-darwin') 按宿主架构返回 arm64):它能骗过通用包自检(check-macos-bundle.mjsprocess.arch 校验),但Intel Mac 上这份 arm64 侧车不可执行,等于把坏包发给 Intel 用户——已发布的 dev-mac 0.1.86 就带着这个缺陷。

本次决策(按需求方指示)

macOS 只出 arm64 单架构,Intel 暂不支持,恢复路径写进文档而不是糊过去。

  • build-macos-ci.mjs 固定 aarch64-apple-darwin:不再编译 x86_64,只跑 arm64 隔离 smoke,首装包命名 <产品名>_<版本>_aarch64.dmg(匹配清单侧单架构分支 _<version>_aarch64.dmg),构建清单记录 smokes 与实际清单平台键。
  • stage-node-runtime.mjstargetRuntime('universal-apple-darwin') 恢复失败关闭并写清原因——通用包必须按架构各带一份同版本运行时(另下载另一架构官方发行版)才能构建,在此之前不得只带宿主架构那一份。
  • 清单侧无需改动:resolveManifestPlatformKeys('aarch64-apple-darwin') 本就只登记 darwin-aarch64resolveReleasePartition 仍写 <channel>-mac,Apple Silicon 客户端照常收到更新;Intel 客户端会「无可用更新」而不是装到坏包。
  • Jenkinsfile 与三份技术/运维文档同步单架构口径;共享记忆补 2026-09-21 决策记录,并把「只带宿主架构的通用包」写进 pitfalls 防复发。

验证

  • node --test apps/ai-game-creator-shell/scripts/*.test.mjs92/92(含:#444 的两个测试 stub 修复、入口必须固定 arm64 目标与 _aarch64.dmg 后缀、universal 目标必须抛错)。
  • npm run check:production-ops / check:encoding / check:doc-index / check:rustfmt、prettier、eslint、git diff --check 全绿。
  • 单架构 staging 是本机可直接验证的路径:宿主 Node 即目标架构,node -e "stageNodeRuntime('aarch64-apple-darwin')" 走既有扁平 game-runtime/node/ 布局(未改 Rust 侧解析)。
  • 端到端(构建 → smoke → DMG → 清单 → 验签 → 上传)由 Jenkins Mac Job 验证。

影响与遗留

  • 构建时间与体积减半:不再编译两个架构、DMG 少一份 ~130 MB 运行时。
  • Intel Mac 用户:dev-mac 不再提供更新(清单无 darwin-x86_64 键),其客户端更新入口的表现需要实测文案;随包 Node 在 Intel 上本来就不可用。
  • Mac 包仍并列携带两套 Codex 原生依赖(只运行 arm64 切片),可按需瘦身,属后续事项。
  • Windows 渠道未动。

#445 的关系

#445 走的是「真正实现 universal 双架构随包 Node」,与本 PR 方向相反。按需求方决定改为单架构后,#445 关闭;那份双架构实现保留在 backup/agc-macos-dualarch-node-runtimefeat/agc-macos-universal-node-runtime)分支,将来恢复 Intel 时可直接取其 staging 部分。

## 背景 Mac 管线连续失败(#7~#13)的根因是:发布目标一直是 `universal-apple-darwin`,而随包 Node 便携运行时取自构建宿主的官方发行版,**官方 Node 没有 universal 发行版**,所以 staging 只能抛「Node 运行时不支持发布目标:universal-apple-darwin」。 期间 master 上出现过一版过渡实现(`targetRuntime('universal-apple-darwin')` 按宿主架构返回 arm64):它能骗过通用包自检(`check-macos-bundle.mjs` 按 `process.arch` 校验),但**Intel Mac 上这份 arm64 侧车不可执行**,等于把坏包发给 Intel 用户——已发布的 dev-mac 0.1.86 就带着这个缺陷。 ## 本次决策(按需求方指示) macOS 只出 **arm64 单架构**,Intel 暂不支持,恢复路径写进文档而不是糊过去。 - `build-macos-ci.mjs` 固定 `aarch64-apple-darwin`:不再编译 x86_64,只跑 arm64 隔离 smoke,首装包命名 `<产品名>_<版本>_aarch64.dmg`(匹配清单侧单架构分支 `_<version>_aarch64.dmg`),构建清单记录 `smokes` 与实际清单平台键。 - `stage-node-runtime.mjs`:`targetRuntime('universal-apple-darwin')` **恢复失败关闭**并写清原因——通用包必须按架构各带一份同版本运行时(另下载另一架构官方发行版)才能构建,在此之前不得只带宿主架构那一份。 - 清单侧无需改动:`resolveManifestPlatformKeys('aarch64-apple-darwin')` 本就只登记 `darwin-aarch64`,`resolveReleasePartition` 仍写 `<channel>-mac`,Apple Silicon 客户端照常收到更新;Intel 客户端会「无可用更新」而不是装到坏包。 - Jenkinsfile 与三份技术/运维文档同步单架构口径;共享记忆补 2026-09-21 决策记录,并把「只带宿主架构的通用包」写进 pitfalls 防复发。 ## 验证 - `node --test apps/ai-game-creator-shell/scripts/*.test.mjs` → **92/92**(含:#444 的两个测试 stub 修复、入口必须固定 arm64 目标与 `_aarch64.dmg` 后缀、universal 目标必须抛错)。 - `npm run check:production-ops` / `check:encoding` / `check:doc-index` / `check:rustfmt`、prettier、eslint、`git diff --check` 全绿。 - 单架构 staging 是本机可直接验证的路径:宿主 Node 即目标架构,`node -e "stageNodeRuntime('aarch64-apple-darwin')"` 走既有扁平 `game-runtime/node/` 布局(未改 Rust 侧解析)。 - 端到端(构建 → smoke → DMG → 清单 → 验签 → 上传)由 Jenkins Mac Job 验证。 ## 影响与遗留 - **构建时间与体积减半**:不再编译两个架构、DMG 少一份 ~130 MB 运行时。 - Intel Mac 用户:dev-mac 不再提供更新(清单无 `darwin-x86_64` 键),其客户端更新入口的表现需要实测文案;随包 Node 在 Intel 上本来就不可用。 - Mac 包仍并列携带两套 Codex 原生依赖(只运行 arm64 切片),可按需瘦身,属后续事项。 - Windows 渠道未动。 ## 与 #445 的关系 #445 走的是「真正实现 universal 双架构随包 Node」,与本 PR 方向相反。按需求方决定改为单架构后,#445 关闭;那份双架构实现保留在 `backup/agc-macos-dualarch-node-runtime`(`feat/agc-macos-universal-node-runtime`)分支,将来恢复 Intel 时可直接取其 staging 部分。
suzmii added 1 commit 2026-09-21 12:31:13 +08:00
macOS 发布改为只出 arm64 单架构
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
e53992fdc2
- build-macos-ci 固定 aarch64-apple-darwin:单架构构建、只跑 arm64 隔离 smoke、首装包命名 <产品名>_<版本>_aarch64.dmg,构建清单记录 smokes 与实际清单平台键
- stage-node-runtime 的 universal-apple-darwin 恢复失败关闭并说明原因:随包 Node 只有单架构官方发行版,按宿主架构放行会让 Intel 上这份侧车不可执行,且通用包自检按 process.arch 校验抓不到
- 守卫用例改为断言入口固定 arm64 目标与 _aarch64.dmg 后缀、universal 目标必须抛错
- Jenkinsfile 与三份技术/运维文档同步单架构口径:清单只登记 darwin-aarch64,Intel 非目标,恢复 universal 的前置条件写在文档里
- 共享记忆补 2026-09-21 决策记录,pitfalls 记下「只带宿主架构的通用包」陷阱,避免再次用过渡实现糊过去
suzmii added 1 commit 2026-09-21 12:35:45 +08:00
同步里程碑计划:macOS 清单只登记 darwin-aarch64
Project CI / AI game creator shell Rust crates (pull_request) Failing after 53s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m3s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Failing after 6m52s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Failing after 7m40s
Project CI / Repository checks (pull_request) Failing after 2m0s
Project CI / Backend tests (pull_request) Successful in 7m42s
Project CI / Native shell tests (pull_request) Successful in 8m47s
Project CI / Frontend tests (pull_request) Successful in 6m54s
Project CI / AI game creator shell web tests (pull_request) Successful in 5m1s
613d62fdb2
- docs/project-memory/plans 的渠道化里程碑仍写着 dev-mac universal 同时写两个平台键,与 2026-09-21 的单架构决策冲突,按当前口径更新并指向决策记录
suzmii merged commit e18067e028 into master 2026-09-21 12:38:04 +08:00
suzmii deleted branch feat/agc-macos-arm64-only 2026-09-21 12:38:04 +08:00
Sign in to join this conversation.