Skip to content

发版:Windows x64 暂用原版 Electron,解除 0.2.13 的阻塞 - #9

Merged
echoVic merged 3 commits into
mainfrom
release/v0.2.13-windows-stock
Nov 22, 2026
Merged

echoVic merged 3 commits into
mainfrom
release/v0.2.13-windows-stock

Conversation

@echoVic

@echoVic echoVic commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

摘要 / Summary

0.2.13 的发版门要求每个平台都有通过验收的自编译 Electron。macOS arm64、macOS x64、Linux x64 已有,Windows 的从源码构建一直没能完成(托管机 4 核、单任务 6 小时上限),三个平台因此都发不出去。

这次改动只放开 Windows x64:

  • runtime/electron/packaging.mjs 新增 stockTargets,目前只有 win32-x64。产物目录里没有 win32-x64 时,钩子不设置 electronDist 并打印警告,electron-builder 按锁定版本打包 npm 的 Electron。
  • 只要提供了 win32-x64 目录,仍然完整校验并使用;未验收或不完整的会让打包失败,不会回退到原版。其它平台缺少原生产物时照旧失败。
  • release.yml 的解包步骤在 macOS / Linux 上改用 python3,与钩子使用的解释器名一致。
  • 新增 .gitattributes,把原生补丁标成不做换行转换。Windows 托管机检出时会把它改成 CRLF,字节就和 build-lock.json 里的 SHA-256 对不上;这是第一次演练在 Windows 上失败的原因,Windows 原生包将来也会撞上。
  • 更新日志写明:Windows 这一版可以导入扩展,但用户脚本(篡改猴)不能运行;并给 0.2.13 标上日期。

The 0.2.13 release gate required an accepted native Electron for every target. macOS arm64, macOS x64 and Linux x64 have one; the Windows from-source build has not completed, which blocked all three platforms. The packaging hook now lists win32-x64 as a stock target: with no win32-x64 runtime supplied it packages the npm Electron at the locked version and warns. A supplied Windows runtime is still verified and used, and an unaccepted or incomplete one fails packaging. Every other target still fails without its native artifacts. A new .gitattributes keeps the native patch byte-identical on Windows checkouts, which otherwise rewrite it with CRLF and break its locked SHA-256. The changelog states that userscripts do not run on Windows in this release.

测试 / Testing

  • pnpm typecheck、pnpm lint、pnpm format:check、pnpm test(159 个文件,2229 个用例通过)。
  • 新用例先失败后通过,包括一个在本机复现 CRLF 检出导致哈希不符的用例。另外做了三次变异检查(把 Linux 加进原版名单、把“已提供”改成只看 receipt.json、无视已提供的运行时),对应的守卫用例都会失败。
  • 用新钩子校验本机三份已验收的真实运行时并装成发版包(SHA-256 0b9c9316…a72a52,已发布为 native-electron-v43.7.9-953989e2244d)。
  • 在本分支手动触发了两次不发布的 Release workflow:
    • 第一次(dc9227d):Linux 用原生包打包成功;macOS 两个架构都用原生包,签名和公证成功;Windows 以 patch SHA-256 mismatch 失败。
    • 第二次(46b9da2,加了 .gitattributes):Windows 打印原版警告后用 Electron 43.7.9 打出 NSIS 安装包;Linux 再次成功。macOS 任务与第一次重复,已取消。

在以下平台测试过 / Tested on:

  • macOS(arm64 / x64):本机 arm64 跑检查;托管机上打包、签名、公证
  • Windows:托管机上打包(原版 Electron)
  • Linux:托管机上打包(原生包)
  • 其他 / Other:

AI 使用声明 / AI disclosure

  • 工具与模型 / Tool and model: Claude Code(T3 Code),Claude Fable 5.2(claude-fable-5-2)
  • 用在了 / Used for: 代码、测试、文档和这段描述 / the code, the tests, the docs and this description
  • 有人逐行读过这次改动,并能解释清楚。 / A human read every line of this change and can explain it.

…ative runtime

The release gate required an accepted native Electron runtime for every
target. macOS arm64, macOS x64 and Linux x64 have one; the Windows build has
not completed, which blocked 0.2.13 on every platform.

The packaging hook now lists win32-x64 as a stock target. With no win32-x64
runtime in the artifacts directory it leaves electronDist unset, warns, and
electron-builder packages the npm Electron at the locked version. A supplied
win32-x64 runtime is still verified and used, and an unaccepted or incomplete
one fails packaging instead of falling back. Every other target still fails
without its native artifacts.

The fetch step now runs the bundle extraction with python3 on macOS and
Linux, the same interpreter names the hook uses.

On Windows this release imports extensions but cannot run userscripts; the
changelog says so.
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 41a8a600-d372-45ad-b41f-cd51c7b5dfe1
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

The release rehearsal failed on Windows with "patch SHA-256 mismatch". The
Windows runner checks out with core.autocrlf=true, which rewrote the patch
with CRLF line endings, so its bytes no longer matched patchSha256 in
build-lock.json. ci.yml turns the conversion off; release.yml does not, so
a native Windows runtime would have failed the same way.

Mark the patch -text so no checkout converts it.
@echoVic
echoVic merged commit bf16098 into main Nov 22, 2026
7 of 8 checks passed
@echoVic
echoVic deleted the release/v0.2.13-windows-stock branch November 22, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant