The active packages/build FileWatcher emits a Deleted event on every poll after a watched file disappears. IncrementalBuilder consumes every event as a rebuild trigger, so one deletion can cause repeated rebuilds. The watcher also has a Created event kind but did not emit it when that file reappeared. This is separate from native Bun FSWatcher (#433). Acceptance: an initially present file has no event; deletion emits exactly one Deleted; subsequent absent polls emit none; recreation emits exactly one Created; subsequent changes emit Modified; failed event allocation leaves state retryable; the full shipped build-package tests pass on the Pantry-pinned Zig and Zig 0.18 in Debug and ReleaseFast under the existing 3,840 MB guard. Related to the build-package migration gate in #884.
fix(build): emit one file-watcher event per filesystem transition
#907Pushed 592bbe4 directly to origin/main as glennmichael123, with exactly three changed files and no coauthors. A deterministic test first failed on the second absent-file poll: the watcher had queued a second Deleted event. The fix records presence transitions only after the event is successfully queued, emits Created once on reappearance, and includes Created in dependent-module invalidation. A two-point failing-allocator test proves a failed deletion enqueue is retried. Final full build-package test step: 35/35 on pinned Zig 0.17 and Zig 0.18.0-dev.146, each in Debug and ReleaseFast; all runs used one process at a time under the unchanged 3,840 MB guard. The shipped ReleaseFast check passed 4/4 steps on both compilers. Both Zig fmt checks, git diff check, and targeted Pickier passed. This closes the build-package watcher behavior; native Bun FSWatcher #433 and broader Zig migration #884 are separate.
Sign in to comment on this issue.