From 1a71b2dd6c5820f662ce47e1659112247c97b3e4 Mon Sep 17 00:00:00 2001 From: Pedro Castro Date: Tue, 12 May 2026 16:16:24 -0300 Subject: [PATCH 1/2] Sync dune-project with opam dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .opam files declared dependencies (cppo, flow_parser, ocamlformat, yojson, ounit2, odoc, ocaml-lsp-server, js_of_ocaml, wasm_of_ocaml-compiler) that were not present in dune-project. For the rescript package those deps were sourced from rescript.opam.template, which fully overrode what dune-project would have generated. For analysis and tools, the odoc {with-doc} entry was missing entirely. Move all dependencies into dune-project so it is the single source of truth, and shrink rescript.opam.template to only the pin-depends: block for the flow_parser fork — the one field dune-project cannot express. The regenerated .opam files are equivalent to the previous ones. --- analysis.opam | 2 +- dune-project | 29 ++++++++++++++++++++++++++--- rescript.opam | 28 +++++++++++++--------------- rescript.opam.template | 15 --------------- tools.opam | 2 +- 5 files changed, 41 insertions(+), 35 deletions(-) diff --git a/analysis.opam b/analysis.opam index a202fba552e..8350d0a8a98 100644 --- a/analysis.opam +++ b/analysis.opam @@ -7,9 +7,9 @@ license: "LGPL-3.0-or-later" homepage: "https://github.com/rescript-lang/rescript-compiler" bug-reports: "https://github.com/rescript-lang/rescript-compiler/issues" depends: [ + "dune" {>= "3.17"} "ocaml" {>= "5.0.0"} "cppo" {= "1.8.0"} - "dune" {>= "3.17"} "odoc" {with-doc} ] build: [ diff --git a/dune-project b/dune-project index c8bb3117c50..e1ced168ae1 100644 --- a/dune-project +++ b/dune-project @@ -19,7 +19,30 @@ (synopsis "ReScript compiler") (depends (ocaml - (>= 5.0.0)))) + (>= 5.0.0)) + (cppo + (= 1.8.0)) + (flow_parser + (= 0.267.0)) + (ocamlformat + (and :with-test (= 0.27.0))) + (yojson + (and :with-test (= 2.2.2))) + (ounit2 + (and :with-test (= 2.2.7))) + (odoc :with-doc) + (ocaml-lsp-server + (and :with-dev-setup (= 1.22.0))) + (js_of_ocaml + (and + (<> :os "win32") + :with-test + (= 6.0.1))) + (wasm_of_ocaml-compiler + (and + (<> :os "win32") + :with-test + (= 6.0.1))))) (package (name analysis) @@ -29,7 +52,7 @@ (>= 5.0.0)) (cppo (= 1.8.0)) - dune)) + (odoc :with-doc))) (package (name tools) @@ -42,4 +65,4 @@ (cppo (= 1.8.0)) analysis - dune)) + (odoc :with-doc))) diff --git a/rescript.opam b/rescript.opam index 40a9251350f..933f2b1c1f9 100644 --- a/rescript.opam +++ b/rescript.opam @@ -6,6 +6,19 @@ authors: ["Hongbo Zhang "] license: "LGPL-3.0-or-later" homepage: "https://github.com/rescript-lang/rescript-compiler" bug-reports: "https://github.com/rescript-lang/rescript-compiler/issues" +depends: [ + "dune" {>= "3.17"} + "ocaml" {>= "5.0.0"} + "cppo" {= "1.8.0"} + "flow_parser" {= "0.267.0"} + "ocamlformat" {with-test & = "0.27.0"} + "yojson" {with-test & = "2.2.2"} + "ounit2" {with-test & = "2.2.7"} + "odoc" {with-doc} + "ocaml-lsp-server" {with-dev-setup & = "1.22.0"} + "js_of_ocaml" {os != "win32" & with-test & = "6.0.1"} + "wasm_of_ocaml-compiler" {os != "win32" & with-test & = "6.0.1"} +] build: [ ["dune" "subst"] {dev} [ @@ -20,21 +33,6 @@ build: [ "@doc" {with-doc} ] ] -depends: [ - "ocaml" {>= "5.0.0"} - "cppo" {= "1.8.0"} - "dune" {>= "3.17"} - "flow_parser" {= "0.267.0"} - "ocamlformat" {with-test & = "0.27.0"} - "yojson" {with-test & = "2.2.2"} - "ounit2" {with-test & = "2.2.7"} - "odoc" {with-doc} - "ocaml-lsp-server" {with-dev-setup & = "1.22.0"} - - # Test dependencies that would be broken on Windows runners - "js_of_ocaml" {os != "win32" & with-test & = "6.0.1"} - "wasm_of_ocaml-compiler" {os != "win32" & with-test & = "6.0.1"} -] pin-depends: [ ["flow_parser.0.267.0" "git+https://github.com/rescript-lang/flow.git#9ea4062c0b7e037415c4413a7634c459ebd5c31b"] ] diff --git a/rescript.opam.template b/rescript.opam.template index e5629e01d6a..5f168c67302 100644 --- a/rescript.opam.template +++ b/rescript.opam.template @@ -1,18 +1,3 @@ -depends: [ - "ocaml" {>= "5.0.0"} - "cppo" {= "1.8.0"} - "dune" {>= "3.17"} - "flow_parser" {= "0.267.0"} - "ocamlformat" {with-test & = "0.27.0"} - "yojson" {with-test & = "2.2.2"} - "ounit2" {with-test & = "2.2.7"} - "odoc" {with-doc} - "ocaml-lsp-server" {with-dev-setup & = "1.22.0"} - - # Test dependencies that would be broken on Windows runners - "js_of_ocaml" {os != "win32" & with-test & = "6.0.1"} - "wasm_of_ocaml-compiler" {os != "win32" & with-test & = "6.0.1"} -] pin-depends: [ ["flow_parser.0.267.0" "git+https://github.com/rescript-lang/flow.git#9ea4062c0b7e037415c4413a7634c459ebd5c31b"] ] diff --git a/tools.opam b/tools.opam index 203f7fd7537..bfcabac6a9f 100644 --- a/tools.opam +++ b/tools.opam @@ -7,11 +7,11 @@ license: "LGPL-3.0-or-later" homepage: "https://github.com/rescript-lang/rescript-compiler" bug-reports: "https://github.com/rescript-lang/rescript-compiler/issues" depends: [ + "dune" {>= "3.17"} "ocaml" {>= "5.0.0"} "cmarkit" {>= "0.3.0"} "cppo" {= "1.8.0"} "analysis" - "dune" {>= "3.17"} "odoc" {with-doc} ] build: [ From 0bd2debb00ea409f83c545e3398411cbef314ff8 Mon Sep 17 00:00:00 2001 From: Pedro Castro Date: Tue, 12 May 2026 19:30:50 -0300 Subject: [PATCH 2/2] add dune --- dune-project | 1 + rescript.opam | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dune-project b/dune-project index e1ced168ae1..eb93503c24b 100644 --- a/dune-project +++ b/dune-project @@ -20,6 +20,7 @@ (depends (ocaml (>= 5.0.0)) + dune (cppo (= 1.8.0)) (flow_parser diff --git a/rescript.opam b/rescript.opam index 933f2b1c1f9..d87e63dc488 100644 --- a/rescript.opam +++ b/rescript.opam @@ -7,8 +7,8 @@ license: "LGPL-3.0-or-later" homepage: "https://github.com/rescript-lang/rescript-compiler" bug-reports: "https://github.com/rescript-lang/rescript-compiler/issues" depends: [ - "dune" {>= "3.17"} "ocaml" {>= "5.0.0"} + "dune" {>= "3.17"} "cppo" {= "1.8.0"} "flow_parser" {= "0.267.0"} "ocamlformat" {with-test & = "0.27.0"}