Skip to content

Commit 5d28d88

Browse files
cknittclaude
andcommitted
Build Luv from the rescript-lang/luv fork with libuv 1.53.0
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
1 parent b3c4184 commit 5d28d88

6 files changed

Lines changed: 17 additions & 45 deletions

File tree

‎.github/opam-repository/README.md‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
This repository contains narrowly scoped dependency fixes needed by CI before
44
they are available from the main opam repository.
55

6-
The Luv 0.5.14 override preserves the ARM64 musl compiler's
7-
`-mno-outline-atomics` requirement while building vendored libuv. Without it,
8-
the static executable fails to link because libuv refers to glibc's internal
9-
`__getauxval` symbol. The patch should be contributed upstream and this
10-
override removed once a fixed Luv release is available.
11-
12-
Luv 0.5.14 also vendors libuv 1.48.0. Evaluating and contributing an update to
13-
a current libuv 1.x release is a separate upstream follow-up; changing the
14-
vendored library is intentionally outside the OCaml rewatch port.
6+
The Luv override builds Luv from a commit of the
7+
[rescript-lang/luv](https://github.com/rescript-lang/luv) fork. The fork
8+
vendors libuv 1.53.0 (upstream Luv 0.5.14 vendors 1.48.0) and preserves the
9+
ARM64 musl compiler's `-mno-outline-atomics` requirement, without which the
10+
static executable fails to link because libuv refers to glibc's internal
11+
`__getauxval` symbol. Remove the override once a Luv release with these
12+
changes is available.

.github/opam-repository/packages/luv/luv.0.5.14/opam renamed to .github/opam-repository/packages/luv/luv.0.5.14+rescript.1/opam

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
opam-version: "2.0"
22
name: "luv"
3-
version: "0.5.14"
3+
version: "0.5.14+rescript.1"
44
synopsis: "Binding to libuv: cross-platform asynchronous I/O"
55
description: """\
66
Luv is a binding to libuv, the cross-platform C library that does
@@ -13,30 +13,23 @@ alternative to the standard module Unix."""
1313
maintainer: "Anton Bachin <antonbachin@yahoo.com>"
1414
authors: "Anton Bachin <antonbachin@yahoo.com>"
1515
license: "MIT"
16-
homepage: "https://github.com/aantron/luv"
16+
homepage: "https://github.com/rescript-lang/luv"
1717
doc: "https://aantron.github.io/luv"
18-
bug-reports: "https://github.com/aantron/luv/issues"
18+
bug-reports: "https://github.com/rescript-lang/luv/issues"
1919
depends: [
2020
"base-unix" {build}
21+
"conf-linux-libc-dev" {build & os = "linux"}
2122
"ctypes" {>= "0.14.0"}
2223
"dune" {>= "2.7.0"}
24+
"integers" {>= "0.3.0"}
2325
"ocaml" {>= "4.03.0"}
2426
"alcotest" {with-test & >= "0.8.1"}
2527
"base-unix" {with-test}
2628
"odoc" {with-doc & = "2.4.0"}
2729
]
2830
build: ["dune" "build" "-p" name "-j" jobs]
29-
patches: ["arm64-musl-outline-atomics.patch"]
30-
extra-files: [
31-
[
32-
"arm64-musl-outline-atomics.patch"
33-
"sha256=c15c4c4d34c9b545197c5160e19c69a128cc186b65a54e0e9a779c2543528a4f"
34-
]
35-
]
36-
dev-repo: "git+https://github.com/aantron/luv.git"
31+
dev-repo: "git+https://github.com/rescript-lang/luv.git"
3732
url {
3833
src:
39-
"https://github.com/aantron/luv/releases/download/0.5.14/luv-0.5.14.tar.gz"
40-
checksum:
41-
"sha256=8e01b4a50c8876cdd98d8e245c0687c4dc4d883aed161ad9c5ace1fb1fdaae99"
34+
"git+https://github.com/rescript-lang/luv.git#8c12b1accfce5bce12f1818b233028240d5927b6"
4235
}

‎.github/opam-repository/packages/luv/luv.0.5.14/files/arm64-musl-outline-atomics.patch‎

Lines changed: 0 additions & 20 deletions
This file was deleted.

‎changes/luv-libuv-1-53.internal.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Build the OCaml rewatch against libuv 1.53.0 via the rescript-lang/luv fork. https://github.com/rescript-lang/rescript/pull/8883

‎dune-project‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
(cmdliner
3636
(= 2.1.1))
3737
(luv
38-
(= 0.5.14))
38+
(= 0.5.14+rescript.1))
3939
(re
4040
(= 1.14.0))
4141
(ounit2

‎rescript.opam‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ depends: [
1717
"yojson" {= "3.0.0"}
1818
"spawn" {= "v0.17.0"}
1919
"cmdliner" {= "2.1.1"}
20-
"luv" {= "0.5.14"}
20+
"luv" {= "0.5.14+rescript.1"}
2121
"re" {= "1.14.0"}
2222
"ounit2" {with-test & = "2.2.7"}
2323
"odoc" {with-doc}

0 commit comments

Comments
 (0)