Skip to content

Upgrade libuv to 1.53.0 and test native watcher APIs - #2

Merged
cknitt merged 7 commits into
masterfrom
upgrade-libuv
Oct 17, 2026
Merged

cknitt merged 7 commits into
masterfrom
upgrade-libuv

Conversation

@fhammerschmidt

@fhammerschmidt fhammerschmidt commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Upgrade vendored libuv from 1.48.0 to 1.53.0, updating build files and Linux/Windows dependencies. Rebuild ctypes layouts when headers change and fix statfs reserved-field handling to prevent invalid reads. Add regression coverage for ReScript’s watcher and statfs, and remove TCP test assumptions about callback order.

@fhammerschmidt
fhammerschmidt marked this pull request as ready for review October 15, 2026 15:43
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T15:47:24.840805Z b2afaa4 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@fhammerschmidt
fhammerschmidt requested a review from cknitt October 15, 2026 17:00
@cknitt
cknitt merged commit 2094c02 into master Oct 17, 2026
16 checks passed
cknitt added a commit to rescript-lang/rescript that referenced this pull request Oct 17, 2026
The Luv override now fetches 2094c025, the merge commit of
rescript-lang/luv#2 and the fork's master tip, instead of the PR head
8c12b1a. Both commits have the same tree (7acc6c6d), so the built sources
are identical.

Area: ci
Output: unchanged
Tests: none, because the fetched source tree is identical to the tested one
Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9Q6perkzKBQQebDnVXAEK
cknitt added a commit to rescript-lang/rescript that referenced this pull request Oct 17, 2026
The opam override for Luv now fetches commit 8c12b1a of rescript-lang/luv
(PR rescript-lang/luv#2) instead of patching the upstream 0.5.14 tarball.
The fork vendors libuv 1.53.0 instead of 1.48.0 and already carries the
ARM64 musl -mno-outline-atomics fix, so the local patch is gone. The
package is versioned 0.5.14+rescript.1 and dune-project/rescript.opam pin
that version.

Review: Why a git URL and not a release tarball? The fork keeps libuv as a
git submodule; GitHub archives omit submodules, while opam's git fetch
initializes them. The commit hash should move to the merge commit once
rescript-lang/luv#2 lands.

Review: Does the OCaml rewatch use any changed Luv API? Only FS_event,
Loop, Timer, Handle and Error (native_watcher.ml). The fork's API change
(statfs reserved fields read as zero) does not reach it.

Area: rewatch ci
Output: unchanged
Tests: none, because no observable behavior changes; the shared rewatch
 suite (113 checks, incl. watch mode), the rewatch-ocaml focused suite and
 scripts/test.js -ounit -build -mocha -docstrings pass on the new libuv
Measured: watch edit latency, median of 21 interleaved edits (basic
 fixture) 99 -> 100 ms, A/A control 98 ms; 400-directory fixture 98 -> 102
 ms, A/A control 100 ms; watch cold start, median of 7 (400 dirs) 213 ->
 211 ms, A/A 212 ms; idle watcher CPU over 20 s 70-90 ms for all; clean
 build (400 modules), median of 9, 180 -> 180 ms; linux-arm64 devcontainer
 under load, job tmp watch_ab.py and clean_ab.py
Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9Q6perkzKBQQebDnVXAEK
cknitt added a commit to rescript-lang/rescript that referenced this pull request Oct 17, 2026
The Luv override now fetches 2094c025, the merge commit of
rescript-lang/luv#2 and the fork's master tip, instead of the PR head
8c12b1a. Both commits have the same tree (7acc6c6d), so the built sources
are identical.

Area: ci
Output: unchanged
Tests: none, because the fetched source tree is identical to the tested one
Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9Q6perkzKBQQebDnVXAEK
cknitt added a commit to rescript-lang/rescript that referenced this pull request Oct 17, 2026
The opam override for Luv now fetches commit 8c12b1a of rescript-lang/luv
(PR rescript-lang/luv#2) instead of patching the upstream 0.5.14 tarball.
The fork vendors libuv 1.53.0 instead of 1.48.0 and already carries the
ARM64 musl -mno-outline-atomics fix, so the local patch is gone. The
package is versioned 0.5.14+rescript.1 and dune-project/rescript.opam pin
that version.

Review: Why a git URL and not a release tarball? The fork keeps libuv as a
git submodule; GitHub archives omit submodules, while opam's git fetch
initializes them. The commit hash should move to the merge commit once
rescript-lang/luv#2 lands.

Review: Does the OCaml rewatch use any changed Luv API? Only FS_event,
Loop, Timer, Handle and Error (native_watcher.ml). The fork's API change
(statfs reserved fields read as zero) does not reach it.

Area: rewatch ci
Output: unchanged
Tests: none, because no observable behavior changes; the shared rewatch
 suite (113 checks, incl. watch mode), the rewatch-ocaml focused suite and
 scripts/test.js -ounit -build -mocha -docstrings pass on the new libuv
Measured: watch edit latency, median of 21 interleaved edits (basic
 fixture) 99 -> 100 ms, A/A control 98 ms; 400-directory fixture 98 -> 102
 ms, A/A control 100 ms; watch cold start, median of 7 (400 dirs) 213 ->
 211 ms, A/A 212 ms; idle watcher CPU over 20 s 70-90 ms for all; clean
 build (400 modules), median of 9, 180 -> 180 ms; linux-arm64 devcontainer
 under load, job tmp watch_ab.py and clean_ab.py
Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9Q6perkzKBQQebDnVXAEK
cknitt added a commit to rescript-lang/rescript that referenced this pull request Oct 17, 2026
The Luv override now fetches 2094c025, the merge commit of
rescript-lang/luv#2 and the fork's master tip, instead of the PR head
8c12b1a. Both commits have the same tree (7acc6c6d), so the built sources
are identical.

Area: ci
Output: unchanged
Tests: none, because the fetched source tree is identical to the tested one
Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9Q6perkzKBQQebDnVXAEK
@fhammerschmidt
fhammerschmidt deleted the upgrade-libuv branch October 17, 2026 07:56
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