Repository navigation
Skip watch rebuilds for files whose content didn't change - #9305
Conversation
Why:
macOS can report one write twice, the second time after the 50 ms
drain window. The native watch loop re-read the file and rebuilt even
when nothing differed from its snapshot, so a parse error was printed
twice. This made the quiet-watch case of check_command_validation.sh
fail on macOS in about 4% of CI runs. The test's filter for repeated
reports had stopped working with the new report format in #9238.
Diagnostic modified (repeated content event in watch mode):
Example:
let value =
Before (diagnostic): rescript watch --quiet after one save on macOS
Syntax error!
<ROOT>/src/A.res:1:12-2:0
…
This let-binding misses an expression
Syntax error!
<ROOT>/src/A.res:1:12-2:0
…
This let-binding misses an expression
After (diagnostic):
Syntax error!
<ROOT>/src/A.res:1:12-2:0
…
This let-binding misses an expression
Review: Does a read error still rebuild? Yes. update_entries counts a
kept entry as a change, as before, so the build reports the problem.
Review: Does touching a file still rebuild? Yes. The entry holds the
modification time, as in the polling loop, so only an event for a file
that is exactly as the snapshot recorded it is skipped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gG8vKzkJGrU7AZ1CXQ
Signed-off-by: Christoph Knittel <ck@cca.io>
Changelog🐛 Bug fix
Semantic Diff1 commit · Full page Skip watch rebuilds for files whose content didn't changeb5f76a2 · cknitt + Claude · Nov 14, 2026, 10:14 UTC
Diagnostic modified (repeated content event in watch mode) let value =
Syntax error!
<ROOT>/src/A.res:1:12-2:0
…
This let-binding misses an expression
Syntax error!
<ROOT>/src/A.res:1:12-2:0
…
This let-binding misses an expression
Review
|
✅ Compiler benchmarksAllocated wordsIn total: 640,949,305 → 640,950,354 (±0.00%). Generated projects: 920,892,047 → 920,892,290 (±0.00%). None of the 265 benchmarks changed by 0.1% or more. InstructionsIn total: 9,209,713,865 → 9,209,713,865 (±0.00%). None of the 33 benchmarks changed by 0.1% or more. Output sizeIn total: 25,843,406 → 25,843,406 (±0.00%). None of the 13 benchmarks changed by 0.1% or more. Pull request b5f76a2 compared with base 1efa212 in this run. |
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-9305 |
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The macOS leg of CI fails "Run rewatch snapshot tests" now and then (11 first attempts since 2026-11-08). Each time it's the
quiet-watchcase inrewatch-ocaml/tests/check_command_validation.sh: the same parse error is printed twice.There are two causes:
native_loopinwatcher.mlre-read the file and rebuilt even when it matched the snapshot, so the error was printed again.update_entriesnow says whether anything differs (Unchanged,Updated,Not_in_snapshot), and the loop skips the build when nothing does. The polling and reconcile paths already did this. A file that can't be read still counts as changed, so its build still runs and reports the problem.Syntax error!. Since Remove the Rust build system #9238 each report starts with a blank line, so the copies differed by one newline and were never merged. The split now goes before that blank line, and it also works with CRLF output.New unit tests in
watcher_tests.ml: re-reading an unchanged file returnsUnchanged, before and after an update.🤖 Generated with Claude Code
https://claude.ai/code/session_01Kbf3gG8vKzkJGrU7AZ1CXQ