Skip to content

fix(release): ship BinaryDelta in macOS bundles so delta updates actually run#43

Merged
Wangnov merged 1 commit into
mainfrom
fix/vendor-binary-delta-release
Jun 10, 2026
Merged

fix(release): ship BinaryDelta in macOS bundles so delta updates actually run#43
Wangnov merged 1 commit into
mainfrom
fix/vendor-binary-delta-release

Conversation

@Wangnov

@Wangnov Wangnov commented Jun 10, 2026

Copy link
Copy Markdown
Owner

问题

用户在 macOS 上更新 Codex 时,UI 显示「增量更新约 40MB」,实际却下载了 ~428MB 全量包。

根因src-tauri/resources/BinaryDelta 被 .gitignore 排除(设计如此,应由 scripts/vendor-binary-delta.sh 在构建时获取),但 release.yml 从未调用该脚本。因此所有已发布的 .app 都缺这个 helper,resolve_binary_delta() 返回 Noneperform_macos_update() 静默走「delta 工具缺失,回退全量」分支——计划阶段承诺 40MB,执行阶段下了 428MB。

修复

  • release.yml:macOS matrix 在 tauri build 前运行 scripts/vendor-binary-delta.sh(SHA-256 双重锁定的 Sparkle 2.9.1 universal 二进制)。
  • release.yml:build 后新增回归闸——bundle 内缺少可执行 universal BinaryDelta 则 fail。没有这道闸,丢失 helper 是不可见的(更新照样成功,只是永远全量)。
  • examples/mac_delta_e2e.rs:真机 delta E2E harness(CAM_MAC_DELTA_E2E=1 门禁),走完整生产路径 plan → perform。

签名链无需改动:sign-macos-app.sh 本就 inside-out 签所有嵌套 Mach-O(包括 BinaryDelta)。

真机验证(本机 arm64)

  1. Harness E2E:降级到 build 3685 → cargo run --example mac_delta_e2e → 下载恰好 40,408,266 B delta(省 90.6%),EdDSA + codesign 闸全绿,原子替换至 3722,无回退。
  2. 打包断言:本地 tauri build 产物含可执行 universal BinaryDelta(与新 CI 闸同款检查)。
  3. GUI 验收:将含 BinaryDelta 的 0.1.12 包替换本机 manager,再次降级到 3685,通过真实 UI 完成更新——8 秒完成(delta 缓存命中 + apply),staging 的全量解压目录 mtime 未变,证明全量路径未运行。

codex review --uncommitted 无意见;cargo clippy --workspace --all-targets -- -D warningscargo test --workspace 本地通过(与 CI 同款命令)。

…ally run

Root cause: src-tauri/resources/BinaryDelta is gitignored (by design — it is
a build artifact fetched by scripts/vendor-binary-delta.sh), but release.yml
never ran the vendor script. Every released .app therefore lacked the helper,
resolve_binary_delta() returned None, and perform_macos_update() silently fell
back to the full ~400MB package on every "delta" update — the UI promised
~40MB and the wire carried ~428MB.

- release.yml: vendor the pinned Sparkle 2.9.1 BinaryDelta before `tauri
  build` on the macOS matrix (sha256-pinned tarball + binary, universal).
- release.yml: post-build regression gate — fail the release if the bundle
  does not carry an executable universal BinaryDelta, because losing it is
  otherwise invisible (updates still succeed, just always full-size).
- examples/mac_delta_e2e.rs: real-device delta E2E harness (CAM_MAC_DELTA_E2E=1
  gated). Verified on a live install: build 3685 → 3722 via the 40,408,266 B
  delta (90.6% saved), EdDSA + codesign gates green, no full-package fallback.

The signing side needed no change: sign-macos-app.sh already signs nested
Mach-O helpers inside-out before the outer app.
@Wangnov Wangnov merged commit 7e34281 into main Jun 10, 2026
3 checks passed
@Wangnov Wangnov deleted the fix/vendor-binary-delta-release branch June 10, 2026 04:06
Wangnov added a commit that referenced this pull request Jun 10, 2026
Ships #43 (vendor Sparkle BinaryDelta so macOS delta updates actually run), #44 (surface Codex's quit-confirm dialog instead of stalling), #45 (single-snapshot update card + stale-expectation auto-recovery).
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