Skip to content

fix(watch): avoid duplicate diagnostics for eager RPC builds - #16491

Closed
Alizter wants to merge 1 commit into
ocaml:mainfrom
Alizter:push-ryqmtvprvvyl
Closed

Alizter wants to merge 1 commit into
ocaml:mainfrom
Alizter:push-ryqmtvprvvyl

Conversation

@Alizter

@Alizter Alizter commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator

Deduplicate diagnostics when eager watch builds handle forwarded RPC requests.

Fixes #15609.

An eager watcher evaluates its sticky goal alongside incoming RPC
goals in a single build request. Since ocaml#15191 each goal ran under its
own Memo.run_with_error_handler, and Memo delivers every error to
every live handler, so an error observed by several goals through a
shared dependency was reported once per goal.

Split the Memo API into Memo.with_error_handler, which establishes the
per-run error reporting scope with its deduplication, and
Memo.run_and_collect_errors, which evaluates one goal within that
scope and returns its errors as a set. The build system installs a
single scope per run and unions the per-goal error sets, so a shared
error is reported once on the console, once in the error state, and
once in the deterministic end-of-build report.

Fixes ocaml#15609

Signed-off-by: Ali Caglayan <[email protected]>
@Alizter
Alizter requested a review from rgrinberg September 27, 2026 13:30
@Alizter
Alizter marked this pull request as ready for review September 27, 2026 13:31
@rgrinberg

Copy link
Copy Markdown
Member

I think we need a fix that doesn't raise the errors twice in the first place

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.

dune build over RPC reports diagnostics twice

2 participants