Skip to content

fork(#48): watch the dev-rebuild signal file by its real path (macOS, slice 13) - #76

Merged
nachumi-a2zoperations merged 1 commit into
blowzer/fork-onlyfrom
fix/48-dev-rebuild-real-paths
Nov 17, 2026
Merged

nachumi-a2zoperations merged 1 commit into
blowzer/fork-onlyfrom
fix/48-dev-rebuild-real-paths

Conversation

@nachumi-a2zoperations

Copy link
Copy Markdown

Refs #48 (slice 13). One line of build-plugin code, no test change.

Cause

  • config/build-plugins/process-host-dev-rebuild.ts signals "a process-host source file was created" by rewriting a file in a mkdtempSync(tmpdir()) directory and handing it to rolldown's addWatchFile.
  • On macOS that directory is reached through a symlink: /var/folders/… normally, /tmp/<id> under the test runner. Both point into /private.
  • rolldown 1.2.14's watcher never reports a file watched through a symlinked path; it does for the real path. A standalone probe (one addWatchFile file, edit it, count rebuilds): /tmp 0, /var/folders/…/T 0, /private/tmp 1.
  • So on a Mac, creating a process-host source file does not reach a running dev build, and process-host-dev-rebuild.test.ts times out ("Timed out waiting for ERROR"). Linux has no symlink there and passes.

Fix

signalDirectory = realpathSync(mkdtempSync(...)). Everything else the plugin watches already arrives as real paths: resolving the root as well changed nothing (tried, dropped).

Evidence (MacBook, Node 24.22.1, rolldown 1.2.14)

  • process-host-dev-rebuild.test.ts: 4/4 failed before; 4/4 pass after, two runs. With only this line reverted, 2 fail.
  • check:changed --base=origin/blowzer/fork-only: 12/12.

Where #48 stands (re-measured today at fork-only a10cd4e6)

  • Dell (Linux, idle): the 113 listed files: 564 passed, 12 skipped, 0 failed.
  • MacBook: 108/113 in one parallel run. Of the 5, four pass alone with --maxWorkers=1 (cross-version checkout lock contention, a 120 s and a 30 s timeout, the known-flaky browser-extension test). The fifth is this file.

The plugin is identical on upstream main, so the same macOS gap exists upstream. Filing it there is the owner's call.

… slice 13)

The process-host dev-rebuild plugin signals a new source file by rewriting a
file in a temp directory that it hands to rolldown's addWatchFile. On macOS
the temp directory is reached through a symlink (/var/folders, or /tmp under
the test runner), and rolldown's watcher never reports a file watched by a
symlinked path: no rebuild follows, and creating a process-host source file
does not reach a running dev build. Resolve the signal directory to its real
path.

process-host-dev-rebuild.test.ts: 4/4 failed on macOS before ("Timed out
waiting for ERROR"), 4/4 pass after; Linux is unaffected (no symlink). The
plugin is the same on upstream main.

Refs #48

Signed-off-by: Nachumi Eliyahu <[email protected]>
@nachumi-a2zoperations
nachumi-a2zoperations merged commit 3e9098c into blowzer/fork-only Nov 17, 2026
2 checks passed
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