Skip to content

fix(build): 修复 CI 编译原生模块失败(旧版 node-gyp 找不到 VS 2022) - #10

Merged
Aparencia merged 1 commit into
mainfrom
dev
Jul 31, 2026
Merged

Aparencia merged 1 commit into
mainfrom
dev

Conversation

@Aparencia

Copy link
Copy Markdown
Owner

问题

v0.30.0 发版时 CI 的
ative:build\ 在 8 秒内失败:

\
Error: Could not find any Visual Studio installation to use
at VisualStudioFinder.findVisualStudio2013 (client/node_modules/node-gyp/...)
\\

electron-rebuild 用的是 client 下的旧版 node-gyp,VS 探测逻辑仍在找 VS 2013/2015,无法识别 windows-latest 上的 VS 2022。因该步骤配了 \continue-on-error\,发布流水线全绿、v0.30.0 正常发出,但安装包静默缺少原生模块(运行时自动降级为端点环回,功能未损坏但新特性未生效)。

修复

不只改 CI,而是让本地与 CI 共用同一构建入口,消除两套隐式前提:

  • 新增 \client/native/process-audio/build.mjs\:固定用 addon 目录自带的新版 node-gyp(支持 VS 2022),从 client 实际安装解析 Electron 版本,显式传 --target/--dist-url\ 保证按 Electron ABI 编译

  • ative:build\ 指向该脚本,CI 与本地命令完全一致

本地验证:识别到 Electron 35.7.5,编译通过。本 PR 的 CI 运行本身即为该修复的验证。

沉淀

这是第三次「本地能跑 CI 挂」(前两次:Git LFS 指针未拉取、.env.production\ 被 gitignore),共同规律是本地存在而 CI 不具备的隐式前提。已记入知识卡片,并总结出 \continue-on-error\ 必须配套产物检查告警的教训。

v0.30.0 的 CI 中 native:build 在 8 秒内失败:electron-rebuild 用的是 client
下的旧版 node-gyp,其 VS 探测逻辑仍在找 VS 2013/2015,在 windows-latest 报
'Could not find any Visual Studio installation'。因该步骤 continue-on-error,
发布流水线全绿但产物静默缺少原生模块(自动降级为端点环回)。

不只改 CI,而是让本地与 CI 共用同一构建入口,避免两套隐式前提:
- 新增 native/process-audio/build.mjs:固定使用 addon 目录自带的新版
  node-gyp(支持 VS 2022),从 client 实际安装解析 Electron 版本,
  显式传 --target/--dist-url 保证按 Electron ABI 编译
- native:build 指向该脚本;CI 与本地命令一致

本地验证:识别到 Electron 35.7.5,编译通过。

沉淀知识卡片:这是第三次'本地能跑 CI 挂'(前两次为 Git LFS 指针、
.env.production 被 gitignore),共同规律是本地存在而 CI 不具备的隐式前提。
@Aparencia
Aparencia merged commit 61407cf into main Jul 31, 2026
5 checks passed
@Aparencia

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 0.30.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Aparencia added a commit that referenced this pull request Aug 4, 2026
- #5: Gemini generate_stream iteration moved into thread pool via
  asyncio.to_thread, unblocking the event loop during streaming
- #6: providers return real input/output token split; fallback cost
  tracking prefers it and falls back to 60/40 estimate instead of
  the misleading 50/50 split (output priced 2-3x higher)
- #7: balance queries use Key pool primary key (plural env vars),
  DeepSeek balance no longer silently skipped
- #8: JWKS fetch distinguishes network failures (stale cache reuse
  with 60s retry backoff) from HTTP/key errors (fail-closed),
  preventing whole-site 401 on transient Supabase hiccups
- #9: import_concept registered in TIMEOUT_CONFIG/RATE_LIMITS plus
  startup validation warning for unregistered features
- #10: error_pattern cache key includes user_id and hashes full
  content, preventing cross-user result reuse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant