Commit Graph
9 Commits
Author SHA1 Message Date
ZacharyZhang-NY 740d0812ee fix(build): restore package.json if electron-builder leaves it mutated
electron-builder's `extraMetadata` feature mutates the source
package.json in place during packaging and restores it on clean
exit. When the builder is killed mid-flight (parent task timeout,
Ctrl-C, OOM) the restore never fires and the source tree is left
with a stripped scripts block — every subsequent pnpm command
then fails with "Missing script" until someone notices the drift
and runs `git checkout`. Observed once in this session when a
`build:dir` task was cancelled mid-packaging.

Wrap the builder invocation in a bytes-level snapshot + idempotent
restore, driven by both normal-exit and SIGINT/SIGTERM/SIGHUP
handlers. On a clean run the builder's own restore wrote the
original bytes back, our final compare is byte-equal, and the
restore is a no-op. On an abnormal termination the snapshot
overwrites whatever electron-builder left behind so the working
tree is guaranteed clean regardless of exit path.

The snapshot approach is intentional over a "reject if tree dirty
before build" guard: this is a recovery mechanism, not a
precondition, and the repo's own `package.json` is the truth —
anything else in there at the moment the builder took its snapshot
is the desired state.
2026-04-21 01:29:50 -04:00
ZacharyZhang-NY a0be5beeb5 fix(execution-policy): runtime-assert execution mode from DB instead of cast 2026-04-16 23:00:43 -04:00
ZacharyZhang-NY d154b45741 build(build-desktop): remove EBUSY cleanup retry loop, let it crash (P2-21) 2026-04-16 22:54:57 -04:00
ZacharyZhang-NY 67c757f481 update 2026-04-04 12:03:50 -04:00
ZacharyZhang-NY f482f25856 update 2026-03-19 16:29:22 -04:00
ZacharyZhang-NY 0cd65521b8 update 2026-03-18 14:42:14 -04:00
ZacharyZhang-NY 1ba3147ed2 update 2026-03-18 01:15:58 -04:00
ZacharyZhang-NY 7a3db27ffa update 2026-03-17 12:31:06 -04:00
ZacharyZhang-NY 2af82b6bb3 Initialize project and ignore local references 2026-03-15 22:17:07 -04:00