diff --git a/docs/project-memory/shared-memory/pitfalls.md b/docs/project-memory/shared-memory/pitfalls.md index 3e14be3b9..44f2fc940 100644 --- a/docs/project-memory/shared-memory/pitfalls.md +++ b/docs/project-memory/shared-memory/pitfalls.md @@ -1,5 +1,9 @@ # 踩坑与排障记录 +## Jenkins Windows 节点的 PATH 白名单决定 Godot 原生扩展能否构建 + +`Genarrative-Agc-Windows-Build` 在阶段里用 `AGC_WINDOWS_PATH` 整体替换 PATH、不继承节点机器的 PATH,所以 Godot C++ 引导需要的 CMake 与 Python 必须显式写进这份白名单,装在机器 PATH 上并不生效。2026-09-21 的 #97–#99 连续失败都停在 `Get-Command cmake.exe`(#93–#96 是更早的手写 C ABI 在 MSVC C 模式下的对齐问题):节点只有 Visual Studio Build Tools(`C:\BuildTools`)自带的 CMake 3.31,缺 Python 3。修复后白名单包含 `C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin`、`C:\Python312`、`C:\Python312\Scripts`,preflight 校验 CMake ≥3.25、Python 3 和 Visual Studio 17 2022 生成器;把 `cmake.exe` 单独复制到别的目录会丢掉 `share/cmake-*/Modules`,不能替代加入安装目录。 + ## Tauri `--no-sign` 会连带跳过 updater 签名 AGC macOS 发布入口一度传入 `--no-sign`(目的是绕过没有 Apple 证书的代码签名),结果 Tauri 打印 `Warn Updater signing is skipped due to --no-sign flag.`,产物只有 `*​.app.tar.gz` 而没有 `.sig`,发布入口按设计在「缺少更新包签名」处失败关闭(2026-09-20 首次 Jenkins 实跑命中)。正确做法是不传 `--no-sign`,改为剥离 `APPLE_*` 凭据让 Tauri 跳过 Apple 签名——minisign 更新包签名与 Apple 代码签名这两个开关在 Tauri 里并不独立。Apple 签名状态要按 `codesign -dv` 实测记录,不能硬编码。 diff --git a/docs/technical/【技术方案】AGC Godot编辑器插件接入-2026-09-20.md b/docs/technical/【技术方案】AGC Godot编辑器插件接入-2026-09-20.md index 722fcbb55..e75f68c7d 100644 --- a/docs/technical/【技术方案】AGC Godot编辑器插件接入-2026-09-20.md +++ b/docs/technical/【技术方案】AGC Godot编辑器插件接入-2026-09-20.md @@ -34,6 +34,7 @@ DLL 原件随 AGC 安装包放在插件资源目录中;Godot Windows 加载器 ## 分发与描述文件 - 原生引导使用官方 `godot-cpp` 的 C++ 类型和初始化接口,不自行声明 Variant 存储或直接装配 ABI 函数指针。绑定源码固定到 `godot-4.5-stable` 的 `e83fd0904c13356ed1d4c3d09f8bb9132bdc6b77`,以该版本的稳定 API 构建并在 Godot 4.7.2 验证;产品最低版本仍为 4.7,因为嵌入脚本使用该版本能力。Windows x64 构建使用 Visual Studio C++、CMake 和 Python,静态链接绑定及 C++ runtime,用户无需这些构建工具。 +- Jenkins 的 `Genarrative-Agc-Windows-Build` 用 `AGC_WINDOWS_PATH` 整体替换阶段 PATH,因此 Godot 原生扩展所需的 CMake 与 Python 3 必须显式列入该白名单(当前为 Build Tools 自带的 `C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin` 与 `C:\Python312`);Toolchain preflight 校验 CMake ≥3.25、Python 3 和 Visual Studio 17 2022 生成器,缺失即失败关闭。 - 构建仅从已固定的官方归档获取绑定源码,并核对 SHA256;下载和生成内容只进入 `.build/`。CMake 构建包含引导源码、嵌入脚本、绑定版本/归档摘要和构建配置的身份指纹。许可证与来源继续随 DLL 分发,安装包不包含 SDK、源码缓存、生成绑定或构建工具。 - C++ 状态仅在扩展有效期间持有 GDScript 引用和桥节点身份;终止回调先停用仍存活的桥,再释放绑定对象,不能让静态 Godot 对象析构晚于绑定退出。延迟 bootstrap、原生卸载、Node 已退出及同 PID 重连均须实测。受管文件、会话身份、协议、执行回执与不确定阻断沿用现有合同。 - EDITOR 阶段晚加载不会取得 CORE 阶段终止回调;引导终止时须通过官方绑定接口解除 Node/GDScript 的实例包装回调,并完成单例包装清理。只移除 C++ 包装,不同步销毁仍在 GDScript 调用栈或等待 `queue_free` 的引擎对象;先用 Variant 保活脚本,再解除 Ref 和绑定,避免卸载 DLL 后跳到失效回调。 diff --git a/jenkins/Jenkinsfile.ai-game-creator-shell-build b/jenkins/Jenkinsfile.ai-game-creator-shell-build index e36eb3611..b48e5ec1f 100644 --- a/jenkins/Jenkinsfile.ai-game-creator-shell-build +++ b/jenkins/Jenkinsfile.ai-game-creator-shell-build @@ -15,7 +15,7 @@ pipeline { GENARRATIVE_NPM_VERSION = '10.9.7' AGC_OSS_BUCKET = 'agc-dev' AGC_OSS_ENDPOINT = 'oss-rg-china-mainland.aliyuncs.com' - AGC_WINDOWS_PATH = 'C:\\Tools\\Git\\cmd;C:\\Program Files\\nodejs;C:\\Program Files\\dotnet;C:\\Users\\Administrator\\.cargo\\bin;C:\\Tools\\ossutil;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\' + AGC_WINDOWS_PATH = 'C:\\Tools\\Git\\cmd;C:\\Program Files\\nodejs;C:\\Program Files\\dotnet;C:\\Users\\Administrator\\.cargo\\bin;C:\\Tools\\ossutil;C:\\BuildTools\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\CMake\\bin;C:\\Python312;C:\\Python312\\Scripts;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\' } parameters { @@ -82,15 +82,31 @@ pipeline { if ($actualNpm -ne $env:GENARRATIVE_NPM_VERSION) { throw "npm 版本不匹配:期望 $($env:GENARRATIVE_NPM_VERSION),实际 $actualNpm" } - foreach ($commandName in @('node', 'npm', 'rustc', 'cargo', 'dotnet')) { + foreach ($commandName in @('node', 'npm', 'rustc', 'cargo', 'dotnet', 'cmake', 'python')) { if (-not (Get-Command $commandName -ErrorAction SilentlyContinue)) { - throw "Windows AGC 节点缺少 $commandName,请先安装并加入 Jenkins Agent PATH。" + throw "Windows AGC 节点缺少 $commandName,请安装并加入 AGC_WINDOWS_PATH。" } } $dotnetSdks = @(dotnet --list-sdks) if ($LASTEXITCODE -ne 0 -or -not ($dotnetSdks -match '^10[.]')) { throw 'Windows AGC 节点需要 .NET 10 SDK 才能构建 Unity Attach helper。' } + $cmakeVersion = ((cmake --version) | Select-Object -First 1).Trim() + if ($cmakeVersion -notmatch '([0-9]+)[.]([0-9]+)[.]([0-9]+)') { + throw "无法解析 CMake 版本:$cmakeVersion" + } + $cmakeMajor = [int]$Matches[1] + $cmakeMinor = [int]$Matches[2] + if ($cmakeMajor -lt 3 -or ($cmakeMajor -eq 3 -and $cmakeMinor -lt 25)) { + throw "Godot 原生扩展需要 CMake 3.25 及以上,当前:$cmakeVersion" + } + if (-not (@(cmake --help) -match 'Visual Studio 17 2022')) { + throw "Windows AGC 节点缺少 Visual Studio 2022 C++ 生成器,无法构建 Godot 原生扩展。" + } + $pythonVersion = ((python --version 2>&1) | Select-Object -First 1).Trim() + if ($pythonVersion -notmatch '^Python 3[.]') { + throw "Godot 原生扩展需要 Python 3,当前:$pythonVersion" + } $ossutil = ([string]$env:OSSUTIL_BIN).Trim() if (-not $ossutil) { $ossutil = 'ossutil' } if (-not (Get-Command $ossutil -ErrorAction SilentlyContinue)) { @@ -101,6 +117,8 @@ pipeline { Write-Host "rustc=$((rustc --version).Trim())" Write-Host "cargo=$((cargo --version).Trim())" Write-Host "dotnet-sdk=$((dotnet --version).Trim())" + Write-Host "cmake=$cmakeVersion" + Write-Host "python=$pythonVersion" Write-Host "jenkins-user=$([System.Security.Principal.WindowsIdentity]::GetCurrent().Name)" Write-Host "local-app-data=$env:LOCALAPPDATA" $targetTools = Join-Path $PWD 'apps/ai-game-creator-shell/src-tauri/target/.tauri'