chore(build): bun 统一升级到 1.4.2 - #1301
Merged
Merged
Conversation
把仓库里所有「当前使用的 bun 版本」从 1.4.1 提到 1.4.2: package.json 的 packageManager、ci.yml/release.yml 里 6 处 setup-bun 的 bun-version、musl 腿的 npm i -g bun(setup-bun 不 支持 musl),以及 scripts/build-linux-glibc-baseline.sh。 darwin 签名相关的历史实测记录一律不动(1.4.0 写坏签名、1.4.1 只修了 host arch),那些是历史事实不是当前状态。但两处「别把 『我们已经在 1.4.1 了』读成『已经修好了』」的警告改写成 1.4.2, 否则升完版这条警告就指不到读者眼前的版本了;同时补上本次的 复测数据。 test/release-darwin-codesign-gate.test.ts 的 FIRST_GOOD_BUN 故意 保持 1.4.1:它是下限不是 pin,跟着一起改会让断言退化成「pin 等于 pin」的同义反复。 实测(本机 bun 1.4.2): - bun.lock 不需要重新生成:--frozen-lockfile 干净副本 dry-run rc=0, sha256 前后一致;真实 install 698 包 rc=0,node-pty 的 pty.node 正常编出,锁文件零改动 - 升级前 19 条断言红(expected '1.4.2' to be '1.4.1'),升级后全绿 - 版本一致性闸 31/31;三枪变异(workflow pin / musl npm pin / glibc 脚本 pin 各漂一处)全部转红,证明三个载体都真的被守住 - bun run build 绿;bun test 直跑 50/50;bun run verify:binary 编译 态 8 项 smoke 全绿(含 self-spawn / dashboard / PTY) - vitest --project unit 全量 11 条红,与干净 master 同环境对照后 确认逐条同源:其中 9 条 baseline 逐个用例一模一样(bwrap 沙箱相关), 另 2 条是满载下的时序抖动(3000ms 预算实测 3066ms),单独跑即绿; 5 个红文件与 master 逐字节相同且都不读这个 pin darwin 交叉编译的 x64 签名缺陷 1.4.2 仍未修(本地解析 CodeDirectory 复测,并用 1.4.0 做对照确认判据能区分版本): 1.4.0 → arm64 INVALID(1/15483) x64 INVALID(2/17124) 1.4.2 → arm64 VALID(15075/15075) x64 INVALID(2/16792,含 slot 0) 所以 build-bun-binary.mjs 里的 codesign 重签步骤依然是承重的,不能删。
deepcoldy
force-pushed
the
wt/bun-1-4-2
branch
from
September 7, 2026 12:32
e2d0198 to
1e9d3c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么
把仓库里所有「当前使用的 bun 版本」从 1.4.1 提到 1.4.2,共 10 处可执行 pin:
package.json的packageManagerci.yml/release.yml的setup-bunbun-versionnpm i -g bun@(setup-bun 不支持 musl,只能走 npm)scripts/build-linux-glibc-baseline.sh的npm install -g bun@外加描述「当前 pin」的文档/注释:
CLAUDE.md、CONTRIBUTING.md、src/utils/local-dev-update.ts。为什么这么改
历史实测记录一律不动。 darwin 签名那几段(1.4.0 写坏签名、1.4.1 只修了 host arch)记的是历史事实,不是当前状态,改了就是伪造实测。
但有两处例外必须跟着走:
build-bun-binary.mjs和 gate 测试里那句「别把『我们已经在 1.4.1 了』读成『已经修好了』」——升完版读者眼前就是 1.4.2,警告指着一个没人会读到的版本号就失效了。所以这两处改成 1.4.2,并补上本次复测数据。FIRST_GOOD_BUN故意保持 1.4.1:它是「首个带 darwin 签名修复的版本」这个下限,不是 pin。跟着一起改会让断言退化成「pin == pin」的同义反复,就再也测不出「pin 是否带着修复」了。已在注释里写明这是有意为之。影响面
改的是构建工具链版本,不是运行时代码,也不改任何依赖版本。受影响的是 CI 全部 job(build / bun-test / 三条 binary 腿 / release 全流程)与本地开发链路;不涉及具体 CLI 适配器、后端或会话类型。
bun.lock未重新生成——1.4.2 完全接受现有 lockfileVersion 2(下面有实测)。实测验证
均在本机 bun 1.4.2 下跑。worktree 内没有跑过 install,隔离验证都在
/tmp副本里做。锁文件兼容性(这项不过关的话 CI 每个 job 都会红)
升级前 → 升级后(同一批断言)
(这批断言把
Bun.version和packageManager对齐,所以本次改动是可观测的,不是空改。)版本一致性闸 + 反变异
构建 / 运行时 / 编译态
全量 unit(含红项归因)
11 条红全部与本改动无关,逐条对照过:
diff判定 IDENTICAL),是本机 bwrap 沙箱相关的既有失败。stops reading slow partial stdin3000ms 预算实测跑了 3066ms),单独跑即绿。origin/master逐字节相同,且都不读这个 pin。plugin-mcp-sandbox的 skip 条件是existsSync('dist/cli.js')——/tmp里的 baseline 是git archive导出的,没有dist/所以整个文件被跳过了。给 baseline 补跑bun run build之后两边才对得上。仓库里原本就写着「别以为升级 bun 就能删掉重签步骤」。既然这次真的升了版,我把它重测了一遍,而不是照抄旧结论:从 linux 交叉编译一个两行 hello-world,解析 CodeDirectory 重算 page hash(不需要 macOS),并用 1.4.0 做对照确认这个判据能区分版本:
arm64 那格从 INVALID 变 VALID,说明判据确实在区分版本、不是恒定输出;x64 交叉编译那格和 1.4.1 时代记录的形态一模一样,依旧是坏的。
结论:
build-bun-binary.mjs里的codesign --force --sign -重签步骤仍然是承重的,谁都别因为「我们已经升到 1.4.2 了」把它删掉。这个结论已写进代码注释。(旧注释里还提到 x64 有 ~25MB 落在签名范围外,我这两次构建都没复现出来(gap 均为 0)。我新增的文字只陈述自己直接测到的 page-hash 判定,没有沿用那个 gap 数字。)