From b4ebcf0cc61c1c5b82ee5adbf542515d092c7686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 6 May 2026 11:19:28 +0200 Subject: [PATCH 1/7] gen-rules: pass source dir explicitly instead of probing getcwd Dune 3.23 forces sandboxing on user rules, so gen.exe runs from _build/.sandbox//default/ instead of the project tree. The previous prefix walker (stop when parent ends with _build) then yielded /default//, which both shows up in the generated ;; comment and shifts the Hashtbl.hash-based name suffix, making the runtest diff against the checked-in dune.inc fail. Take the project-relative directory as argv.(1) (replacing the previously unused library-name argument) so the prefix is stable regardless of where dune runs the action. --- .../tests-compiler/double-translation/dune | 2 +- compiler/tests-compiler/dune | 2 +- compiler/tests-compiler/gen-rules/gen.ml | 20 +++++++------------ lib/tests/dune | 2 +- lib/tests/gen-rules/gen.ml | 20 +++++++------------ 5 files changed, 17 insertions(+), 29 deletions(-) diff --git a/compiler/tests-compiler/double-translation/dune b/compiler/tests-compiler/double-translation/dune index 063207b8a9d..7a160102309 100644 --- a/compiler/tests-compiler/double-translation/dune +++ b/compiler/tests-compiler/double-translation/dune @@ -6,7 +6,7 @@ (action (with-stdout-to dune.inc.gen - (run ../gen-rules/gen.exe jsoo_compiler_test)))) + (run ../gen-rules/gen.exe compiler/tests-compiler/double-translation)))) (rule (alias runtest) diff --git a/compiler/tests-compiler/dune b/compiler/tests-compiler/dune index bf40299a44d..6702f7246fc 100644 --- a/compiler/tests-compiler/dune +++ b/compiler/tests-compiler/dune @@ -6,7 +6,7 @@ (action (with-stdout-to dune.inc.gen - (run gen-rules/gen.exe jsoo_compiler_test)))) + (run gen-rules/gen.exe compiler/tests-compiler)))) (rule (alias runtest) diff --git a/compiler/tests-compiler/gen-rules/gen.ml b/compiler/tests-compiler/gen-rules/gen.ml index b2b83f4de72..14b81d6d6c9 100644 --- a/compiler/tests-compiler/gen-rules/gen.ml +++ b/compiler/tests-compiler/gen-rules/gen.ml @@ -14,20 +14,14 @@ let is_implem x = let () = set_binary_mode_out stdout true +(* Project-relative path to this directory, passed by dune *) let prefix : string = - let rec loop acc rem = - let basename = Filename.basename rem in - let dirname = Filename.dirname rem in - if - String.equal dirname rem - || String.ends_with ~suffix:"_build" dirname - || Sys.file_exists (Filename.concat rem "dune-project") - then acc - else - let acc = basename :: acc in - loop acc dirname - in - loop [ "" ] (Sys.getcwd ()) |> String.concat ~sep:"/" + if Array.length Sys.argv < 2 + then failwith "gen.exe: expected source directory as first argument"; + let p = Sys.argv.(1) in + if String.length p > 0 && not (Char.equal p.[String.length p - 1] '/') + then p ^ "/" + else p type lang = | Not of lang diff --git a/lib/tests/dune b/lib/tests/dune index f4902cdc3a6..30c19e35c17 100644 --- a/lib/tests/dune +++ b/lib/tests/dune @@ -6,7 +6,7 @@ (action (with-stdout-to dune.inc.gen - (run gen-rules/gen.exe jsoo_lib_expect_tests)))) + (run gen-rules/gen.exe lib/tests)))) (rule (alias runtest) diff --git a/lib/tests/gen-rules/gen.ml b/lib/tests/gen-rules/gen.ml index 2899edb21ee..f02a8807468 100644 --- a/lib/tests/gen-rules/gen.ml +++ b/lib/tests/gen-rules/gen.ml @@ -32,20 +32,14 @@ let is_implem x = let () = set_binary_mode_out stdout true +(* Project-relative path to this directory, passed by dune *) let prefix : string = - let rec loop acc rem = - let basename = Filename.basename rem in - let dirname = Filename.dirname rem in - if - String.equal dirname rem - || String.ends_with ~suffix:"_build" dirname - || Sys.file_exists (Filename.concat rem "dune-project") - then acc - else - let acc = basename :: acc in - loop acc dirname - in - loop [ "" ] (Sys.getcwd ()) |> String.concat ~sep:"/" + if Array.length Sys.argv < 2 + then failwith "gen.exe: expected source directory as first argument"; + let p = Sys.argv.(1) in + if String.length p > 0 && not (Char.equal p.[String.length p - 1] '/') + then p ^ "/" + else p type enabled_if = | GE5 From f26d6d71d7d905d0b13ad0c9e260f6f2d43a3ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 6 May 2026 11:19:28 +0200 Subject: [PATCH 2/7] Pin ocaml-dune-lint dev The current release of ocaml-dune-lint is not compatible with dune 3.23. --- .github/workflows/lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 00cdd669fec..714b254e23e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,6 +26,7 @@ jobs: with: token: ${{ github.token }} - run: sh tools/make_opam_dune_lint_dir.sh + - run: opam pin -n opam-dune-lint --dev-repo - uses: ocaml/setup-ocaml/lint-opam@v3 lint-fmt: From 69acef3637f8296722f9414e04369f36f2c7d736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 6 May 2026 13:58:07 +0200 Subject: [PATCH 3/7] Tests: declare dependency on wasm assets directory Under dune 3.23 sandboxing, rules that run a *.bc.wasm.js file also need to depend on the companion *.bc.wasm.assets/ directory so that the .wasm files are copied into the sandbox. --- compiler/tests-dynlink-wasm/dune | 20 ++++++++++++++++---- compiler/tests-ocaml/lib-arg/dune | 2 ++ compiler/tests-ocaml/lib-array/dune | 2 ++ compiler/tests-ocaml/lib-either/dune | 2 ++ compiler/tests-ocaml/lib-internalformat/dune | 2 ++ compiler/tests-ocaml/lib-lazy/dune | 2 ++ compiler/tests-predef/dune | 2 ++ compiler/tests-toplevel/dune | 2 ++ 8 files changed, 30 insertions(+), 4 deletions(-) diff --git a/compiler/tests-dynlink-wasm/dune b/compiler/tests-dynlink-wasm/dune index dc5fea7c016..cabbf6ecffd 100644 --- a/compiler/tests-dynlink-wasm/dune +++ b/compiler/tests-dynlink-wasm/dune @@ -54,7 +54,9 @@ (rule (target main.out) - (deps plugin.wasmo) + (deps + plugin.wasmo + (glob_files main.bc.wasm.assets/*)) (enabled_if %{env:WASM_OF_OCAML=false}) (action (with-outputs-to @@ -90,7 +92,9 @@ (rule (target main_compile_and_load.out) - (deps plugin_compiled.wasmo) + (deps + plugin_compiled.wasmo + (glob_files main_compile_and_load.bc.wasm.assets/*)) (enabled_if %{env:WASM_OF_OCAML=false}) (action (with-outputs-to @@ -115,7 +119,10 @@ (rule (target dynlink_loadfile.out) - (deps plugin.cmo plugin2.cma) + (deps + plugin.cmo + plugin2.cma + (glob_files dynlink_loadfile.bc.wasm.assets/*)) (enabled_if %{env:WASM_OF_OCAML=false}) (action (with-outputs-to @@ -181,7 +188,12 @@ (rule (target dynlink_loadfile_wp.out) - (deps plugin.cmo plugin2.cma plugin_uses_dep.cmo plugin_js.cmo) + (deps + plugin.cmo + plugin2.cma + plugin_uses_dep.cmo + plugin_js.cmo + (glob_files dynlink_loadfile_wp.assets/*)) (enabled_if %{env:WASM_OF_OCAML=false}) (action (with-outputs-to diff --git a/compiler/tests-ocaml/lib-arg/dune b/compiler/tests-ocaml/lib-arg/dune index 1fee0994132..7a856b8d3f3 100644 --- a/compiler/tests-ocaml/lib-arg/dune +++ b/compiler/tests-ocaml/lib-arg/dune @@ -18,6 +18,8 @@ (rule (target test_rest_all_wasm.ml.corrected) (enabled_if %{env:WASM_OF_OCAML=false}) + (deps + (glob_files ../expect_wasm.bc.wasm.assets/*)) (action (run node %{dep:../expect_wasm.bc.wasm.js} %{dep:test_rest_all_wasm.ml}))) diff --git a/compiler/tests-ocaml/lib-array/dune b/compiler/tests-ocaml/lib-array/dune index c281ad438cf..ed7265081d3 100644 --- a/compiler/tests-ocaml/lib-array/dune +++ b/compiler/tests-ocaml/lib-array/dune @@ -16,6 +16,8 @@ (rule (target test_array_wasm.ml.corrected) (enabled_if %{env:WASM_OF_OCAML=false}) + (deps + (glob_files ../expect_wasm.bc.wasm.assets/*)) (action (run node %{dep:../expect_wasm.bc.wasm.js} %{dep:test_array_wasm.ml}))) diff --git a/compiler/tests-ocaml/lib-either/dune b/compiler/tests-ocaml/lib-either/dune index febf0dccb0d..31e95afd552 100644 --- a/compiler/tests-ocaml/lib-either/dune +++ b/compiler/tests-ocaml/lib-either/dune @@ -14,6 +14,8 @@ (rule (target test_wasm.ml.corrected) (enabled_if %{env:WASM_OF_OCAML=false}) + (deps + (glob_files ../expect_wasm.bc.wasm.assets/*)) (action (run node %{dep:../expect_wasm.bc.wasm.js} %{dep:test_wasm.ml}))) diff --git a/compiler/tests-ocaml/lib-internalformat/dune b/compiler/tests-ocaml/lib-internalformat/dune index febf0dccb0d..31e95afd552 100644 --- a/compiler/tests-ocaml/lib-internalformat/dune +++ b/compiler/tests-ocaml/lib-internalformat/dune @@ -14,6 +14,8 @@ (rule (target test_wasm.ml.corrected) (enabled_if %{env:WASM_OF_OCAML=false}) + (deps + (glob_files ../expect_wasm.bc.wasm.assets/*)) (action (run node %{dep:../expect_wasm.bc.wasm.js} %{dep:test_wasm.ml}))) diff --git a/compiler/tests-ocaml/lib-lazy/dune b/compiler/tests-ocaml/lib-lazy/dune index febf0dccb0d..31e95afd552 100644 --- a/compiler/tests-ocaml/lib-lazy/dune +++ b/compiler/tests-ocaml/lib-lazy/dune @@ -14,6 +14,8 @@ (rule (target test_wasm.ml.corrected) (enabled_if %{env:WASM_OF_OCAML=false}) + (deps + (glob_files ../expect_wasm.bc.wasm.assets/*)) (action (run node %{dep:../expect_wasm.bc.wasm.js} %{dep:test_wasm.ml}))) diff --git a/compiler/tests-predef/dune b/compiler/tests-predef/dune index 80d7337edfa..2ea5508b718 100644 --- a/compiler/tests-predef/dune +++ b/compiler/tests-predef/dune @@ -43,6 +43,8 @@ (rule (target main-wasm.out) (enabled_if %{env:WASM_OF_OCAML=false}) + (deps + (glob_files main.bc.wasm.assets/*)) (action (with-stdout-to %{target} diff --git a/compiler/tests-toplevel/dune b/compiler/tests-toplevel/dune index c94fcc24eff..8b0167a94ab 100644 --- a/compiler/tests-toplevel/dune +++ b/compiler/tests-toplevel/dune @@ -81,6 +81,8 @@ (and %{env:WASM_OF_OCAML=false} (>= %{ocaml_version} 5.4))) + (deps + (glob_files test_toplevel_wasm.bc.wasm.assets/*)) (action (with-stdout-to %{target} From 26bbae6584ff85a6ec01eb18e89ac56d3c1f990f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 6 May 2026 14:43:25 +0200 Subject: [PATCH 4/7] Tests: declare cmi dependencies for --toplevel rules Under dune 3.23 sandboxing, rules invoking js_of_ocaml or wasm_of_ocaml with --toplevel need their .cmi files brought into the sandbox. For locally built cmis, declare them as deps. For library cmis, add a cmi_include_dirs.txt rule (mirroring the existing one for toplevel.bc) that uses ocamlfind to produce -I flags, and pass the result via read-strings. --- compiler/tests-toplevel/dune | 21 ++++++++++++++++++++ toplevel/examples/lwt_toplevel/dune | 30 +++++++++++++++++++++++++++++ toplevel/test/dune | 19 ++++++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/compiler/tests-toplevel/dune b/compiler/tests-toplevel/dune index 8b0167a94ab..2b5d7555207 100644 --- a/compiler/tests-toplevel/dune +++ b/compiler/tests-toplevel/dune @@ -7,6 +7,15 @@ (flags :standard --toplevel)) (modes byte js)) +(rule + (target cmi_include_dirs.txt) + (deps + (package js_of_ocaml-compiler)) + (action + (with-stdout-to + %{target} + (run ocamlfind query -format "-I\n%d" -r js_of_ocaml-compiler.dynlink)))) + (rule (targets test_toplevel.js) (action @@ -15,6 +24,7 @@ --toplevel -w no-missing-effects-backend + %{read-strings:cmi_include_dirs.txt} %{dep:test_toplevel.bc} -o %{targets}))) @@ -60,6 +70,16 @@ (action (copy %{dep:test_toplevel.ml} %{target}))) +(rule + (target cmi_include_dirs_wasm.txt) + (deps + (package js_of_ocaml-compiler) + (package wasm_of_ocaml-compiler)) + (action + (with-stdout-to + %{target} + (run ocamlfind query -format "-I\n%d" -r wasm_of_ocaml-compiler.dynlink)))) + (rule (targets test_toplevel_wasm.js @@ -71,6 +91,7 @@ --toplevel -w no-missing-effects-backend + %{read-strings:cmi_include_dirs_wasm.txt} %{dep:test_toplevel_wasm.bc} -o test_toplevel_wasm.js))) diff --git a/toplevel/examples/lwt_toplevel/dune b/toplevel/examples/lwt_toplevel/dune index 70a2b20878c..a10f077e8cb 100644 --- a/toplevel/examples/lwt_toplevel/dune +++ b/toplevel/examples/lwt_toplevel/dune @@ -129,6 +129,7 @@ (rule (targets test_dynlink.js) + (deps test_dynlink.cmi) (action (run %{bin:js_of_ocaml} @@ -213,6 +214,33 @@ (or 0 1) (run grep -v ^$)))))) +(rule + (target cmi_include_dirs.txt) + (deps + (package js_of_ocaml) + (package js_of_ocaml-compiler) + (package js_of_ocaml-lwt) + (package js_of_ocaml-tyxml) + (package js_of_ocaml-toplevel) + (package js_of_ocaml-ppx)) + (action + (with-stdout-to + %{target} + (run + ocamlfind + query + -format + "-I\n%d" + -r + js_of_ocaml-compiler.runtime + js_of_ocaml-lwt + js_of_ocaml-lwt.graphics + js_of_ocaml-tyxml + js_of_ocaml-toplevel + js_of_ocaml-toplevel.common + js_of_ocaml-ppx.as-lib + js_of_ocaml.deriving)))) + (rule (targets toplevel.js) ;; Embedding the cmis as JS string literals overflows OCaml's 16 MB @@ -244,6 +272,7 @@ --toplevel --disable shortvar + %{read-strings:cmi_include_dirs.txt} %{read-strings:javascript_runtime_files.txt} %{dep:toplevel.bc} -o @@ -296,6 +325,7 @@ compile --toplevel --effects=cps + %{read-strings:cmi_include_dirs.txt} --file %{dep:examples.ml} --export diff --git a/toplevel/test/dune b/toplevel/test/dune index 6e70b03a154..c6ec5c769b0 100644 --- a/toplevel/test/dune +++ b/toplevel/test/dune @@ -29,6 +29,24 @@ (action (run jsoo_mkcmis -o %{target} stdlib))) +(rule + (target cmi_include_dirs.txt) + (deps + (package js_of_ocaml) + (package js_of_ocaml-toplevel)) + (action + (with-stdout-to + %{target} + (run + ocamlfind + query + -format + "-I\n%d" + -r + js_of_ocaml-toplevel + js_of_ocaml-toplevel.common + re)))) + (rule (targets test_toplevel1.js) (action @@ -41,6 +59,7 @@ shortvar -w no-missing-effects-backend + %{read-strings:cmi_include_dirs.txt} %{dep:test_toplevel1.bc} -o %{targets}))) From 4ba8962163d0a410bf316ea901a94f0a9e427c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Thu, 7 May 2026 10:09:17 +0200 Subject: [PATCH 5/7] Tests: declare wc.ml as a dep of the basic-io test Under dune 3.23 sandboxing, wc.ml needs to be brought into the sandbox. Inline the dep with %{dep:wc.ml} on the command line. --- compiler/tests-ocaml/basic-io/dune | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/tests-ocaml/basic-io/dune b/compiler/tests-ocaml/basic-io/dune index 0dda8c02463..f9b55cf6818 100644 --- a/compiler/tests-ocaml/basic-io/dune +++ b/compiler/tests-ocaml/basic-io/dune @@ -2,4 +2,4 @@ (names wc) (modes js wasm) (action - (run node %{test} wc.ml))) + (run node %{test} %{dep:wc.ml}))) From 58fc72fa2a07838f668659b2288c3177ea952ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Tue, 5 May 2026 18:59:56 +0200 Subject: [PATCH 6/7] Switch to dune 3.23.1 It uses `js_of_ocaml --build-config` to manage config details. --- VERSION | 2 +- dune-project | 3 ++- js_of_ocaml-compiler.opam | 2 +- js_of_ocaml-lwt.opam | 2 +- js_of_ocaml-ppx.opam | 2 +- js_of_ocaml-ppx_deriving_json.opam | 2 +- js_of_ocaml-toplevel.opam | 2 +- js_of_ocaml-tyxml.opam | 2 +- js_of_ocaml.opam | 2 +- wasm_of_ocaml-compiler.opam | 2 +- 10 files changed, 11 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 91e4a9f2622..ed2ca09d46c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.3.2 +6.4.0~alpha~dev diff --git a/dune-project b/dune-project index f9f1ce7f502..c094ea3dfd2 100644 --- a/dune-project +++ b/dune-project @@ -1,4 +1,4 @@ -(lang dune 3.20) +(lang dune 3.23) (using menhir 3.0) (using directory-targets 0.1) (using oxcaml 0.1) @@ -19,6 +19,7 @@ (description "Js_of_ocaml is a compiler from OCaml bytecode to JavaScript. It makes it possible to run pure OCaml programs in JavaScript environment like browsers and Node.js") (depends + (dune (>= 3.23.1)) (ocaml (and (>= 4.13) (< 5.6))) (num :with-test) (ppx_expect (and (>= v0.16.1) :with-test)) diff --git a/js_of_ocaml-compiler.opam b/js_of_ocaml-compiler.opam index 1c7e4f20eb2..fe452fa50ad 100644 --- a/js_of_ocaml-compiler.opam +++ b/js_of_ocaml-compiler.opam @@ -12,7 +12,7 @@ homepage: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" doc: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" bug-reports: "https://github.com/ocsigen/js_of_ocaml/issues" depends: [ - "dune" {>= "3.20"} + "dune" {>= "3.23.1"} "ocaml" {>= "4.13" & < "5.6"} "num" {with-test} "ppx_expect" {>= "v0.16.1" & with-test} diff --git a/js_of_ocaml-lwt.opam b/js_of_ocaml-lwt.opam index f40e8cdfa32..8f1a92c4102 100644 --- a/js_of_ocaml-lwt.opam +++ b/js_of_ocaml-lwt.opam @@ -12,7 +12,7 @@ homepage: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" doc: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" bug-reports: "https://github.com/ocsigen/js_of_ocaml/issues" depends: [ - "dune" {>= "3.20"} + "dune" {>= "3.23"} "ocaml" {>= "4.13"} "js_of_ocaml" {= version} "js_of_ocaml-ppx" {= version} diff --git a/js_of_ocaml-ppx.opam b/js_of_ocaml-ppx.opam index dcbe53e82a5..67211b0906e 100644 --- a/js_of_ocaml-ppx.opam +++ b/js_of_ocaml-ppx.opam @@ -12,7 +12,7 @@ homepage: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" doc: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" bug-reports: "https://github.com/ocsigen/js_of_ocaml/issues" depends: [ - "dune" {>= "3.20"} + "dune" {>= "3.23"} "ocaml" {>= "4.13"} "js_of_ocaml" {= version} "ppxlib" {>= "0.33"} diff --git a/js_of_ocaml-ppx_deriving_json.opam b/js_of_ocaml-ppx_deriving_json.opam index dcbe53e82a5..67211b0906e 100644 --- a/js_of_ocaml-ppx_deriving_json.opam +++ b/js_of_ocaml-ppx_deriving_json.opam @@ -12,7 +12,7 @@ homepage: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" doc: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" bug-reports: "https://github.com/ocsigen/js_of_ocaml/issues" depends: [ - "dune" {>= "3.20"} + "dune" {>= "3.23"} "ocaml" {>= "4.13"} "js_of_ocaml" {= version} "ppxlib" {>= "0.33"} diff --git a/js_of_ocaml-toplevel.opam b/js_of_ocaml-toplevel.opam index ba4ff914268..d015eb6da94 100644 --- a/js_of_ocaml-toplevel.opam +++ b/js_of_ocaml-toplevel.opam @@ -12,7 +12,7 @@ homepage: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" doc: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" bug-reports: "https://github.com/ocsigen/js_of_ocaml/issues" depends: [ - "dune" {>= "3.20"} + "dune" {>= "3.23"} "ocaml" {>= "4.13"} "js_of_ocaml-compiler" {= version} "ocamlfind" {>= "1.5.1"} diff --git a/js_of_ocaml-tyxml.opam b/js_of_ocaml-tyxml.opam index 2ce14c0b6b2..3d44b79d352 100644 --- a/js_of_ocaml-tyxml.opam +++ b/js_of_ocaml-tyxml.opam @@ -12,7 +12,7 @@ homepage: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" doc: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" bug-reports: "https://github.com/ocsigen/js_of_ocaml/issues" depends: [ - "dune" {>= "3.20"} + "dune" {>= "3.23"} "ocaml" {>= "4.13"} "js_of_ocaml" {= version} "js_of_ocaml-ppx" {= version} diff --git a/js_of_ocaml.opam b/js_of_ocaml.opam index 41585955844..5b91479de19 100644 --- a/js_of_ocaml.opam +++ b/js_of_ocaml.opam @@ -12,7 +12,7 @@ homepage: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" doc: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" bug-reports: "https://github.com/ocsigen/js_of_ocaml/issues" depends: [ - "dune" {>= "3.20"} + "dune" {>= "3.23"} "ocaml" {>= "4.13"} "js_of_ocaml-compiler" {= version} "num" {with-test} diff --git a/wasm_of_ocaml-compiler.opam b/wasm_of_ocaml-compiler.opam index 2577bd563fb..56582758a2c 100644 --- a/wasm_of_ocaml-compiler.opam +++ b/wasm_of_ocaml-compiler.opam @@ -12,7 +12,7 @@ homepage: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" doc: "https://ocsigen.org/js_of_ocaml/latest/manual/overview" bug-reports: "https://github.com/ocsigen/js_of_ocaml/issues" depends: [ - "dune" {>= "3.20"} + "dune" {>= "3.23"} "ocaml" {>= "4.14"} "js_of_ocaml" {= version} "num" {with-test} From d546b3688962bce086a5687619f2c5fb42244fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Thu, 21 May 2026 21:03:54 +0200 Subject: [PATCH 7/7] CI: drop dune version constraint from oxcaml-dune-patches oxcaml-dune-patches pins dune <= 3.21, but the project requires dune >= 3.23. opam re-checks dependency constraints on every install, so a one-shot --ignore-constraints-on=dune flag isn't enough. Re-pin the package with the dune version constraint stripped, so subsequent installs let dune resolve to 3.23.x normally. --- .github/workflows/js_of_ocaml.yml | 13 +++++++++++++ .github/workflows/wasm_of_ocaml.yml | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.github/workflows/js_of_ocaml.yml b/.github/workflows/js_of_ocaml.yml index 640fa0f95c3..589ef2efb37 100644 --- a/.github/workflows/js_of_ocaml.yml +++ b/.github/workflows/js_of_ocaml.yml @@ -168,6 +168,19 @@ jobs: opam pin add opam-core -n 2.5.1+ox if: ${{ endsWith(matrix.ocaml-compiler, '+ox') }} + # oxcaml-dune-patches pins dune <= 3.21, but the project requires + # dune >= 3.23. Re-pin the package with the dune version constraint + # stripped — opam re-checks dependency constraints on every install, + # so a one-shot --ignore-constraints-on flag isn't enough. + - name: Drop dune version constraint from oxcaml-dune-patches (OxCaml) + if: ${{ endsWith(matrix.ocaml-compiler, '+ox') }} + run: | + DIR=$(mktemp -d) + opam show --raw oxcaml-dune-patches \ + | perl -0777 -pe 's/"dune"\s+\{build & \([^)]+\)\}/"dune" {build}/' \ + > "$DIR/oxcaml-dune-patches.opam" + opam pin add oxcaml-dune-patches "$DIR" -k path -n -y + - run: opam install . --deps-only --with-test # Install the test dependencies if: ${{ !matrix.skip-test }} diff --git a/.github/workflows/wasm_of_ocaml.yml b/.github/workflows/wasm_of_ocaml.yml index 3d879d9ca49..08dae5c1ccc 100644 --- a/.github/workflows/wasm_of_ocaml.yml +++ b/.github/workflows/wasm_of_ocaml.yml @@ -141,6 +141,19 @@ jobs: opam pin add sedlex -n 3.6+ox if: ${{ endsWith(matrix.ocaml-compiler, '+ox') }} + # oxcaml-dune-patches pins dune <= 3.21, but the project requires + # dune >= 3.23. Re-pin the package with the dune version constraint + # stripped — opam re-checks dependency constraints on every install, + # so a one-shot --ignore-constraints-on flag isn't enough. + - name: Drop dune version constraint from oxcaml-dune-patches (OxCaml) + if: ${{ endsWith(matrix.ocaml-compiler, '+ox') }} + run: | + DIR=$(mktemp -d) + opam show --raw oxcaml-dune-patches \ + | perl -0777 -pe 's/"dune"\s+\{build & \([^)]+\)\}/"dune" {build}/' \ + > "$DIR/oxcaml-dune-patches.opam" + opam pin add oxcaml-dune-patches "$DIR" -k path -n -y + # Add some packaged to the opam invariant; # opam makes wrong choices otherwise - name: Hold some packages