| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
💡 Codex Reviewrescript/rewatch/src/watcher.rs Lines 589 to 593 in 2c247a8 This new startup path performs an initial compile inside start, but async_watch still begins with needs_compile_type = CompileType::Incremental, so watch mode compiles twice on launch (initial + immediate incremental with no file change). That doubles startup work and can run --after-build twice before any edit, which is a behavior regression for all watch sessions. rescript/rewatch/src/watcher.rs Lines 598 to 600 in 2c247a8 finish_successful_watch_compile is invoked while still inside with_build_lock during startup, and that helper executes cmd::run(after_build). If the hook launches another ReScript build command, it will contend on build.lock while the parent still holds it, causing a wait/timeout cycle instead of running immediately. The same hook runs outside the lock for incremental/full rebuilds, so startup now behaves inconsistently and can hang user hooks. ℹ️ 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". |
Sorry, something went wrong.
|
rescript
npm i https://pkg.pr.new/rescript@8413
npm i https://pkg.pr.new/@rescript/darwin-arm64@8413
npm i https://pkg.pr.new/@rescript/darwin-x64@8413
npm i https://pkg.pr.new/@rescript/linux-arm64@8413
npm i https://pkg.pr.new/@rescript/linux-x64@8413
npm i https://pkg.pr.new/@rescript/runtime@8413
npm i https://pkg.pr.new/@rescript/win32-x64@8413 commit: 15bced2 |
Sorry, something went wrong.
There was a problem hiding this comment.
Here are some automated review suggestions for this pull request.
Reviewed commit: bdc7a2f797
ℹ️ 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".
Sorry, something went wrong.
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ 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". |
Sorry, something went wrong.
* Fix watch startup build locking * Fix * Fix
* Fix watch startup build locking * Fix * Fix
| Back | FazBrowse Home | New Git URL |
Motivation
rewatch watch can start while another rewatch build is running, and the two commands intentionally use separate watch.lock and build.lock files. However, watch startup still had a gap in its build locking.
The watcher acquired build.lock while running initialize_build, then released it before entering async_watch, where the initial compile happened through a second lock acquisition. That left a window where another build process could start between watch initialization and the watcher’s initial compile. Since initialization and compilation both mutate build artifacts, that gap could allow concurrent artifact writes and trigger inconsistent build output.
Changes
Covered cases
This now protects the startup path where:
The existing full rebuild path remains protected by build.lock, including rebuilds triggered by config changes, rename events, and editor atomic-save behavior.