AGC macOS universal 随包 Node 双架构运行时(修复 Mac 管线 #7 起连续失败) #445
Closed
suzmii
wants to merge 3 commits from
feat/agc-macos-universal-node-runtime into master
pull from: feat/agc-macos-universal-node-runtime
merge into: GenarrativeAI:master
GenarrativeAI:master
GenarrativeAI:feat/design-upload-docs
GenarrativeAI:feat/gptimage2to2.5
GenarrativeAI:refactor/split-direct-project
GenarrativeAI:feat/log-the-dianosis
GenarrativeAI:feat/agc_track
GenarrativeAI:codex/agc-godot-templates-20260921
GenarrativeAI:codex/agc-channel-install-identity
GenarrativeAI:backup/agc-macos-dualarch-node-runtime
GenarrativeAI:fix/agc-acceptance-followup
GenarrativeAI:codex/game-distribution
GenarrativeAI:codex/godot-editor-plugin-20260920
GenarrativeAI:codex/agc-project-upload-download
GenarrativeAI:feat/tribo3d-integeration
GenarrativeAI:feat/agc-organize-assetkind
GenarrativeAI:feat/mac-universal-package
GenarrativeAI:feat/ui-editor-v3
GenarrativeAI:fix/ref-persistent
GenarrativeAI:feat/more-ref
GenarrativeAI:feat/bgfilter-api
GenarrativeAI:fix/ci
GenarrativeAI:codex/platform-session-identity-credential-split
GenarrativeAI:fix/chat-state
GenarrativeAI:feat/Crt_Ws
GenarrativeAI:codex/fix-model-refresh
GenarrativeAI:feat/smart-ref-ui-res
GenarrativeAI:codex/preview-llm-router-config
GenarrativeAI:fix/stroke-width-regression-from-285
GenarrativeAI:agent-organize
GenarrativeAI:feat/expose-image2edit
GenarrativeAI:feat/game-agent-canvas-resource-workbench-v2
GenarrativeAI:feat/agc-new-workflow
GenarrativeAI:fix/agc-release-version-sync
GenarrativeAI:codex/shared-components-followup
GenarrativeAI:codex/agc-runtime-generation-reliability
GenarrativeAI:codex/game-agent-runtime-interaction-design
GenarrativeAI:feat/spine-sequence-export-v2
GenarrativeAI:codex/agc-platform-account-editor-api
GenarrativeAI:codex/game-agent-run
GenarrativeAI:codex/ui-spritesheet-durable-transaction-latest
GenarrativeAI:feat/art-agent-more-tools
GenarrativeAI:codex/editor-canvas-null-source-repair
GenarrativeAI:hotfix/editor-layout-2mib
GenarrativeAI:codex/showcase
No Reviewers
Labels
Clear labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Low
4
The priority is low
Priority
Medium
3
The priority is medium
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: GenarrativeAI/Genarrative#445
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "feat/agc-macos-universal-node-runtime"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
Genarrative-Agc-MacOS-Build从 build #7 起连续失败(#7 8 分钟、#8~#10 2 分钟):#439 引入随包 Node 运行时 staging 后,runTauriBuild默认按宿主平台取材(darwin/arm64),而发布目标是 Windows,直接抛「Node 运行时平台/架构与发布目标不一致」。更关键的是:Mac 管线一直按universal-apple-darwin构建,而 staging 根本不认识 universal——stageNodeRuntime('universal-apple-darwin')会抛「Node 运行时不支持发布目标」,即使跳过测试也是死路;此前 build #6 之所以成功,是因为它检出的 commit 早于 #439。方案(方案 A)
真正实现 universal 的随包 Node 支持:按架构各带一份官方运行时,而不是让 Mac 包少带或不带。
stage-node-runtime.mjstargetRuntimes:universal-apple-darwin展开为aarch64-apple-darwin+x86_64-apple-darwin,其余目标仍是一份。runtimeSourceForTarget:宿主架构取当前构建 Node(process.execPath),非宿主架构必须由构建节点用AGC_NODE_RUNTIME_<PLATFORM>_<ARCH>_PATH显式提供,缺失即失败关闭——不静默跳过、不回退系统 Node、不从项目或相对 PATH 借运行时。stageNodeRuntime拆成inspectRuntimeSource(只读校验)+writeRuntimeBundle(落盘),stageNodeRuntimeForTarget先校验全部来源再逐个落盘:缺一份、架构不符、两套版本不一致都在写出任何资源目录之前失败,不留下半套运行时冒充发布内容。node-runtime/(行为不变),universal 写node-runtime/<platform>-<arch>/,与捆绑 Codex 的分架构目录同形态。build-release.mjs:默认stageRuntime改为按发布目标 stage。environment_check.rs:resolve_at在既有扁平目录之后按当前运行架构查找<platform>-<arch>子目录;两个候选都要过清单的平台/架构校验,存在但损坏一律失败关闭,绝不退回系统 Node。单架构包与开发态行为不变。check-macos-bundle.mjs:两份切片的清单完整性、文件集合、许可、lipo -archs架构与目录名一致性全部核对;只执行与当次 smoke 架构一致的那一份(另一份由另一次 smoke 覆盖);资源扫描放行两种 node_modules 布局。AGC_NODE_RUNTIME_DARWIN_X64_HOME(默认~/Library/Jenkins/node/darwin-x64)声明另一架构来源,Toolchain 阶段在编译前核对存在性与同版本,Package 阶段导出..._PATH/..._LICENSE_PATH。lipo/arch核对命令)、同版本要求、按架构布局、Rust 侧选择规则与约 260 MB 解包体积代价;实施计划与更新检查方案同步该契约。验证
node --test apps/ai-game-creator-shell/scripts/*.test.mjs→ 95/95(新增 3 个:双架构 staging 与清单、缺非宿主运行时失败关闭且不留半成品、两套版本不一致报错且不落盘)。TMPDIR=/private/tmp cargo test --locked --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml --bin genarrative-ai-game-creator-shell environment_check::→ 16 passed(含新增用例:按运行架构解析 universal 目录、另一架构目录损坏/缺失都不影响本架构选择)。v22.23.2/ npm10.9.8的独立清单。npm run check:encoding/check:doc-index/check:production-ops/check:rustfmt、prettier、eslint、git diff --check全部通过。依赖
本分支基于
fix/agc-test-node-runtime-stub(#444,同一原因的另一半:非 Windows 主机上发布测试未 stub staging)。#444 合并后本 PR 的 diff 只剩双架构运行时改造;即使 #444 未合并,本分支自身也包含该修复,不依赖外部合并顺序。不做
Windows 侧不改(本机 CI 缺 CMake 是既存问题,与本次改动无关);Apple 签名与公证仍缺,本次不涉及。
Pull request closed