From eaab2f275f3b1d383ce6b8616a7814d246c053f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Thu, 31 Oct 2024 17:46:08 +0100 Subject: [PATCH] Revised dune support --- .github/workflows/build-wasm_of_ocaml.yml | 2 +- compiler/tests-env/dune | 6 +---- compiler/tests-io/dune | 15 ++++++++++++ compiler/tests-jsoo/bin/dune | 16 ++++++++++++- compiler/tests-jsoo/dune | 8 +++---- compiler/tests-jsoo/lib-effects/dune | 2 +- compiler/tests-linkall/dune | 4 +++- compiler/tests-ocaml/basic-modules/dune | 2 +- compiler/tests-ocaml/lib-atomic/dune | 2 +- compiler/tests-ocaml/lib-bigarray/dune | 2 +- compiler/tests-ocaml/lib-bool/dune | 2 +- compiler/tests-ocaml/lib-buffer/dune | 2 +- compiler/tests-ocaml/lib-bytes-utf/dune | 1 + compiler/tests-ocaml/lib-bytes/dune | 2 +- compiler/tests-ocaml/lib-digest/dune | 9 +++----- compiler/tests-ocaml/lib-effects/dune | 4 ++-- compiler/tests-ocaml/lib-filename/dune | 2 +- compiler/tests-ocaml/lib-float/dune | 2 +- compiler/tests-ocaml/lib-floatarray/dune | 2 +- compiler/tests-ocaml/lib-format/dune | 2 +- compiler/tests-ocaml/lib-fun/dune | 2 +- compiler/tests-ocaml/lib-gc/dune | 2 +- compiler/tests-ocaml/lib-hashtbl/dune | 4 ++-- compiler/tests-ocaml/lib-int/dune | 2 +- compiler/tests-ocaml/lib-int64/dune | 2 +- compiler/tests-ocaml/lib-list/dune | 2 +- compiler/tests-ocaml/lib-option/dune | 2 +- compiler/tests-ocaml/lib-printf/dune | 1 + compiler/tests-ocaml/lib-queue/dune | 2 +- compiler/tests-ocaml/lib-random/dune | 1 + compiler/tests-ocaml/lib-result/dune | 2 +- compiler/tests-ocaml/lib-seq/dune | 2 +- compiler/tests-ocaml/lib-set/dune | 2 +- compiler/tests-ocaml/lib-stack/dune | 2 +- compiler/tests-ocaml/lib-str/dune | 2 +- compiler/tests-ocaml/lib-string/dune | 2 +- compiler/tests-ocaml/lib-uchar/dune | 2 +- compiler/tests-ocaml/prim-bigstring/dune | 2 +- compiler/tests-ocaml/prim-bswap/dune | 2 +- compiler/tests-ocaml/prim-revapply/dune | 2 +- compiler/tests-re/dune | 2 +- compiler/tests-runtime-events/dune | 2 +- compiler/tests-sourcemap/dune | 8 ------- compiler/tests-wasm_of_ocaml/dune | 4 +++- dune | 14 +++++++----- examples/graphics/dune | 2 +- examples/test_wheel/dune | 2 +- lib/deriving_json/tests/dune | 2 +- lib/tests/dune.inc | 28 +++++++++++------------ lib/tests/gen-rules/gen.ml | 2 +- tools/ci_setup.ml | 13 +++++++++-- 51 files changed, 119 insertions(+), 87 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 9e1d559f51..513d3ca5a8 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -148,7 +148,7 @@ jobs: - name: Pin dune run: | - opam pin add -n dune.3.17 https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml-incremental + opam pin add -n dune.3.17 https://github.com/vouillon/dune.git#wasm_of_ocaml-alternative - name: Pin wasm_of_ocaml working-directory: ./wasm_of_ocaml diff --git a/compiler/tests-env/dune b/compiler/tests-env/dune index 5975060fa9..0ec8080c7c 100644 --- a/compiler/tests-env/dune +++ b/compiler/tests-env/dune @@ -1,9 +1,5 @@ (test - (modes js) - (build_if - (and - (<> %{profile} wasm) - (<> %{profile} wasm-effects))) + (modes js) ; No env support in wasm_of_ocaml yet (js_of_ocaml (javascript_files setup.js) (flags :standard --setenv JSOO_C=from-jsoo-args)) diff --git a/compiler/tests-io/dune b/compiler/tests-io/dune index a2dcef1a3f..ed447290ed 100644 --- a/compiler/tests-io/dune +++ b/compiler/tests-io/dune @@ -2,6 +2,7 @@ (names cat md5) (modes js + wasm (best exe))) (rule @@ -27,6 +28,13 @@ (action (diff cat-js.stdout cat-native.stdout))) +(rule + (action (copy cat.bc.wasm.js cat.bc.js)) + (enabled_if + (or + (= %{profile} wasm) + (= %{profile} wasm-effects)))) + (rule (target md5-native.stdout) (action @@ -69,3 +77,10 @@ (alias runtest) (action (diff md5-js.stdout md5-native.stdout))) + +(rule + (action (copy md5.bc.wasm.js md5.bc.js)) + (enabled_if + (or + (= %{profile} wasm) + (= %{profile} wasm-effects)))) diff --git a/compiler/tests-jsoo/bin/dune b/compiler/tests-jsoo/bin/dune index 3cadcdb3ed..808c5bf33d 100644 --- a/compiler/tests-jsoo/bin/dune +++ b/compiler/tests-jsoo/bin/dune @@ -1,6 +1,6 @@ (executables (names error1 error2) - (modes exe js) + (modes exe js wasm) (foreign_stubs (language c) (names named_value_stubs)) @@ -55,6 +55,13 @@ (action (diff %{dep:error1-unregister.expected} %{dep:error1-unregister.js.actual}))) +(rule + (action (copy error1.bc.wasm.js error1.bc.js)) + (enabled_if + (or + (= %{profile} wasm) + (= %{profile} wasm-effects)))) + (rule (target error2.js.actual) (deps error2.html) @@ -105,3 +112,10 @@ (alias runtest) (action (diff %{dep:error2-unregister.expected} %{dep:error2-unregister.js.actual}))) + +(rule + (action (copy error2.bc.wasm.js error2.bc.js)) + (enabled_if + (or + (= %{profile} wasm) + (= %{profile} wasm-effects)))) diff --git a/compiler/tests-jsoo/dune b/compiler/tests-jsoo/dune index ca6f45862f..26f79c9284 100644 --- a/compiler/tests-jsoo/dune +++ b/compiler/tests-jsoo/dune @@ -5,7 +5,7 @@ (enabled_if (>= %{ocaml_version} 4.14)) (inline_tests - (modes js best)) + (modes js wasm best)) (preprocess (pps ppx_expect))) @@ -16,7 +16,7 @@ (enabled_if (>= %{ocaml_version} 5.1.1)) (inline_tests - (modes js best)) + (modes js wasm best)) (preprocess (pps ppx_expect))) @@ -27,7 +27,7 @@ (enabled_if (>= %{ocaml_version} 5.1.1)) (inline_tests - (modes js best)) + (modes js wasm best)) (preprocess (pps ppx_expect))) @@ -47,7 +47,7 @@ (language c) (names bigarray_stubs)) (inline_tests - (modes js best)) + (modes js wasm best)) (preprocess (pps ppx_expect))) diff --git a/compiler/tests-jsoo/lib-effects/dune b/compiler/tests-jsoo/lib-effects/dune index 0ac00bf21e..db1dba7b43 100644 --- a/compiler/tests-jsoo/lib-effects/dune +++ b/compiler/tests-jsoo/lib-effects/dune @@ -9,6 +9,6 @@ (inline_tests ;; This requires the unreleased dune 3.7 to work (enabled_if true) - (modes js best)) + (modes js wasm best)) (preprocess (pps ppx_expect))) diff --git a/compiler/tests-linkall/dune b/compiler/tests-linkall/dune index 4b1df9f693..5d1fd7d45f 100644 --- a/compiler/tests-linkall/dune +++ b/compiler/tests-linkall/dune @@ -3,11 +3,13 @@ (env (_ (js_of_ocaml + (compilation_mode separate)) + (wasm_of_ocaml (compilation_mode separate)))) (test (name test) - (modes byte js) + (modes byte js wasm) (libraries dynlink) ;; It doesn't seem possible to create a pack-ed module with dune. ;; However, dynlink uses pack to embed a copy diff --git a/compiler/tests-ocaml/basic-modules/dune b/compiler/tests-ocaml/basic-modules/dune index d5bfb9f8a9..f0add07495 100644 --- a/compiler/tests-ocaml/basic-modules/dune +++ b/compiler/tests-ocaml/basic-modules/dune @@ -1,4 +1,4 @@ (tests (names recursive_module_init) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-atomic/dune b/compiler/tests-ocaml/lib-atomic/dune index ca4c49b456..2976592d37 100644 --- a/compiler/tests-ocaml/lib-atomic/dune +++ b/compiler/tests-ocaml/lib-atomic/dune @@ -1,3 +1,3 @@ (test (name test_atomic) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-bigarray/dune b/compiler/tests-ocaml/lib-bigarray/dune index 38ac683d5e..559c82ecd1 100644 --- a/compiler/tests-ocaml/lib-bigarray/dune +++ b/compiler/tests-ocaml/lib-bigarray/dune @@ -1,4 +1,4 @@ (tests (names bigarrays change_layout fftba pr5115 weak_bigarray) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-bool/dune b/compiler/tests-ocaml/lib-bool/dune index 9047167ba4..16342d6417 100644 --- a/compiler/tests-ocaml/lib-bool/dune +++ b/compiler/tests-ocaml/lib-bool/dune @@ -1,4 +1,4 @@ (tests (names test) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-buffer/dune b/compiler/tests-ocaml/lib-buffer/dune index 9047167ba4..16342d6417 100644 --- a/compiler/tests-ocaml/lib-buffer/dune +++ b/compiler/tests-ocaml/lib-buffer/dune @@ -1,4 +1,4 @@ (tests (names test) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-bytes-utf/dune b/compiler/tests-ocaml/lib-bytes-utf/dune index 9b2db1c33a..717f83e0e5 100644 --- a/compiler/tests-ocaml/lib-bytes-utf/dune +++ b/compiler/tests-ocaml/lib-bytes-utf/dune @@ -5,4 +5,5 @@ (:standard \ -strict-sequence)) (modes js + wasm (best exe))) diff --git a/compiler/tests-ocaml/lib-bytes/dune b/compiler/tests-ocaml/lib-bytes/dune index 10725957d6..4af2ae612c 100644 --- a/compiler/tests-ocaml/lib-bytes/dune +++ b/compiler/tests-ocaml/lib-bytes/dune @@ -1,4 +1,4 @@ (tests (names test_bytes binary) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-digest/dune b/compiler/tests-ocaml/lib-digest/dune index ebf76eddba..34e14faf28 100644 --- a/compiler/tests-ocaml/lib-digest/dune +++ b/compiler/tests-ocaml/lib-digest/dune @@ -2,15 +2,12 @@ (names md5) (libraries) (modules md5) - (modes js)) + (modes js wasm)) (tests (names digests) (libraries) (build_if - (and - (>= %{ocaml_version} 5.2) - (<> %{profile} wasm) - (<> %{profile} wasm-effects))) + (>= %{ocaml_version} 5.2)) (modules digests) - (modes js)) + (modes js)) ; blake2b not supported by wasm_of_ocaml yet diff --git a/compiler/tests-ocaml/lib-effects/dune b/compiler/tests-ocaml/lib-effects/dune index 48f8e239ed..82ec639100 100644 --- a/compiler/tests-ocaml/lib-effects/dune +++ b/compiler/tests-ocaml/lib-effects/dune @@ -47,7 +47,7 @@ used_cont) (modules (:standard \ unhandled_unlinked)) - (modes js)) + (modes js wasm)) (tests (build_if @@ -60,4 +60,4 @@ 2 (run node %{test})) (run cat))) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-filename/dune b/compiler/tests-ocaml/lib-filename/dune index 407a53e557..1f8a908a98 100644 --- a/compiler/tests-ocaml/lib-filename/dune +++ b/compiler/tests-ocaml/lib-filename/dune @@ -1,4 +1,4 @@ (tests (names suffix extension) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-float/dune b/compiler/tests-ocaml/lib-float/dune index 9047167ba4..16342d6417 100644 --- a/compiler/tests-ocaml/lib-float/dune +++ b/compiler/tests-ocaml/lib-float/dune @@ -1,4 +1,4 @@ (tests (names test) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-floatarray/dune b/compiler/tests-ocaml/lib-floatarray/dune index b3af4c6d57..de31de0d28 100644 --- a/compiler/tests-ocaml/lib-floatarray/dune +++ b/compiler/tests-ocaml/lib-floatarray/dune @@ -1,4 +1,4 @@ (tests (names floatarray) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-format/dune b/compiler/tests-ocaml/lib-format/dune index 94c4cfe76f..a5860c3846 100644 --- a/compiler/tests-ocaml/lib-format/dune +++ b/compiler/tests-ocaml/lib-format/dune @@ -3,4 +3,4 @@ (libraries) (flags (:standard -no-strict-formats \ -strict-formats)) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-fun/dune b/compiler/tests-ocaml/lib-fun/dune index 9047167ba4..16342d6417 100644 --- a/compiler/tests-ocaml/lib-fun/dune +++ b/compiler/tests-ocaml/lib-fun/dune @@ -1,4 +1,4 @@ (tests (names test) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-gc/dune b/compiler/tests-ocaml/lib-gc/dune index 13e636f3e2..0237c30eb0 100644 --- a/compiler/tests-ocaml/lib-gc/dune +++ b/compiler/tests-ocaml/lib-gc/dune @@ -2,4 +2,4 @@ (names test_gc) (libraries) (flags -w -69) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-hashtbl/dune b/compiler/tests-ocaml/lib-hashtbl/dune index 2a260ec2f8..01bbb96b6a 100644 --- a/compiler/tests-ocaml/lib-hashtbl/dune +++ b/compiler/tests-ocaml/lib-hashtbl/dune @@ -3,7 +3,7 @@ (deps ../../../LICENSE) (modules hfun) (libraries) - (modes js)) + (modes js wasm)) (tests (names htbl) @@ -12,7 +12,7 @@ (build_if (>= %{ocaml_version} 5)) (libraries) - (modes js)) + (modes js wasm)) (rule (action diff --git a/compiler/tests-ocaml/lib-int/dune b/compiler/tests-ocaml/lib-int/dune index 9047167ba4..16342d6417 100644 --- a/compiler/tests-ocaml/lib-int/dune +++ b/compiler/tests-ocaml/lib-int/dune @@ -1,4 +1,4 @@ (tests (names test) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-int64/dune b/compiler/tests-ocaml/lib-int64/dune index 4ff01bc02f..6987384f87 100644 --- a/compiler/tests-ocaml/lib-int64/dune +++ b/compiler/tests-ocaml/lib-int64/dune @@ -1,4 +1,4 @@ (tests (names test issue9460) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-list/dune b/compiler/tests-ocaml/lib-list/dune index 9047167ba4..16342d6417 100644 --- a/compiler/tests-ocaml/lib-list/dune +++ b/compiler/tests-ocaml/lib-list/dune @@ -1,4 +1,4 @@ (tests (names test) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-option/dune b/compiler/tests-ocaml/lib-option/dune index 9047167ba4..16342d6417 100644 --- a/compiler/tests-ocaml/lib-option/dune +++ b/compiler/tests-ocaml/lib-option/dune @@ -1,4 +1,4 @@ (tests (names test) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-printf/dune b/compiler/tests-ocaml/lib-printf/dune index 69defbd4e8..2a15a0ace3 100644 --- a/compiler/tests-ocaml/lib-printf/dune +++ b/compiler/tests-ocaml/lib-printf/dune @@ -5,4 +5,5 @@ (:standard -no-strict-formats \ -strict-formats)) (modes js + wasm (best exe))) diff --git a/compiler/tests-ocaml/lib-queue/dune b/compiler/tests-ocaml/lib-queue/dune index 9047167ba4..16342d6417 100644 --- a/compiler/tests-ocaml/lib-queue/dune +++ b/compiler/tests-ocaml/lib-queue/dune @@ -1,4 +1,4 @@ (tests (names test) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-random/dune b/compiler/tests-ocaml/lib-random/dune index 840bec2a7f..6c1c5e29e1 100644 --- a/compiler/tests-ocaml/lib-random/dune +++ b/compiler/tests-ocaml/lib-random/dune @@ -5,4 +5,5 @@ (libraries) (modes js + wasm (best exe))) diff --git a/compiler/tests-ocaml/lib-result/dune b/compiler/tests-ocaml/lib-result/dune index 9047167ba4..16342d6417 100644 --- a/compiler/tests-ocaml/lib-result/dune +++ b/compiler/tests-ocaml/lib-result/dune @@ -1,4 +1,4 @@ (tests (names test) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-seq/dune b/compiler/tests-ocaml/lib-seq/dune index 9047167ba4..16342d6417 100644 --- a/compiler/tests-ocaml/lib-seq/dune +++ b/compiler/tests-ocaml/lib-seq/dune @@ -1,4 +1,4 @@ (tests (names test) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-set/dune b/compiler/tests-ocaml/lib-set/dune index 9e8fed86d5..c0602be25e 100644 --- a/compiler/tests-ocaml/lib-set/dune +++ b/compiler/tests-ocaml/lib-set/dune @@ -1,4 +1,4 @@ (tests (names testmap testset) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-stack/dune b/compiler/tests-ocaml/lib-stack/dune index 9047167ba4..16342d6417 100644 --- a/compiler/tests-ocaml/lib-stack/dune +++ b/compiler/tests-ocaml/lib-stack/dune @@ -1,4 +1,4 @@ (tests (names test) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-str/dune b/compiler/tests-ocaml/lib-str/dune index 18b732190a..fe1e7b18c4 100644 --- a/compiler/tests-ocaml/lib-str/dune +++ b/compiler/tests-ocaml/lib-str/dune @@ -1,4 +1,4 @@ (tests (names t01) (libraries str) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-string/dune b/compiler/tests-ocaml/lib-string/dune index f1b08d6ad0..e3f41537b8 100644 --- a/compiler/tests-ocaml/lib-string/dune +++ b/compiler/tests-ocaml/lib-string/dune @@ -3,4 +3,4 @@ (build_if (>= %{ocaml_version} 5)) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/lib-uchar/dune b/compiler/tests-ocaml/lib-uchar/dune index 9047167ba4..16342d6417 100644 --- a/compiler/tests-ocaml/lib-uchar/dune +++ b/compiler/tests-ocaml/lib-uchar/dune @@ -1,4 +1,4 @@ (tests (names test) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/prim-bigstring/dune b/compiler/tests-ocaml/prim-bigstring/dune index 2e162bd45a..880fb9cd70 100644 --- a/compiler/tests-ocaml/prim-bigstring/dune +++ b/compiler/tests-ocaml/prim-bigstring/dune @@ -1,4 +1,4 @@ (tests (names bigstring_access string_access) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/prim-bswap/dune b/compiler/tests-ocaml/prim-bswap/dune index 36c5b217b1..a0328d664c 100644 --- a/compiler/tests-ocaml/prim-bswap/dune +++ b/compiler/tests-ocaml/prim-bswap/dune @@ -1,4 +1,4 @@ (tests (names bswap) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-ocaml/prim-revapply/dune b/compiler/tests-ocaml/prim-revapply/dune index bf4e90bb65..017e60f37c 100644 --- a/compiler/tests-ocaml/prim-revapply/dune +++ b/compiler/tests-ocaml/prim-revapply/dune @@ -1,4 +1,4 @@ (tests (names apply revapply) (libraries) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-re/dune b/compiler/tests-re/dune index 10c45d2c5b..e86d9c9347 100644 --- a/compiler/tests-re/dune +++ b/compiler/tests-re/dune @@ -6,4 +6,4 @@ (tests (names test_str) (libraries str re) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-runtime-events/dune b/compiler/tests-runtime-events/dune index f387de95eb..a8a208145f 100644 --- a/compiler/tests-runtime-events/dune +++ b/compiler/tests-runtime-events/dune @@ -8,4 +8,4 @@ (build_if (>= %{ocaml_version} 5.1.0)) (libraries runtime_events) - (modes js)) + (modes js wasm)) diff --git a/compiler/tests-sourcemap/dune b/compiler/tests-sourcemap/dune index c1e93c67f0..5fc08de8a1 100644 --- a/compiler/tests-sourcemap/dune +++ b/compiler/tests-sourcemap/dune @@ -7,10 +7,6 @@ (name test) (modules test) (modes js) - (enabled_if - (and - (<> %{profile} wasm) - (<> %{profile} wasm-effects))) (js_of_ocaml (link_flags (:standard --source-map-root /my/sourceRoot))) @@ -18,10 +14,6 @@ (library (name testlib) - (enabled_if - (and - (<> %{profile} wasm) - (<> %{profile} wasm-effects))) (modules a b c d)) (test diff --git a/compiler/tests-wasm_of_ocaml/dune b/compiler/tests-wasm_of_ocaml/dune index fc33f16583..0ae81f7992 100644 --- a/compiler/tests-wasm_of_ocaml/dune +++ b/compiler/tests-wasm_of_ocaml/dune @@ -1,5 +1,7 @@ (tests (names gh38 gh46 gh107 gh112) - (modes js) + (modes js wasm) (js_of_ocaml + (flags :standard --disable optcall --no-inline)) + (wasm_of_ocaml (flags :standard --disable optcall --no-inline))) diff --git a/dune b/dune index cb16ed5816..e9262722f3 100644 --- a/dune +++ b/dune @@ -1,8 +1,10 @@ (env (dev + (wasm_of_ocaml (enabled_if false)) (flags (:standard -w +a-4-40-41-42-44-48-58-66-70))) (using-effects + (wasm_of_ocaml (enabled_if false)) (js_of_ocaml (compilation_mode separate) (flags @@ -12,17 +14,17 @@ (wasm (binaries (tools/node_wrapper.sh as node)) - (js_of_ocaml - (compilation_mode separate) - (submodes wasm))) + (js_of_ocaml (enabled_if false)) + (wasm_of_ocaml + (compilation_mode separate))) (wasm-effects (binaries (tools/node_wrapper.sh as node)) - (js_of_ocaml + (js_of_ocaml (enabled_if false)) + (wasm_of_ocaml (compilation_mode separate) (flags - (:standard --enable effects)) - (submodes wasm))) + (:standard --enable effects)))) (bench_no_debug (flags (:standard \ -g)) diff --git a/examples/graphics/dune b/examples/graphics/dune index a563ee7739..cecdf24620 100644 --- a/examples/graphics/dune +++ b/examples/graphics/dune @@ -1,6 +1,6 @@ (executable (name main) - (modes js) + (modes js wasm) (libraries js_of_ocaml-lwt.graphics) (preprocess (pps js_of_ocaml-ppx))) diff --git a/examples/test_wheel/dune b/examples/test_wheel/dune index cd729978bc..ba4be3c0a9 100644 --- a/examples/test_wheel/dune +++ b/examples/test_wheel/dune @@ -1,6 +1,6 @@ (executables (names test_wheel) (libraries js_of_ocaml) - (modes js) + (modes js wasm) (preprocess (pps js_of_ocaml-ppx))) diff --git a/lib/deriving_json/tests/dune b/lib/deriving_json/tests/dune index 8834c59137..c1e0147b3d 100644 --- a/lib/deriving_json/tests/dune +++ b/lib/deriving_json/tests/dune @@ -2,6 +2,6 @@ (name deriving_expect_tests) (libraries unix js_of_ocaml js_of_ocaml.deriving) (inline_tests - (modes js)) + (modes js wasm)) (preprocess (pps ppx_expect ppx_deriving_json))) diff --git a/lib/tests/dune.inc b/lib/tests/dune.inc index b16a266b6d..c944536e87 100644 --- a/lib/tests/dune.inc +++ b/lib/tests/dune.inc @@ -5,7 +5,7 @@ (enabled_if true) (modules test_css_angle) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -15,7 +15,7 @@ (enabled_if true) (modules test_css_color) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -25,7 +25,7 @@ (enabled_if true) (modules test_css_length) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -35,7 +35,7 @@ (enabled_if (and (<> %{profile} using-effects) (<> %{profile} wasm) (<> %{profile} wasm-effects))) (modules test_fun_call) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -45,7 +45,7 @@ (enabled_if true) (modules test_fun_call_2) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -55,7 +55,7 @@ (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) (modules test_json) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -65,7 +65,7 @@ (enabled_if true) (modules test_nodejs_filesystem_errors) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -75,7 +75,7 @@ (enabled_if (and (<> %{profile} wasm) (<> %{profile} wasm-effects))) (modules test_poly_compare) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -85,7 +85,7 @@ (enabled_if true) (modules test_poly_equal) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -95,7 +95,7 @@ (enabled_if true) (modules test_regexp) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -105,7 +105,7 @@ (enabled_if (and (>= %{ocaml_version} 5) (<> %{profile} wasm) (<> %{profile} wasm-effects))) (modules test_sys) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -115,7 +115,7 @@ (enabled_if true) (modules test_typed_array) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -125,7 +125,7 @@ (enabled_if true) (modules test_unsafe_set_get) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -135,6 +135,6 @@ (enabled_if true) (modules test_url) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) diff --git a/lib/tests/gen-rules/gen.ml b/lib/tests/gen-rules/gen.ml index eda5eea71a..257fecc0dd 100644 --- a/lib/tests/gen-rules/gen.ml +++ b/lib/tests/gen-rules/gen.ml @@ -71,7 +71,7 @@ let () = (enabled_if %s) (modules %s) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) |} diff --git a/tools/ci_setup.ml b/tools/ci_setup.ml index dc94596a4d..d3a08f6c1e 100644 --- a/tools/ci_setup.ml +++ b/tools/ci_setup.ml @@ -29,7 +29,7 @@ let dune_workspace = (env (_ (env-vars (TESTING_FRAMEWORK inline-test)) - (js_of_ocaml (submodes wasm)) + (js_of_ocaml (enabled_if false)) (flags :standard -warn-error -8-32-34-49-52-55 -w -67-69))) |} @@ -54,6 +54,15 @@ index 91933ec..849e4d7 100644 ) ; ( "bignum" , {bignum| +diff --git a/dune-project b/dune-project +index e563d7e..b87e356 100644 +--- a/dune-project ++++ b/dune-project +@@ -1,3 +1,3 @@ +-(lang dune 2.0) ++(lang dune 3.17) + + (formatting disabled) diff --git a/test/src/dune b/test/src/dune index f93ae3f..3f00557 100644 --- a/test/src/dune @@ -62,7 +71,7 @@ index f93ae3f..3f00557 100644 (name bignum_test) (libraries bigint bignum core expect_test_helpers_core sexp_grammar_validation) -+ (inline_tests (flags -drop-tag no-js -drop-tag no-wasm -drop-tag 64-bits-only) (modes js)) ++ (inline_tests (flags -drop-tag no-js -drop-tag no-wasm -drop-tag 64-bits-only) (modes js wasm)) (preprocess (pps ppx_jane))) diff --git a/test/src/test_bignum.ml b/test/src/test_bignum.ml