Skip to content

Rewatch: preserve warnings after atomic-save full rebuilds#8358

Merged
Bushuo merged 3 commits intorescript-lang:masterfrom
Bushuo:warnings-presist-atomic-saves
Apr 18, 2026
Merged

Rewatch: preserve warnings after atomic-save full rebuilds#8358
Bushuo merged 3 commits intorescript-lang:masterfrom
Bushuo:warnings-presist-atomic-saves

Conversation

@Bushuo
Copy link
Copy Markdown
Collaborator

@Bushuo Bushuo commented Apr 18, 2026

Summary

  • preserve stored compile warnings when watch mode rebuilds full state after atomic-save rename events
  • keep unrelated module warnings in .compiler.log and stderr across those rebuilds
  • add Rust unit tests for the warning carry-forward helper

Related issue #8158

Testing

  • cargo test --manifest-path rewatch/Cargo.toml watcher::tests
  • cargo test --manifest-path rewatch/Cargo.toml
  • rewatch/tests/watch/02-watch-warnings-persist-atomic-save.sh
  • rewatch/tests/watch/02-watch-warnings-persist.sh

Bushuo added 2 commits April 18, 2026 14:25
Add a rewatch integration test that simulates an editor-style atomic save by renaming B.res into place and verifies warnings from ModuleA.res remain in .compiler.log after the rebuild.

Signed-off-by: Paul Kim <paul.bushuo@gmail.com>
Atomic-save rename events force the watcher down the full rebuild path, which was recreating build state and dropping stored warnings for unchanged modules. Carry warning state forward into the new build state so unrelated module warnings continue to be re-emitted.\n\nAlso add unit tests for the warning carry-forward helper.

Signed-off-by: Paul Kim <paul.bushuo@gmail.com>
@Bushuo Bushuo changed the title fix(rewatch): preserve warnings after atomic-save full rebuilds Rewatch: preserve warnings after atomic-save full rebuilds Apr 18, 2026
@Bushuo

This comment was marked as outdated.

@chatgpt-codex-connector

This comment was marked as outdated.

@Bushuo
Copy link
Copy Markdown
Collaborator Author

Bushuo commented Apr 18, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1604e3b57a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread rewatch/src/watcher.rs
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 18, 2026

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@8358

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@8358

@rescript/darwin-x64

npm i https://pkg.pr.new/@rescript/darwin-x64@8358

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@8358

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@8358

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@8358

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@8358

commit: a5f664c

@Bushuo Bushuo requested review from cknitt and jfrolich April 18, 2026 14:14
Copy link
Copy Markdown
Member

@rolandpeelen rolandpeelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@Bushuo Bushuo merged commit b737ad5 into rescript-lang:master Apr 18, 2026
26 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.

2 participants