From 69d66186f3be76af86753a2c70004e88dc1ffc85 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Sat, 11 Jan 2025 15:57:07 +0100 Subject: [PATCH 01/49] CI: test wasm on windows --- .github/workflows/build-wasm_of_ocaml.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 2f1d394e01..fdaddc2534 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -33,13 +33,18 @@ jobs: separate_compilation: true jane_street_tests: false all_jane_street_tests: false + - os: windows-latest + ocaml-compiler: "5.3" + separate_compilation: true + jane_street_tests: true + all_jane_street_tests: true - os: ubuntu-latest - ocaml-compiler: "5.2" + ocaml-compiler: "5.3" separate_compilation: true jane_street_tests: true all_jane_street_tests: true - os: ubuntu-latest - ocaml-compiler: "5.2" + ocaml-compiler: "5.3" separate_compilation: false jane_street_tests: true all_jane_street_tests: false From 336f15ffe02bb4d3b60a5353181f6ac4c9de489e Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Sun, 12 Jan 2025 13:29:56 +0100 Subject: [PATCH 02/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index fdaddc2534..e3faa6efcf 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -93,7 +93,7 @@ jobs: - name: Pin wasm_of_ocaml working-directory: ./wasm_of_ocaml - run: opam pin -n --with-version `< VERSION` . + run: opam pin -n --with-version 6.0 . - name: Checkout Jane Street packages if: matrix.jane_street_tests From 4b12d81af958fa913b42506170c80000a6cbcf48 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 13 Jan 2025 10:43:27 +0100 Subject: [PATCH 03/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 2 +- tools/ci_setup.ml | 10 +--------- tools/dune | 6 ++++++ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index e3faa6efcf..d280a138f7 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -100,7 +100,7 @@ jobs: run: | opam repo add js janestreet/opam-repository opam install opam-format ocamlfind dune graphics cmdliner - opam exec -- ocaml wasm_of_ocaml/tools/ci_setup.ml + opam exec -- dune exec wasm_of_ocaml/tools/ci_setup.exe - name: Pin Jane Street packages if: ${{ ! matrix.jane_street_tests }} diff --git a/tools/ci_setup.ml b/tools/ci_setup.ml index e35336f6ad..70644ae8a6 100644 --- a/tools/ci_setup.ml +++ b/tools/ci_setup.ml @@ -1,11 +1,3 @@ -#use "topfind" - -#require "opam-format" - -#require "unix" - -#require "str" - module StringSet = Set.Make (String) (****) @@ -137,7 +129,7 @@ let read_opam_file filename = ~pos:{ filename; start = 0, 0; stop = 0, 0 } (OpamParser.FullPos.file (Filename.concat (Filename.concat repo filename) "opam")) -let dependencies (_, { OpamFile.OPAM.depends }) = +let dependencies (_, { OpamFile.OPAM.depends; _ }) = let open OpamFormula in depends |> map (fun (nm, _) -> Atom (nm, None)) diff --git a/tools/dune b/tools/dune index 7532203a08..c5358bb23b 100644 --- a/tools/dune +++ b/tools/dune @@ -1,3 +1,9 @@ (executable (name node_wrapper) + (modules node_wrapper) (libraries unix)) + +(executable + (name ci_setup) + (modules ci_setup) + (libraries opam-format unix)) \ No newline at end of file From 2d65cd1cd6cc274e3918f489dd7f64a382a0c4e3 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 13 Jan 2025 10:43:47 +0100 Subject: [PATCH 04/49] WIP --- tools/dune | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/dune b/tools/dune index c5358bb23b..f5589b29cc 100644 --- a/tools/dune +++ b/tools/dune @@ -6,4 +6,4 @@ (executable (name ci_setup) (modules ci_setup) - (libraries opam-format unix)) \ No newline at end of file + (libraries opam-format unix)) From 935f988a15d226373f4307136d8761e80052c9d6 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 13 Jan 2025 10:50:16 +0100 Subject: [PATCH 05/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index d280a138f7..50ea4f443d 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -96,11 +96,12 @@ jobs: run: opam pin -n --with-version 6.0 . - name: Checkout Jane Street packages + working-directory: ./wasm_of_ocaml if: matrix.jane_street_tests run: | opam repo add js janestreet/opam-repository opam install opam-format ocamlfind dune graphics cmdliner - opam exec -- dune exec wasm_of_ocaml/tools/ci_setup.exe + opam exec -- dune exec tools/ci_setup.exe - name: Pin Jane Street packages if: ${{ ! matrix.jane_street_tests }} From 39b34e70b03254c14fe47411a2ebf180233ccda1 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 13 Jan 2025 10:55:04 +0100 Subject: [PATCH 06/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 50ea4f443d..2c712b1b8a 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -96,10 +96,14 @@ jobs: run: opam pin -n --with-version 6.0 . - name: Checkout Jane Street packages - working-directory: ./wasm_of_ocaml if: matrix.jane_street_tests run: | opam repo add js janestreet/opam-repository + + - name: Checkout Jane Street packages + working-directory: ./wasm_of_ocaml + if: matrix.jane_street_tests + run: | opam install opam-format ocamlfind dune graphics cmdliner opam exec -- dune exec tools/ci_setup.exe From d2ae8f874d63fa191d119554cb6d349d5add1401 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 13 Jan 2025 11:28:30 +0100 Subject: [PATCH 07/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 7 +------ tools/ci_setup.ml | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 2c712b1b8a..8780e68d8c 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -99,13 +99,8 @@ jobs: if: matrix.jane_street_tests run: | opam repo add js janestreet/opam-repository - - - name: Checkout Jane Street packages - working-directory: ./wasm_of_ocaml - if: matrix.jane_street_tests - run: | opam install opam-format ocamlfind dune graphics cmdliner - opam exec -- dune exec tools/ci_setup.exe + opam exec -- dune exec --root wasm_of_ocaml tools/ci_setup.exe - name: Pin Jane Street packages if: ${{ ! matrix.jane_street_tests }} diff --git a/tools/ci_setup.ml b/tools/ci_setup.ml index 70644ae8a6..3e4406bd14 100644 --- a/tools/ci_setup.ml +++ b/tools/ci_setup.ml @@ -2,7 +2,12 @@ module StringSet = Set.Make (String) (****) -let repo = "janestreet/opam-repository/packages" +let root = + match Sys.argv with + | [| _; root |] -> root + | _ -> "janestreet" + +let repo = Filename.concat root "opam-repository/packages" let roots = [ "bonsai_web_components"; "string_dict"; "ppx_html" ] @@ -187,12 +192,13 @@ let clone delay ?branch ?(depth = 1) nm src = exec_async ~delay (Printf.sprintf - "git clone -q --depth %d %s%s janestreet/lib/%s" + "git clone -q --depth %d %s%s %s/lib/%s" depth (match branch with | None -> "" | Some b -> Printf.sprintf "-b %s " b) src + root nm) let clone' delay ?branch ?commit nm src = @@ -202,12 +208,12 @@ let clone' delay ?branch ?commit nm src = let* () = clone delay ?branch ~depth:100 nm src in exec_async ~delay:0 - (Printf.sprintf "cd janestreet/lib/%s && git checkout -b wasm %s" nm commit) + (Printf.sprintf "cd %s/lib/%s && git checkout -b wasm %s" root nm commit) let () = let write f contents = Out_channel.( - with_open_bin (Filename.concat "janestreet" f) + with_open_bin (Filename.concat root f) @@ fun ch -> output_string ch contents) in let copy f f' = @@ -215,11 +221,11 @@ let () = In_channel.(with_open_bin (Filename.concat "wasm_of_ocaml" f) @@ input_all) in Out_channel.( - with_open_bin (Filename.concat "janestreet" f') + with_open_bin (Filename.concat root f') @@ fun ch -> output_string ch contents) in write "dune-workspace" dune_workspace; - Unix.mkdir "janestreet/node_wrapper" 0o755; + Unix.mkdir (Filename.concat root "node_wrapper") 0o755; List.iter (fun (f, contents) -> write f contents) node_wrapper; copy "tools/node_wrapper.ml" "node_wrapper/node_wrapper.ml" @@ -259,7 +265,7 @@ let () = List.iter (fun (dir, patch) -> let ch = - Unix.open_process_out (Printf.sprintf "cd janestreet/lib/%s && patch -p 1" dir) + Unix.open_process_out (Printf.sprintf "cd %s/lib/%s && patch -p 1" root dir) in output_string ch patch; ignore (Unix.close_process_out ch)) From cb5cabe9bcd6695011ed0343e8072e1f3fd6334b Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 13 Jan 2025 11:51:40 +0100 Subject: [PATCH 08/49] no sleep --- tools/ci_setup.ml | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/tools/ci_setup.ml b/tools/ci_setup.ml index 3e4406bd14..944bd1dc30 100644 --- a/tools/ci_setup.ml +++ b/tools/ci_setup.ml @@ -162,21 +162,18 @@ let rec traverse visited p = let is_forked p = StringSet.mem p forked_packages -let exec_async ~delay cmd = - let p = - Unix.open_process_out (Printf.sprintf "sleep %f; %s" (float delay /. 10.) cmd) - in +let exec_async cmd = + let p = Unix.open_process_out (Printf.sprintf "%s" cmd) in fun () -> ignore (Unix.close_process_out p) let ( let* ) (f : unit -> 'a) (g : 'a -> unit -> 'b) : unit -> 'b = fun () -> g (f ()) () let sync_exec f l = - let l = List.mapi f l in + let l = List.map f l in List.iter (fun f -> f ()) l -let pin delay nm = +let pin nm = exec_async - ~delay (Printf.sprintf "opam pin add -n %s https://github.com/ocaml-wasm/%s.git#wasm-v0.18" nm @@ -188,9 +185,8 @@ let install_others others = let others = StringSet.elements (StringSet.diff others omitted_others) in ignore (Sys.command ("opam install -y " ^ String.concat " " others)) -let clone delay ?branch ?(depth = 1) nm src = +let clone ?branch ?(depth = 1) nm src = exec_async - ~delay (Printf.sprintf "git clone -q --depth %d %s%s %s/lib/%s" depth @@ -201,14 +197,12 @@ let clone delay ?branch ?(depth = 1) nm src = root nm) -let clone' delay ?branch ?commit nm src = +let clone' ?branch ?commit nm src = match commit with - | None -> clone delay ?branch nm src + | None -> clone ?branch nm src | Some commit -> - let* () = clone delay ?branch ~depth:100 nm src in - exec_async - ~delay:0 - (Printf.sprintf "cd %s/lib/%s && git checkout -b wasm %s" root nm commit) + let* () = clone ?branch ~depth:100 nm src in + exec_async (Printf.sprintf "cd %s/lib/%s && git checkout -b wasm %s" root nm commit) let () = let write f contents = @@ -236,9 +230,9 @@ let () = in pin_packages (); install_others others; - sync_exec (fun i () -> clone i "ocaml-uri" "https://github.com/mirage/ocaml-uri") [ () ]; + sync_exec (fun () -> clone "ocaml-uri" "https://github.com/mirage/ocaml-uri") [ () ]; sync_exec - (fun i nm -> + (fun nm -> let branch = if is_forked nm then Some "wasm-v0.18" else None in let commit = if is_forked nm @@ -251,7 +245,6 @@ let () = String.sub tar_file 0 (String.index tar_file '.')) in clone' - i ?branch ?commit nm From e9240ca62f5da67a1bab360d8e7ebf07d8a50e5b Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 13 Jan 2025 12:55:55 +0100 Subject: [PATCH 09/49] 5.3 effect syntax --- .github/workflows/build-wasm_of_ocaml.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 8780e68d8c..9c3e7fcf9f 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -34,17 +34,17 @@ jobs: jane_street_tests: false all_jane_street_tests: false - os: windows-latest - ocaml-compiler: "5.3" + ocaml-compiler: "5.2" separate_compilation: true jane_street_tests: true all_jane_street_tests: true - os: ubuntu-latest - ocaml-compiler: "5.3" + ocaml-compiler: "5.2" separate_compilation: true jane_street_tests: true all_jane_street_tests: true - os: ubuntu-latest - ocaml-compiler: "5.3" + ocaml-compiler: "5.2" separate_compilation: false jane_street_tests: true all_jane_street_tests: false @@ -99,7 +99,7 @@ jobs: if: matrix.jane_street_tests run: | opam repo add js janestreet/opam-repository - opam install opam-format ocamlfind dune graphics cmdliner + opam install opam-format ocamlfind.1.9 dune graphics cmdliner opam exec -- dune exec --root wasm_of_ocaml tools/ci_setup.exe - name: Pin Jane Street packages From f1a0a7fe009cbe864df1b7dad80f2242b15c6a3f Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 13 Jan 2025 13:03:41 +0100 Subject: [PATCH 10/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 9c3e7fcf9f..f2b961da99 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -99,7 +99,7 @@ jobs: if: matrix.jane_street_tests run: | opam repo add js janestreet/opam-repository - opam install opam-format ocamlfind.1.9 dune graphics cmdliner + opam install opam-format ocamlfind.1.9.6 dune graphics cmdliner opam exec -- dune exec --root wasm_of_ocaml tools/ci_setup.exe - name: Pin Jane Street packages From 178e6a8d86f4b444ec85bc5bafd8b6afe6e87ab2 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 13 Jan 2025 13:29:58 +0100 Subject: [PATCH 11/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index f2b961da99..6c83d5889a 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -99,7 +99,8 @@ jobs: if: matrix.jane_street_tests run: | opam repo add js janestreet/opam-repository - opam install opam-format ocamlfind.1.9.6 dune graphics cmdliner + opam pin add ocamlfind --dev + opam install opam-format ocamlfind dune graphics cmdliner opam exec -- dune exec --root wasm_of_ocaml tools/ci_setup.exe - name: Pin Jane Street packages From 22565af82573cfd878c777d07ea6dbbb881ae876 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 13 Jan 2025 13:43:06 +0100 Subject: [PATCH 12/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 6c83d5889a..990846b81c 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -114,7 +114,8 @@ jobs: - name: Install wasm_of_ocaml and its test dependencies working-directory: ./wasm_of_ocaml run: | - opam install `basename -s .opam *.opam` num cohttp-lwt-unix ppx_expect cstruct + opam install ./ + opam install num cohttp-lwt-unix ppx_expect cstruct - name: Run tests if: ${{ matrix.separate_compilation }} From 78cb4dc1af438be53137571f7670e6583f75ead5 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 13 Jan 2025 21:07:26 +0100 Subject: [PATCH 13/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 990846b81c..71a9a74267 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -36,8 +36,8 @@ jobs: - os: windows-latest ocaml-compiler: "5.2" separate_compilation: true - jane_street_tests: true - all_jane_street_tests: true + jane_street_tests: false + all_jane_street_tests: false - os: ubuntu-latest ocaml-compiler: "5.2" separate_compilation: true From be753c17a121cea8248f3060f69bab90c1815999 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 13 Jan 2025 22:56:29 +0100 Subject: [PATCH 14/49] WIP --- dune-project | 1 + wasm_of_ocaml-compiler.opam | 1 + 2 files changed, 2 insertions(+) diff --git a/dune-project b/dune-project index 1cb47d81d2..9a9aa2c405 100644 --- a/dune-project +++ b/dune-project @@ -146,6 +146,7 @@ (ppxlib (>= 0.15.0)) (re :with-test) (cmdliner (>= 1.1.0)) + (opam-format :with-test) (sedlex (>= 2.3)) menhir menhirLib diff --git a/wasm_of_ocaml-compiler.opam b/wasm_of_ocaml-compiler.opam index b145d310e0..bcb3f21403 100644 --- a/wasm_of_ocaml-compiler.opam +++ b/wasm_of_ocaml-compiler.opam @@ -20,6 +20,7 @@ depends: [ "ppxlib" {>= "0.15.0"} "re" {with-test} "cmdliner" {>= "1.1.0"} + "opam-format" {with-test} "sedlex" {>= "2.3"} "menhir" "menhirLib" From 4d07ad13310f1b5b447a19102e0591bd375b00f4 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 13 Jan 2025 23:01:34 +0100 Subject: [PATCH 15/49] WIP --- compiler/lib-wasm/binaryen.ml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/compiler/lib-wasm/binaryen.ml b/compiler/lib-wasm/binaryen.ml index 93b0b7b7fb..dbe29b0ce5 100644 --- a/compiler/lib-wasm/binaryen.ml +++ b/compiler/lib-wasm/binaryen.ml @@ -20,11 +20,13 @@ open Stdlib let debug = Debug.find "binaryen" -let command cmdline = +let command ~output_file cmdline = let cmdline = String.concat ~sep:" " cmdline in if debug () then Format.eprintf "+ %s@." cmdline; let res = Sys.command cmdline in - if res <> 0 then failwith ("the following command terminated unsuccessfully: " ^ cmdline) + if res <> 0 then failwith ("the following command terminated unsuccessfully: " ^ cmdline); + if not (Sys.file_exists output_file) + then failwith (Printf.sprintf "the following command didn't generate the expected file (%s): %s" output_file cmdline) let common_options () = let l = @@ -46,7 +48,7 @@ let opt_flag flag v = | Some v -> [ flag; Filename.quote v ] let link ~runtime_files ~input_files ~opt_output_sourcemap ~output_file = - command + command ~output_file ("wasm-merge" :: (common_options () @ List.flatten @@ -98,7 +100,7 @@ let dead_code_elimination @@ fun usage_file -> let primitives = Linker.list_all () in Fs.write_file ~name:deps_file ~contents:(generate_dependencies ~dependencies primitives); - command + command ~output_file ("wasm-metadce" :: (common_options () @ [ "--graph-file"; Filename.quote deps_file; Filename.quote input_file ] @@ -121,7 +123,7 @@ let optimize ~profile ~opt_input_sourcemap ~input_file ~opt_output_sourcemap ~ou | None -> 1 | Some p -> fst (List.find ~f:(fun (_, p') -> Poly.equal p p') Driver.profiles) in - command + command ~output_file ("wasm-opt" :: (common_options () @ optimization_options.(level - 1) From b94dc61b4060f5123a7ccb7d95010393e1afc94e Mon Sep 17 00:00:00 2001 From: hhugo Date: Mon, 13 Jan 2025 23:16:36 +0100 Subject: [PATCH 16/49] Update build-wasm_of_ocaml.yml --- .github/workflows/build-wasm_of_ocaml.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 71a9a74267..d3b2d224c2 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -90,7 +90,13 @@ jobs: - name: Pin faked binaryen-bin package # It's faster to use a cached version run: opam install --fake binaryen-bin - + + # Work-around a race between reinstalling mingw-w64-shims + # (because of conf-pkg-config optional dep) and installing other + # packages that implicitly depend on mingw-w64-shims. + - run: opam install conf-pkg-config + if: runner.os == 'Windows' + - name: Pin wasm_of_ocaml working-directory: ./wasm_of_ocaml run: opam pin -n --with-version 6.0 . From 1c90615e5caa8629f7d4aa5acc8cfbd8c098396b Mon Sep 17 00:00:00 2001 From: hugo heuzard Date: Tue, 14 Jan 2025 15:06:18 +0100 Subject: [PATCH 17/49] WIP --- runtime/wasm/runtime.js | 6 ++++++ runtime/wasm/sys.wat | 10 ++++++---- runtime/wasm/unix.wat | 7 +++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/runtime/wasm/runtime.js b/runtime/wasm/runtime.js index 00adc8f4a6..1dbbcf1b2a 100644 --- a/runtime/wasm/runtime.js +++ b/runtime/wasm/runtime.js @@ -397,6 +397,12 @@ channel_list, exit: (n) => isNode && process.exit(n), argv: () => (isNode ? process.argv.slice(1) : ["a.out"]), + ostype: () => + globalThis.process && + globalThis.process.platform && + globalThis.process.platform === "win32" + ? "Win32" + : "Unix", getenv: (n) => (isNode ? process.env[n] : null), system: (c) => { var res = require("node:child_process").spawnSync(c, { diff --git a/runtime/wasm/sys.wat b/runtime/wasm/sys.wat index b397c89a82..de0f8ca50b 100644 --- a/runtime/wasm/sys.wat +++ b/runtime/wasm/sys.wat @@ -36,6 +36,7 @@ (func $caml_raise_sys_error (param (ref eq)))) (import "fail" "caml_raise_not_found" (func $caml_raise_not_found)) (import "bindings" "argv" (func $argv (result (ref extern)))) + (import "bindings" "ostype" (func $ostype (result anyref))) (import "bindings" "system" (func $system (param anyref) (result (ref eq)))) (import "bindings" "getenv" (func $getenv (param anyref) (result anyref))) (import "bindings" "time" (func $time (result f64))) @@ -136,26 +137,27 @@ (func (export "caml_sys_const_ostype_unix") (param (ref eq)) (result (ref eq)) ;; ZZZ - (ref.i31 (i32.const 1))) + (ref.i31 (i32.const 0))) (func (export "caml_sys_const_ostype_win32") (param (ref eq)) (result (ref eq)) ;; ZZZ - (ref.i31 (i32.const 0))) + (ref.i31 (i32.const 1))) (func (export "caml_sys_const_ostype_cygwin") (param (ref eq)) (result (ref eq)) ;; ZZZ (ref.i31 (i32.const 0))) - (data $Unix "Unix") + (func $get_os_type (result (ref eq)) + (return_call $caml_string_of_jsstring (call $wrap (call $ostype)))) (func (export "caml_sys_get_config") (param (ref eq)) (result (ref eq)) ;; ZZZ ;; (call $log_js (string.const "caml_sys_get_config")) (array.new_fixed $block 4 (ref.i31 (i32.const 0)) - (array.new_data $string $Unix (i32.const 0) (i32.const 4)) + (call $get_os_type) (ref.i31 (i32.const 32)) (ref.i31 (i32.const 0)))) diff --git a/runtime/wasm/unix.wat b/runtime/wasm/unix.wat index 797a3b3f3f..4740b129ee 100644 --- a/runtime/wasm/unix.wat +++ b/runtime/wasm/unix.wat @@ -99,4 +99,11 @@ (func $unix_inet_addr_of_string (export "unix_inet_addr_of_string") (param (ref eq)) (result (ref eq)) (ref.i31 (i32.const 0))) + (export "caml_unix_filedescr_of_fd" (func $unix_filedescr_of_fd)) + (func $unix_filedescr_of_fd (export "unix_filedescr_of_fd") + (param (ref eq)) (result (ref eq)) + (local.get 0)) + (func $unix_cleanup (export "caml_unix_cleanup") + (param (ref eq)) (result (ref eq)) + (ref.i31 (i32.const 0))) ) From 6c5d2c678fc8ba0b4d0bf59e99c93e648f7fb34a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Tue, 14 Jan 2025 16:09:43 +0100 Subject: [PATCH 18/49] Pin dune --- .github/workflows/build-wasm_of_ocaml.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index d3b2d224c2..a26bee388d 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -97,6 +97,9 @@ jobs: - run: opam install conf-pkg-config if: runner.os == 'Windows' + - name: Pin dune + run: opam pin add -n dune https://github.com/vouillon/dune.git#inline-tests-wasm + - name: Pin wasm_of_ocaml working-directory: ./wasm_of_ocaml run: opam pin -n --with-version 6.0 . From 52dcd72f06e694cba3292c19ac6af43f6f0c39d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Tue, 14 Jan 2025 16:15:22 +0100 Subject: [PATCH 19/49] Short dir name --- compiler/lib-wasm/link.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/lib-wasm/link.ml b/compiler/lib-wasm/link.ml index d043d0833e..467f95f232 100644 --- a/compiler/lib-wasm/link.ml +++ b/compiler/lib-wasm/link.ml @@ -691,7 +691,7 @@ let gen_dir dir f = let d_tmp = Filename.temp_file_name ~temp_dir:(Filename.dirname dir) - (Filename.basename dir) + "assets" ".tmp" in try From 28a2bfa97a423af31a1f917f797643183e9c0406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Tue, 14 Jan 2025 16:27:47 +0100 Subject: [PATCH 20/49] WIP --- runtime/wasm/runtime.js | 7 +------ runtime/wasm/sys.wat | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/runtime/wasm/runtime.js b/runtime/wasm/runtime.js index 1dbbcf1b2a..c2da5cf458 100644 --- a/runtime/wasm/runtime.js +++ b/runtime/wasm/runtime.js @@ -397,12 +397,7 @@ channel_list, exit: (n) => isNode && process.exit(n), argv: () => (isNode ? process.argv.slice(1) : ["a.out"]), - ostype: () => - globalThis.process && - globalThis.process.platform && - globalThis.process.platform === "win32" - ? "Win32" - : "Unix", + on_windows: () => globalThis?.process?.versions?.node === "win32", getenv: (n) => (isNode ? process.env[n] : null), system: (c) => { var res = require("node:child_process").spawnSync(c, { diff --git a/runtime/wasm/sys.wat b/runtime/wasm/sys.wat index de0f8ca50b..dcb7c0b813 100644 --- a/runtime/wasm/sys.wat +++ b/runtime/wasm/sys.wat @@ -36,7 +36,7 @@ (func $caml_raise_sys_error (param (ref eq)))) (import "fail" "caml_raise_not_found" (func $caml_raise_not_found)) (import "bindings" "argv" (func $argv (result (ref extern)))) - (import "bindings" "ostype" (func $ostype (result anyref))) + (import "bindings" "on_windows" (func $on_windows (result i32))) (import "bindings" "system" (func $system (param anyref) (result (ref eq)))) (import "bindings" "getenv" (func $getenv (param anyref) (result anyref))) (import "bindings" "time" (func $time (result f64))) @@ -136,28 +136,27 @@ (func (export "caml_sys_const_ostype_unix") (param (ref eq)) (result (ref eq)) - ;; ZZZ - (ref.i31 (i32.const 0))) + (ref.i31 (i32.eqz (call $on_windows)))) (func (export "caml_sys_const_ostype_win32") (param (ref eq)) (result (ref eq)) - ;; ZZZ - (ref.i31 (i32.const 1))) + (ref.i31 (call $on_windows))) (func (export "caml_sys_const_ostype_cygwin") (param (ref eq)) (result (ref eq)) - ;; ZZZ (ref.i31 (i32.const 0))) - (func $get_os_type (result (ref eq)) - (return_call $caml_string_of_jsstring (call $wrap (call $ostype)))) + (data $Unix "Unix") + (data $Win32 "Win32") (func (export "caml_sys_get_config") (param (ref eq)) (result (ref eq)) - ;; ZZZ - ;; (call $log_js (string.const "caml_sys_get_config")) (array.new_fixed $block 4 (ref.i31 (i32.const 0)) - (call $get_os_type) + (if (result (ref eq)) (call $on_windows) + (then + (array.new_data $string $Win32 (i32.const 0) (i32.const 5))) + (else + (array.new_data $string $Unix (i32.const 0) (i32.const 4)))) (ref.i31 (i32.const 32)) (ref.i31 (i32.const 0)))) From 21262ab77f1ba76aaf7683ab8f949a66e143b278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Tue, 14 Jan 2025 16:47:42 +0100 Subject: [PATCH 21/49] WIP --- runtime/wasm/runtime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/wasm/runtime.js b/runtime/wasm/runtime.js index c2da5cf458..f41982a08e 100644 --- a/runtime/wasm/runtime.js +++ b/runtime/wasm/runtime.js @@ -397,7 +397,7 @@ channel_list, exit: (n) => isNode && process.exit(n), argv: () => (isNode ? process.argv.slice(1) : ["a.out"]), - on_windows: () => globalThis?.process?.versions?.node === "win32", + on_windows: () => isNode && process.platform === "win32", getenv: (n) => (isNode ? process.env[n] : null), system: (c) => { var res = require("node:child_process").spawnSync(c, { From 7fc5b900313a70b5e70b080eb61d6ed41ec0f428 Mon Sep 17 00:00:00 2001 From: hugo heuzard Date: Tue, 14 Jan 2025 17:21:17 +0100 Subject: [PATCH 22/49] shorter names --- compiler/tests-jsoo/dune | 8 ++++---- compiler/tests-jsoo/lib-effects/dune | 2 +- lib/deriving_json/tests/dune | 2 +- lib/tests/dune.inc | 20 +++++++++---------- ...js_filesystem_errors.ml => test_fs_err.ml} | 0 runtime/wasm/dune | 4 ---- 6 files changed, 16 insertions(+), 20 deletions(-) rename lib/tests/{test_nodejs_filesystem_errors.ml => test_fs_err.ml} (100%) diff --git a/compiler/tests-jsoo/dune b/compiler/tests-jsoo/dune index 26f79c9284..f2a96a315a 100644 --- a/compiler/tests-jsoo/dune +++ b/compiler/tests-jsoo/dune @@ -1,5 +1,5 @@ (library - (name jsoo_testsuite_latest) + (name j__latest) (modules test_io test_floats) (libraries unix compiler-libs.common js_of_ocaml-compiler) (enabled_if @@ -10,7 +10,7 @@ (pps ppx_expect))) (library - (name jsoo_testsuite_compression) + (name j__compression) (modules test_marshal_compressed) (libraries unix compiler-libs.common js_of_ocaml-compiler) (enabled_if @@ -21,7 +21,7 @@ (pps ppx_expect))) (library - (name jsoo_testsuite_parsing) + (name j__parsing) (modules test_parsing calc_parser calc_lexer) (libraries unix compiler-libs.common js_of_ocaml-compiler) (enabled_if @@ -32,7 +32,7 @@ (pps ppx_expect))) (library - (name jsoo_testsuite) + (name j__common) (modules (:standard \ diff --git a/compiler/tests-jsoo/lib-effects/dune b/compiler/tests-jsoo/lib-effects/dune index 66df040883..d2d8f835cd 100644 --- a/compiler/tests-jsoo/lib-effects/dune +++ b/compiler/tests-jsoo/lib-effects/dune @@ -5,7 +5,7 @@ (:standard --enable effects))))) (library - (name jsoo_testsuite_effect) + (name j__effect) (enabled_if (>= %{ocaml_version} 5)) (inline_tests diff --git a/lib/deriving_json/tests/dune b/lib/deriving_json/tests/dune index c1e0147b3d..db333a5553 100644 --- a/lib/deriving_json/tests/dune +++ b/lib/deriving_json/tests/dune @@ -1,5 +1,5 @@ (library - (name deriving_expect_tests) + (name j__deriving) (libraries unix js_of_ocaml js_of_ocaml.deriving) (inline_tests (modes js wasm)) diff --git a/lib/tests/dune.inc b/lib/tests/dune.inc index 85b9beb929..ccd3583b97 100644 --- a/lib/tests/dune.inc +++ b/lib/tests/dune.inc @@ -29,6 +29,16 @@ (preprocess (pps ppx_js_internal ppx_expect))) +(library + ;; lib/tests/test_fs_err.ml + (name test_fs_err_75) + (enabled_if true) + (modules test_fs_err) + (libraries js_of_ocaml unix) + (inline_tests (modes js wasm)) + (preprocess + (pps ppx_js_internal ppx_expect))) + (library ;; lib/tests/test_fun_call.ml (name test_fun_call_75) @@ -59,16 +69,6 @@ (preprocess (pps ppx_js_internal ppx_expect))) -(library - ;; lib/tests/test_nodejs_filesystem_errors.ml - (name test_nodejs_filesystem_errors_75) - (enabled_if true) - (modules test_nodejs_filesystem_errors) - (libraries js_of_ocaml unix) - (inline_tests (modes js wasm)) - (preprocess - (pps ppx_js_internal ppx_expect))) - (library ;; lib/tests/test_poly_compare.ml (name test_poly_compare_75) diff --git a/lib/tests/test_nodejs_filesystem_errors.ml b/lib/tests/test_fs_err.ml similarity index 100% rename from lib/tests/test_nodejs_filesystem_errors.ml rename to lib/tests/test_fs_err.ml diff --git a/runtime/wasm/dune b/runtime/wasm/dune index 90422c0f9d..3b14fbd662 100644 --- a/runtime/wasm/dune +++ b/runtime/wasm/dune @@ -55,10 +55,6 @@ (glob_files *.wat)) (action (progn - (bash - "which wasm-merge > /dev/null || (echo 'Error: Binaryen tools not found in the PATH'; false)") - (bash - "wasm-merge --version | grep -q 'version \\(11[89]\\|1[2-9][0-9]\\)' || (echo 'Error: Binaryen version 118 or greater is currently required'; false)") (run wasm-merge -g From 41d721f0d01b3001166853f48f6625c187040a14 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Tue, 14 Jan 2025 17:27:45 +0100 Subject: [PATCH 23/49] WIP --- CHANGES.md | 1 + compiler/lib-wasm/binaryen.ml | 16 ++++++++++++---- compiler/lib-wasm/link.ml | 7 +------ tools/ci_setup.ml | 6 ++---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6544e2495e..4908bfeaf2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ * Compiler/Runtime: Make resuming a continuation more efficient in js (#1765) * Lib: Add other textMetrics property (#1784) * Misc: move tests to OCaml 5.3 +* Test: run wasm tests on windows ## Bug fixes * Fix small bug in global data flow analysis (#1768) diff --git a/compiler/lib-wasm/binaryen.ml b/compiler/lib-wasm/binaryen.ml index dbe29b0ce5..f028f0c18c 100644 --- a/compiler/lib-wasm/binaryen.ml +++ b/compiler/lib-wasm/binaryen.ml @@ -26,7 +26,12 @@ let command ~output_file cmdline = let res = Sys.command cmdline in if res <> 0 then failwith ("the following command terminated unsuccessfully: " ^ cmdline); if not (Sys.file_exists output_file) - then failwith (Printf.sprintf "the following command didn't generate the expected file (%s): %s" output_file cmdline) + then + failwith + (Printf.sprintf + "the following command didn't generate the expected file (%s): %s" + output_file + cmdline) let common_options () = let l = @@ -48,7 +53,8 @@ let opt_flag flag v = | Some v -> [ flag; Filename.quote v ] let link ~runtime_files ~input_files ~opt_output_sourcemap ~output_file = - command ~output_file + command + ~output_file ("wasm-merge" :: (common_options () @ List.flatten @@ -100,7 +106,8 @@ let dead_code_elimination @@ fun usage_file -> let primitives = Linker.list_all () in Fs.write_file ~name:deps_file ~contents:(generate_dependencies ~dependencies primitives); - command ~output_file + command + ~output_file ("wasm-metadce" :: (common_options () @ [ "--graph-file"; Filename.quote deps_file; Filename.quote input_file ] @@ -123,7 +130,8 @@ let optimize ~profile ~opt_input_sourcemap ~input_file ~opt_output_sourcemap ~ou | None -> 1 | Some p -> fst (List.find ~f:(fun (_, p') -> Poly.equal p p') Driver.profiles) in - command ~output_file + command + ~output_file ("wasm-opt" :: (common_options () @ optimization_options.(level - 1) diff --git a/compiler/lib-wasm/link.ml b/compiler/lib-wasm/link.ml index 467f95f232..b5822d31ea 100644 --- a/compiler/lib-wasm/link.ml +++ b/compiler/lib-wasm/link.ml @@ -688,12 +688,7 @@ let remove_directory path = with Sys_error _ -> () let gen_dir dir f = - let d_tmp = - Filename.temp_file_name - ~temp_dir:(Filename.dirname dir) - "assets" - ".tmp" - in + let d_tmp = Filename.temp_file_name ~temp_dir:(Filename.dirname dir) "assets" ".tmp" in try let res = f d_tmp in remove_directory dir; diff --git a/tools/ci_setup.ml b/tools/ci_setup.ml index 944bd1dc30..1067846ee5 100644 --- a/tools/ci_setup.ml +++ b/tools/ci_setup.ml @@ -207,16 +207,14 @@ let clone' ?branch ?commit nm src = let () = let write f contents = Out_channel.( - with_open_bin (Filename.concat root f) - @@ fun ch -> output_string ch contents) + with_open_bin (Filename.concat root f) @@ fun ch -> output_string ch contents) in let copy f f' = let contents = In_channel.(with_open_bin (Filename.concat "wasm_of_ocaml" f) @@ input_all) in Out_channel.( - with_open_bin (Filename.concat root f') - @@ fun ch -> output_string ch contents) + with_open_bin (Filename.concat root f') @@ fun ch -> output_string ch contents) in write "dune-workspace" dune_workspace; Unix.mkdir (Filename.concat root "node_wrapper") 0o755; From a3ca5d6d294975cdc218fb66c2f931da72770028 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Tue, 14 Jan 2025 20:31:31 +0100 Subject: [PATCH 24/49] shorter names --- compiler/tests-jsoo/dune | 2 +- lib/tests/{test_css_angle.ml => css_a.ml} | 0 lib/tests/{test_css_color.ml => css_c.ml} | 0 lib/tests/{test_css_length.ml => css_l.ml} | 0 lib/tests/dune.inc | 96 +++++++++---------- lib/tests/{test_fun_call.ml => fcall.ml} | 0 lib/tests/{test_fun_call_2.ml => fcall2.ml} | 0 lib/tests/{test_fs_err.ml => fserr.ml} | 0 lib/tests/{test_json.ml => json.ml} | 0 .../{test_poly_compare.ml => poly_comp.ml} | 0 lib/tests/{test_poly_equal.ml => poly_eq.ml} | 0 lib/tests/{test_regexp.ml => regexp.ml} | 0 lib/tests/{test_sys.ml => sys.ml} | 0 .../{test_typed_array.ml => typedarray.ml} | 0 .../{test_unsafe_set_get.ml => uget_uset.ml} | 0 lib/tests/{test_url.ml => url.ml} | 0 16 files changed, 49 insertions(+), 49 deletions(-) rename lib/tests/{test_css_angle.ml => css_a.ml} (100%) rename lib/tests/{test_css_color.ml => css_c.ml} (100%) rename lib/tests/{test_css_length.ml => css_l.ml} (100%) rename lib/tests/{test_fun_call.ml => fcall.ml} (100%) rename lib/tests/{test_fun_call_2.ml => fcall2.ml} (100%) rename lib/tests/{test_fs_err.ml => fserr.ml} (100%) rename lib/tests/{test_json.ml => json.ml} (100%) rename lib/tests/{test_poly_compare.ml => poly_comp.ml} (100%) rename lib/tests/{test_poly_equal.ml => poly_eq.ml} (100%) rename lib/tests/{test_regexp.ml => regexp.ml} (100%) rename lib/tests/{test_sys.ml => sys.ml} (100%) rename lib/tests/{test_typed_array.ml => typedarray.ml} (100%) rename lib/tests/{test_unsafe_set_get.ml => uget_uset.ml} (100%) rename lib/tests/{test_url.ml => url.ml} (100%) diff --git a/compiler/tests-jsoo/dune b/compiler/tests-jsoo/dune index f2a96a315a..ebc441b217 100644 --- a/compiler/tests-jsoo/dune +++ b/compiler/tests-jsoo/dune @@ -10,7 +10,7 @@ (pps ppx_expect))) (library - (name j__compression) + (name j__comp) (modules test_marshal_compressed) (libraries unix compiler-libs.common js_of_ocaml-compiler) (enabled_if diff --git a/lib/tests/test_css_angle.ml b/lib/tests/css_a.ml similarity index 100% rename from lib/tests/test_css_angle.ml rename to lib/tests/css_a.ml diff --git a/lib/tests/test_css_color.ml b/lib/tests/css_c.ml similarity index 100% rename from lib/tests/test_css_color.ml rename to lib/tests/css_c.ml diff --git a/lib/tests/test_css_length.ml b/lib/tests/css_l.ml similarity index 100% rename from lib/tests/test_css_length.ml rename to lib/tests/css_l.ml diff --git a/lib/tests/dune.inc b/lib/tests/dune.inc index ccd3583b97..30ec01d108 100644 --- a/lib/tests/dune.inc +++ b/lib/tests/dune.inc @@ -1,139 +1,139 @@ (library - ;; lib/tests/test_css_angle.ml - (name test_css_angle_75) + ;; lib/tests/css_a.ml + (name css_a_75) (enabled_if true) - (modules test_css_angle) + (modules css_a) (libraries js_of_ocaml unix) (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) (library - ;; lib/tests/test_css_color.ml - (name test_css_color_75) + ;; lib/tests/css_c.ml + (name css_c_75) (enabled_if true) - (modules test_css_color) + (modules css_c) (libraries js_of_ocaml unix) (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) (library - ;; lib/tests/test_css_length.ml - (name test_css_length_75) + ;; lib/tests/css_l.ml + (name css_l_75) (enabled_if true) - (modules test_css_length) + (modules css_l) (libraries js_of_ocaml unix) (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) (library - ;; lib/tests/test_fs_err.ml - (name test_fs_err_75) + ;; lib/tests/fcall.ml + (name fcall_75) (enabled_if true) - (modules test_fs_err) + (modules fcall) (libraries js_of_ocaml unix) (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) (library - ;; lib/tests/test_fun_call.ml - (name test_fun_call_75) - (enabled_if (<> %{profile} with-effects)) - (modules test_fun_call) + ;; lib/tests/fcall2.ml + (name fcall2_75) + (enabled_if true) + (modules fcall2) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) (library - ;; lib/tests/test_fun_call_2.ml - (name test_fun_call_2_75) + ;; lib/tests/fserr.ml + (name fserr_75) (enabled_if true) - (modules test_fun_call_2) + (modules fserr) (libraries js_of_ocaml unix) (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) (library - ;; lib/tests/test_json.ml - (name test_json_75) + ;; lib/tests/json.ml + (name json_75) (enabled_if true) - (modules test_json) + (modules json) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) (library - ;; lib/tests/test_poly_compare.ml - (name test_poly_compare_75) + ;; lib/tests/poly_comp.ml + (name poly_comp_75) (enabled_if true) - (modules test_poly_compare) + (modules poly_comp) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) (library - ;; lib/tests/test_poly_equal.ml - (name test_poly_equal_75) + ;; lib/tests/poly_eq.ml + (name poly_eq_75) (enabled_if true) - (modules test_poly_equal) + (modules poly_eq) (libraries js_of_ocaml unix) (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) (library - ;; lib/tests/test_regexp.ml - (name test_regexp_75) + ;; lib/tests/regexp.ml + (name regexp_75) (enabled_if true) - (modules test_regexp) + (modules regexp) (libraries js_of_ocaml unix) (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) (library - ;; lib/tests/test_sys.ml - (name test_sys_75) - (enabled_if (>= %{ocaml_version} 5)) - (modules test_sys) + ;; lib/tests/sys.ml + (name sys_75) + (enabled_if true) + (modules sys) (libraries js_of_ocaml unix) - (inline_tests (modes js)) + (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) (library - ;; lib/tests/test_typed_array.ml - (name test_typed_array_75) + ;; lib/tests/typedarray.ml + (name typedarray_75) (enabled_if true) - (modules test_typed_array) + (modules typedarray) (libraries js_of_ocaml unix) (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) (library - ;; lib/tests/test_unsafe_set_get.ml - (name test_unsafe_set_get_75) + ;; lib/tests/uget_uset.ml + (name uget_uset_75) (enabled_if true) - (modules test_unsafe_set_get) + (modules uget_uset) (libraries js_of_ocaml unix) (inline_tests (modes js wasm)) (preprocess (pps ppx_js_internal ppx_expect))) (library - ;; lib/tests/test_url.ml - (name test_url_75) + ;; lib/tests/url.ml + (name url_75) (enabled_if true) - (modules test_url) + (modules url) (libraries js_of_ocaml unix) (inline_tests (modes js wasm)) (preprocess diff --git a/lib/tests/test_fun_call.ml b/lib/tests/fcall.ml similarity index 100% rename from lib/tests/test_fun_call.ml rename to lib/tests/fcall.ml diff --git a/lib/tests/test_fun_call_2.ml b/lib/tests/fcall2.ml similarity index 100% rename from lib/tests/test_fun_call_2.ml rename to lib/tests/fcall2.ml diff --git a/lib/tests/test_fs_err.ml b/lib/tests/fserr.ml similarity index 100% rename from lib/tests/test_fs_err.ml rename to lib/tests/fserr.ml diff --git a/lib/tests/test_json.ml b/lib/tests/json.ml similarity index 100% rename from lib/tests/test_json.ml rename to lib/tests/json.ml diff --git a/lib/tests/test_poly_compare.ml b/lib/tests/poly_comp.ml similarity index 100% rename from lib/tests/test_poly_compare.ml rename to lib/tests/poly_comp.ml diff --git a/lib/tests/test_poly_equal.ml b/lib/tests/poly_eq.ml similarity index 100% rename from lib/tests/test_poly_equal.ml rename to lib/tests/poly_eq.ml diff --git a/lib/tests/test_regexp.ml b/lib/tests/regexp.ml similarity index 100% rename from lib/tests/test_regexp.ml rename to lib/tests/regexp.ml diff --git a/lib/tests/test_sys.ml b/lib/tests/sys.ml similarity index 100% rename from lib/tests/test_sys.ml rename to lib/tests/sys.ml diff --git a/lib/tests/test_typed_array.ml b/lib/tests/typedarray.ml similarity index 100% rename from lib/tests/test_typed_array.ml rename to lib/tests/typedarray.ml diff --git a/lib/tests/test_unsafe_set_get.ml b/lib/tests/uget_uset.ml similarity index 100% rename from lib/tests/test_unsafe_set_get.ml rename to lib/tests/uget_uset.ml diff --git a/lib/tests/test_url.ml b/lib/tests/url.ml similarity index 100% rename from lib/tests/test_url.ml rename to lib/tests/url.ml From d374d7d5c455521c7e957022a7b6b823818fb7fa Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Tue, 14 Jan 2025 21:27:19 +0100 Subject: [PATCH 25/49] WIP --- lib/tests/poly_eq.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tests/poly_eq.ml b/lib/tests/poly_eq.ml index 0f6cf095ea..f96aee814b 100644 --- a/lib/tests/poly_eq.ml +++ b/lib/tests/poly_eq.ml @@ -24,7 +24,7 @@ let%expect_test "poly equal" = assert (obj1 = obj2); assert (not (obj1 = obj2)); () -[@@expect.uncaught_exn {| "Assert_failure lib/tests/test_poly_equal.ml:24:2" |}] +[@@expect.uncaught_exn {| "Assert_failure lib/tests/poly_eq.ml:24:2" |}] let%expect_test "poly equal neg" = let obj1 = Js.Unsafe.obj [||] in From ba54716dbc4db2af2999a355c370c7e8c3b4978e Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Tue, 14 Jan 2025 21:27:19 +0100 Subject: [PATCH 26/49] WIP --- lib/tests/dune.inc | 12 ++++++------ lib/tests/gen-rules/gen.ml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/tests/dune.inc b/lib/tests/dune.inc index 30ec01d108..3b7b71c3e9 100644 --- a/lib/tests/dune.inc +++ b/lib/tests/dune.inc @@ -32,10 +32,10 @@ (library ;; lib/tests/fcall.ml (name fcall_75) - (enabled_if true) + (enabled_if (<> %{profile} with-effects)) (modules fcall) (libraries js_of_ocaml unix) - (inline_tests (modes js wasm)) + (inline_tests (modes js)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -65,7 +65,7 @@ (enabled_if true) (modules json) (libraries js_of_ocaml unix) - (inline_tests (modes js wasm)) + (inline_tests (modes js)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -75,7 +75,7 @@ (enabled_if true) (modules poly_comp) (libraries js_of_ocaml unix) - (inline_tests (modes js wasm)) + (inline_tests (modes js)) (preprocess (pps ppx_js_internal ppx_expect))) @@ -102,10 +102,10 @@ (library ;; lib/tests/sys.ml (name sys_75) - (enabled_if true) + (enabled_if (>= %{ocaml_version} 5)) (modules sys) (libraries js_of_ocaml unix) - (inline_tests (modes js wasm)) + (inline_tests (modes js)) (preprocess (pps ppx_js_internal ppx_expect))) diff --git a/lib/tests/gen-rules/gen.ml b/lib/tests/gen-rules/gen.ml index 980e2f0cc8..d4b2f39578 100644 --- a/lib/tests/gen-rules/gen.ml +++ b/lib/tests/gen-rules/gen.ml @@ -53,9 +53,9 @@ type enabled_if = | Any let enabled_if = function - | "test_sys" -> GE5 - | "test_fun_call" -> No_effects_not_wasm - | "test_json" | "test_poly_compare" -> Not_wasm + | "sys" -> GE5 + | "fcall" -> No_effects_not_wasm + | "json" | "poly_comp" -> Not_wasm | _ -> Any let () = From 0b87a9f46fe5897e08a709c699c2a38cd0cfd7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Tue, 14 Jan 2025 22:43:12 +0100 Subject: [PATCH 27/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index a26bee388d..a45ed158cd 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -36,7 +36,7 @@ jobs: - os: windows-latest ocaml-compiler: "5.2" separate_compilation: true - jane_street_tests: false + jane_street_tests: true all_jane_street_tests: false - os: ubuntu-latest ocaml-compiler: "5.2" From d5ad99e4c917f11e081fd556160b723d91729a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Tue, 14 Jan 2025 22:58:00 +0100 Subject: [PATCH 28/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index a45ed158cd..d0ffb50c38 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -94,7 +94,7 @@ jobs: # Work-around a race between reinstalling mingw-w64-shims # (because of conf-pkg-config optional dep) and installing other # packages that implicitly depend on mingw-w64-shims. - - run: opam install conf-pkg-config + - run: opam install conf-pkg-config conf-mingw-w64-gcc-i686 if: runner.os == 'Windows' - name: Pin dune From 008e2397254e916bfa4b547c32f4cb75df07d13f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Tue, 14 Jan 2025 23:39:50 +0100 Subject: [PATCH 29/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index d0ffb50c38..fc86a75b5b 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -53,7 +53,7 @@ jobs: steps: - name: Set git to use LF - if: ${{ matrix.os == 'windows-latest' && matrix.ocaml-compiler < 5.2 }} + if: ${{ matrix.os == 'windows-latest' }} run: | git config --global core.autocrlf false git config --global core.eol lf @@ -123,7 +123,7 @@ jobs: - name: Install wasm_of_ocaml and its test dependencies working-directory: ./wasm_of_ocaml run: | - opam install ./ + opam install . opam install num cohttp-lwt-unix ppx_expect cstruct - name: Run tests From b4d6e0d7bdccfd46fd8578faa19fd9d36c55873f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Tue, 14 Jan 2025 23:56:33 +0100 Subject: [PATCH 30/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index fc86a75b5b..1045eaa4db 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -37,7 +37,7 @@ jobs: ocaml-compiler: "5.2" separate_compilation: true jane_street_tests: true - all_jane_street_tests: false + all_jane_street_tests: true - os: ubuntu-latest ocaml-compiler: "5.2" separate_compilation: true From 4a34c64f68cf07466a1022c52b3ab3bf58713919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 00:29:14 +0100 Subject: [PATCH 31/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 1045eaa4db..0e90f40c18 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -144,7 +144,7 @@ jobs: - name: Run Base bigstring tests if: matrix.all_jane_street_tests working-directory: ./janestreet/lib/base_bigstring - run: opam exec -- dune runtest + run: opam exec -- dune runtest --sandbox=none - name: Run Core tests if: matrix.all_jane_street_tests From 9a5e0b749f3612e1ce03aa1ae7df385aad09eb78 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Wed, 15 Jan 2025 07:52:06 +0100 Subject: [PATCH 32/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 34 +++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 0e90f40c18..ea8f378471 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -70,7 +70,7 @@ jobs: with: repository: janestreet/opam-repository ref: 41c89c7824533f6b63cc5b6d75e6ddb1441d1520 - path: janestreet/opam-repository + path: j/opam-repository - name: Set-up Node.js uses: actions/setup-node@v4 @@ -107,10 +107,10 @@ jobs: - name: Checkout Jane Street packages if: matrix.jane_street_tests run: | - opam repo add js janestreet/opam-repository + opam repo add js j/opam-repository opam pin add ocamlfind --dev opam install opam-format ocamlfind dune graphics cmdliner - opam exec -- dune exec --root wasm_of_ocaml tools/ci_setup.exe + opam exec -- dune exec --root wasm_of_ocaml tools/ci_setup.exe j - name: Pin Jane Street packages if: ${{ ! matrix.jane_street_tests }} @@ -138,70 +138,70 @@ jobs: - name: Run Base tests if: matrix.all_jane_street_tests - working-directory: ./janestreet/lib/base + working-directory: ./j/lib/base run: opam exec -- dune runtest - name: Run Base bigstring tests if: matrix.all_jane_street_tests - working-directory: ./janestreet/lib/base_bigstring + working-directory: ./j/lib/base_bigstring run: opam exec -- dune runtest --sandbox=none - name: Run Core tests if: matrix.all_jane_street_tests - working-directory: ./janestreet/lib/core + working-directory: ./j/lib/core run: opam exec -- dune runtest - name: Run Bignum tests if: matrix.all_jane_street_tests - working-directory: ./janestreet/lib/bignum + working-directory: ./j/lib/bignum run: opam exec -- dune runtest - name: Run Bin_prot tests if: matrix.all_jane_street_tests - working-directory: ./janestreet/lib/bin_prot + working-directory: ./j/lib/bin_prot run: opam exec -- dune runtest - name: Run String_dict tests if: matrix.all_jane_street_tests - working-directory: ./janestreet/lib/string_dict + working-directory: ./j/lib/string_dict run: opam exec -- dune runtest - name: Run Zarith tests if: matrix.all_jane_street_tests - working-directory: ./janestreet/lib/zarith_stubs_js + working-directory: ./j/lib/zarith_stubs_js run: opam exec -- dune runtest - name: Run Virtual_dom tests if: matrix.all_jane_street_tests - working-directory: ./janestreet/lib/virtual_dom + working-directory: ./j/lib/virtual_dom run: opam exec -- dune runtest - name: Run Bonsai tests if: matrix.all_jane_street_tests - working-directory: ./janestreet/lib/bonsai_test + working-directory: ./j/lib/bonsai_test run: opam exec -- dune runtest - name: Run Bonsai web tests if: matrix.all_jane_street_tests - working-directory: ./janestreet/lib/bonsai_web_test + working-directory: ./j/lib/bonsai_web_test run: opam exec -- dune runtest - name: Run Bonsai web components' tests if: matrix.all_jane_street_tests - working-directory: ./janestreet/lib/bonsai_web_components + working-directory: ./j/lib/bonsai_web_components run: opam exec -- dune runtest - name: Run Bonsai tests (release profile) if: ${{ ! matrix.separate_compilation }} - working-directory: ./janestreet/lib/bonsai_test + working-directory: ./j/lib/bonsai_test run: opam exec -- dune runtest --profile release - name: Run Bonsai web tests (release profile) if: ${{ ! matrix.separate_compilation }} - working-directory: ./janestreet/lib/bonsai_web_test + working-directory: ./j/lib/bonsai_web_test run: opam exec -- dune runtest --profile release - name: Run Bonsai web components' tests (release profile) if: ${{ ! matrix.separate_compilation }} - working-directory: ./janestreet/lib/bonsai_web_components + working-directory: ./j/lib/bonsai_web_components run: opam exec -- dune runtest --profile release From cdad73808c7cfbd26411eb7d906bcb51556d15b4 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Wed, 15 Jan 2025 07:51:11 +0100 Subject: [PATCH 33/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index ea8f378471..773ff1bceb 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -62,7 +62,7 @@ jobs: - name: Checkout tree uses: actions/checkout@v4 with: - path: wasm_of_ocaml + path: w - name: Checkout Jane Street opam repository if: matrix.jane_street_tests @@ -101,7 +101,7 @@ jobs: run: opam pin add -n dune https://github.com/vouillon/dune.git#inline-tests-wasm - name: Pin wasm_of_ocaml - working-directory: ./wasm_of_ocaml + working-directory: ./w run: opam pin -n --with-version 6.0 . - name: Checkout Jane Street packages @@ -110,7 +110,7 @@ jobs: opam repo add js j/opam-repository opam pin add ocamlfind --dev opam install opam-format ocamlfind dune graphics cmdliner - opam exec -- dune exec --root wasm_of_ocaml tools/ci_setup.exe j + opam exec -- dune exec --root w tools/ci_setup.exe j - name: Pin Jane Street packages if: ${{ ! matrix.jane_street_tests }} @@ -121,19 +121,19 @@ jobs: opam pin add -n ppx_expect.v0.16.1 https://github.com/ocaml-wasm/ppx_expect.git#wasm - name: Install wasm_of_ocaml and its test dependencies - working-directory: ./wasm_of_ocaml + working-directory: ./w run: | opam install . opam install num cohttp-lwt-unix ppx_expect cstruct - name: Run tests if: ${{ matrix.separate_compilation }} - working-directory: ./wasm_of_ocaml + working-directory: ./w run: opam exec -- dune build @runtest-wasm - name: Run tests with CPS effects if: ${{ matrix.ocaml-compiler >= '5.' && matrix.separate_compilation }} - working-directory: ./wasm_of_ocaml + working-directory: ./w run: opam exec -- dune build @runtest-wasm --profile with-effects - name: Run Base tests From e9d04fc39c8e7d772ffbb781b67807ad79afee5e Mon Sep 17 00:00:00 2001 From: hhugo Date: Wed, 15 Jan 2025 09:19:00 +0100 Subject: [PATCH 34/49] Update ci_setup.ml --- tools/ci_setup.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_setup.ml b/tools/ci_setup.ml index 1067846ee5..140fc6ce2f 100644 --- a/tools/ci_setup.ml +++ b/tools/ci_setup.ml @@ -211,7 +211,7 @@ let () = in let copy f f' = let contents = - In_channel.(with_open_bin (Filename.concat "wasm_of_ocaml" f) @@ input_all) + In_channel.(with_open_bin (Filename.concat "w" f) @@ input_all) in Out_channel.( with_open_bin (Filename.concat root f') @@ fun ch -> output_string ch contents) From 44b7e07ac8fbf601a66c4e3450230b57f4d51474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 14:38:59 +0100 Subject: [PATCH 35/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 11 +++++---- runtime/wasm/dune | 27 +++++++++++------------ 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 773ff1bceb..798fc68bb0 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -90,25 +90,24 @@ jobs: - name: Pin faked binaryen-bin package # It's faster to use a cached version run: opam install --fake binaryen-bin - + # Work-around a race between reinstalling mingw-w64-shims # (because of conf-pkg-config optional dep) and installing other # packages that implicitly depend on mingw-w64-shims. - run: opam install conf-pkg-config conf-mingw-w64-gcc-i686 if: runner.os == 'Windows' - + - name: Pin dune run: opam pin add -n dune https://github.com/vouillon/dune.git#inline-tests-wasm - name: Pin wasm_of_ocaml working-directory: ./w - run: opam pin -n --with-version 6.0 . + run: cat VERSION | xargs opam pin . -n --with-version - name: Checkout Jane Street packages if: matrix.jane_street_tests run: | opam repo add js j/opam-repository - opam pin add ocamlfind --dev opam install opam-format ocamlfind dune graphics cmdliner opam exec -- dune exec --root w tools/ci_setup.exe j @@ -142,9 +141,9 @@ jobs: run: opam exec -- dune runtest - name: Run Base bigstring tests - if: matrix.all_jane_street_tests + if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} working-directory: ./j/lib/base_bigstring - run: opam exec -- dune runtest --sandbox=none + run: opam exec -- dune runtest - name: Run Core tests if: matrix.all_jane_street_tests diff --git a/runtime/wasm/dune b/runtime/wasm/dune index 3b14fbd662..3bbc0a5fc6 100644 --- a/runtime/wasm/dune +++ b/runtime/wasm/dune @@ -54,20 +54,19 @@ args (glob_files *.wat)) (action - (progn - (run - wasm-merge - -g - --enable-gc - --enable-exception-handling - --enable-reference-types - --enable-tail-call - --enable-strings - --enable-multivalue - --enable-bulk-memory - %{read-lines:args} - -o - %{target})))) + (run + wasm-merge + -g + --enable-gc + --enable-exception-handling + --enable-reference-types + --enable-tail-call + --enable-strings + --enable-multivalue + --enable-bulk-memory + %{read-lines:args} + -o + %{target}))) (rule (target args) From e81d097cafb1cd0b25941a5f5e3dcce1995e1b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 14:48:09 +0100 Subject: [PATCH 36/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 798fc68bb0..178d1dffa2 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -102,6 +102,7 @@ jobs: - name: Pin wasm_of_ocaml working-directory: ./w + shell: bash run: cat VERSION | xargs opam pin . -n --with-version - name: Checkout Jane Street packages From f88fda27a0a0d31c8539bdcb12f2a43a4e2d43bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 14:50:36 +0100 Subject: [PATCH 37/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 178d1dffa2..b3c05b56b1 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -100,11 +100,6 @@ jobs: - name: Pin dune run: opam pin add -n dune https://github.com/vouillon/dune.git#inline-tests-wasm - - name: Pin wasm_of_ocaml - working-directory: ./w - shell: bash - run: cat VERSION | xargs opam pin . -n --with-version - - name: Checkout Jane Street packages if: matrix.jane_street_tests run: | From c962838f2644cebd1ff75b014d8bbc0fb732f634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 15:04:01 +0100 Subject: [PATCH 38/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index b3c05b56b1..7433d1e909 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -100,6 +100,10 @@ jobs: - name: Pin dune run: opam pin add -n dune https://github.com/vouillon/dune.git#inline-tests-wasm + - name: Pin wasm_of_ocaml + working-directory: ./w + run: opam pin . -n --with-version dev + - name: Checkout Jane Street packages if: matrix.jane_street_tests run: | From a565e831042e9e27106720c6e29702743d0239b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 15:18:03 +0100 Subject: [PATCH 39/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 7433d1e909..019dac7d2c 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -146,7 +146,7 @@ jobs: run: opam exec -- dune runtest - name: Run Core tests - if: matrix.all_jane_street_tests + if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} working-directory: ./j/lib/core run: opam exec -- dune runtest From 891e806d97c2731660509c0b2bb10b95e9965378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 15:24:51 +0100 Subject: [PATCH 40/49] WIP --- tools/ci_setup.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_setup.ml b/tools/ci_setup.ml index 140fc6ce2f..43239ba6df 100644 --- a/tools/ci_setup.ml +++ b/tools/ci_setup.ml @@ -11,7 +11,7 @@ let repo = Filename.concat root "opam-repository/packages" let roots = [ "bonsai_web_components"; "string_dict"; "ppx_html" ] -let omitted_others = StringSet.of_list [ "cohttp-async"; "cohttp"; "uri"; "uri-sexp" ] +let omitted_others = StringSet.of_list [ "cohttp-async"; "cohttp"; "uri"; "uri-sexp"; "cstruct"; "uucp"; "odoc-parser" ] let omitted_js = StringSet.of_list [ "sexplib0" ] From 26f5d4845019c16d1bd8dc62b4242e7eb56ebf54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 15:36:15 +0100 Subject: [PATCH 41/49] WIP --- tools/ci_setup.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/ci_setup.ml b/tools/ci_setup.ml index 43239ba6df..cf3256b02a 100644 --- a/tools/ci_setup.ml +++ b/tools/ci_setup.ml @@ -228,6 +228,7 @@ let () = in pin_packages (); install_others others; + ignore (Sys.command ("opam install -y uucp")); sync_exec (fun () -> clone "ocaml-uri" "https://github.com/mirage/ocaml-uri") [ () ]; sync_exec (fun nm -> From dda5aa312d81e026922dd8036c0e2be0583b30c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 15:48:03 +0100 Subject: [PATCH 42/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 4 ++-- tools/ci_setup.ml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 019dac7d2c..70f05c02a8 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -123,7 +123,7 @@ jobs: working-directory: ./w run: | opam install . - opam install num cohttp-lwt-unix ppx_expect cstruct + opam install num cohttp-lwt-unix ppx_expect cstruct uucp - name: Run tests if: ${{ matrix.separate_compilation }} @@ -156,7 +156,7 @@ jobs: run: opam exec -- dune runtest - name: Run Bin_prot tests - if: matrix.all_jane_street_tests + if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} working-directory: ./j/lib/bin_prot run: opam exec -- dune runtest diff --git a/tools/ci_setup.ml b/tools/ci_setup.ml index cf3256b02a..43239ba6df 100644 --- a/tools/ci_setup.ml +++ b/tools/ci_setup.ml @@ -228,7 +228,6 @@ let () = in pin_packages (); install_others others; - ignore (Sys.command ("opam install -y uucp")); sync_exec (fun () -> clone "ocaml-uri" "https://github.com/mirage/ocaml-uri") [ () ]; sync_exec (fun nm -> From 47da34e295b5de5779f1462d76e8c620b3ad66ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 16:36:02 +0100 Subject: [PATCH 43/49] clean-up --- compiler/lib-wasm/binaryen.ml | 14 ++------------ tools/ci_setup.ml | 10 +++++----- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/compiler/lib-wasm/binaryen.ml b/compiler/lib-wasm/binaryen.ml index f028f0c18c..93b0b7b7fb 100644 --- a/compiler/lib-wasm/binaryen.ml +++ b/compiler/lib-wasm/binaryen.ml @@ -20,18 +20,11 @@ open Stdlib let debug = Debug.find "binaryen" -let command ~output_file cmdline = +let command cmdline = let cmdline = String.concat ~sep:" " cmdline in if debug () then Format.eprintf "+ %s@." cmdline; let res = Sys.command cmdline in - if res <> 0 then failwith ("the following command terminated unsuccessfully: " ^ cmdline); - if not (Sys.file_exists output_file) - then - failwith - (Printf.sprintf - "the following command didn't generate the expected file (%s): %s" - output_file - cmdline) + if res <> 0 then failwith ("the following command terminated unsuccessfully: " ^ cmdline) let common_options () = let l = @@ -54,7 +47,6 @@ let opt_flag flag v = let link ~runtime_files ~input_files ~opt_output_sourcemap ~output_file = command - ~output_file ("wasm-merge" :: (common_options () @ List.flatten @@ -107,7 +99,6 @@ let dead_code_elimination let primitives = Linker.list_all () in Fs.write_file ~name:deps_file ~contents:(generate_dependencies ~dependencies primitives); command - ~output_file ("wasm-metadce" :: (common_options () @ [ "--graph-file"; Filename.quote deps_file; Filename.quote input_file ] @@ -131,7 +122,6 @@ let optimize ~profile ~opt_input_sourcemap ~input_file ~opt_output_sourcemap ~ou | Some p -> fst (List.find ~f:(fun (_, p') -> Poly.equal p p') Driver.profiles) in command - ~output_file ("wasm-opt" :: (common_options () @ optimization_options.(level - 1) diff --git a/tools/ci_setup.ml b/tools/ci_setup.ml index 43239ba6df..c8396a4d74 100644 --- a/tools/ci_setup.ml +++ b/tools/ci_setup.ml @@ -11,7 +11,9 @@ let repo = Filename.concat root "opam-repository/packages" let roots = [ "bonsai_web_components"; "string_dict"; "ppx_html" ] -let omitted_others = StringSet.of_list [ "cohttp-async"; "cohttp"; "uri"; "uri-sexp"; "cstruct"; "uucp"; "odoc-parser" ] +let omitted_others = + StringSet.of_list + [ "cohttp-async"; "cohttp"; "uri"; "uri-sexp"; "cstruct"; "uucp"; "odoc-parser" ] let omitted_js = StringSet.of_list [ "sexplib0" ] @@ -163,7 +165,7 @@ let rec traverse visited p = let is_forked p = StringSet.mem p forked_packages let exec_async cmd = - let p = Unix.open_process_out (Printf.sprintf "%s" cmd) in + let p = Unix.open_process_out cmd in fun () -> ignore (Unix.close_process_out p) let ( let* ) (f : unit -> 'a) (g : 'a -> unit -> 'b) : unit -> 'b = fun () -> g (f ()) () @@ -210,9 +212,7 @@ let () = with_open_bin (Filename.concat root f) @@ fun ch -> output_string ch contents) in let copy f f' = - let contents = - In_channel.(with_open_bin (Filename.concat "w" f) @@ input_all) - in + let contents = In_channel.(with_open_bin (Filename.concat "w" f) @@ input_all) in Out_channel.( with_open_bin (Filename.concat root f') @@ fun ch -> output_string ch contents) in From 5794b91ae424ae16b193dcb533f4e5f65cc18ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 17:13:38 +0100 Subject: [PATCH 44/49] DEBUG --- .github/workflows/build-wasm_of_ocaml.yml | 68 +++++++++++------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 70f05c02a8..04490c55f6 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -125,40 +125,40 @@ jobs: opam install . opam install num cohttp-lwt-unix ppx_expect cstruct uucp - - name: Run tests - if: ${{ matrix.separate_compilation }} - working-directory: ./w - run: opam exec -- dune build @runtest-wasm - - - name: Run tests with CPS effects - if: ${{ matrix.ocaml-compiler >= '5.' && matrix.separate_compilation }} - working-directory: ./w - run: opam exec -- dune build @runtest-wasm --profile with-effects - - - name: Run Base tests - if: matrix.all_jane_street_tests - working-directory: ./j/lib/base - run: opam exec -- dune runtest - - - name: Run Base bigstring tests - if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} - working-directory: ./j/lib/base_bigstring - run: opam exec -- dune runtest - - - name: Run Core tests - if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} - working-directory: ./j/lib/core - run: opam exec -- dune runtest - - - name: Run Bignum tests - if: matrix.all_jane_street_tests - working-directory: ./j/lib/bignum - run: opam exec -- dune runtest - - - name: Run Bin_prot tests - if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} - working-directory: ./j/lib/bin_prot - run: opam exec -- dune runtest +# - name: Run tests +# if: ${{ matrix.separate_compilation }} +# working-directory: ./w +# run: opam exec -- dune build @runtest-wasm +# +# - name: Run tests with CPS effects +# if: ${{ matrix.ocaml-compiler >= '5.' && matrix.separate_compilation }} +# working-directory: ./w +# run: opam exec -- dune build @runtest-wasm --profile with-effects +# +# - name: Run Base tests +# if: matrix.all_jane_street_tests +# working-directory: ./j/lib/base +# run: opam exec -- dune runtest +# +# - name: Run Base bigstring tests +# if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} +# working-directory: ./j/lib/base_bigstring +# run: opam exec -- dune runtest +# +# - name: Run Core tests +# if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} +# working-directory: ./j/lib/core +# run: opam exec -- dune runtest +# +# - name: Run Bignum tests +# if: matrix.all_jane_street_tests +# working-directory: ./j/lib/bignum +# run: opam exec -- dune runtest +# +# - name: Run Bin_prot tests +# if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} +# working-directory: ./j/lib/bin_prot +# run: opam exec -- dune runtest - name: Run String_dict tests if: matrix.all_jane_street_tests From 180a8424fa690cb8f98944ad19744faf5e458cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 18:22:22 +0100 Subject: [PATCH 45/49] DEBUG --- .github/workflows/build-wasm_of_ocaml.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 04490c55f6..d1b43b84b6 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -159,11 +159,11 @@ jobs: # if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} # working-directory: ./j/lib/bin_prot # run: opam exec -- dune runtest - - - name: Run String_dict tests - if: matrix.all_jane_street_tests - working-directory: ./j/lib/string_dict - run: opam exec -- dune runtest +# +# - name: Run String_dict tests +# if: matrix.all_jane_street_tests +# working-directory: ./j/lib/string_dict +# run: opam exec -- dune runtest - name: Run Zarith tests if: matrix.all_jane_street_tests From ff24e375959615b5bd2465cf5798f8c5bbac6b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 19:40:58 +0100 Subject: [PATCH 46/49] DEBUG --- .github/workflows/build-wasm_of_ocaml.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index d1b43b84b6..e3779115c5 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -141,11 +141,13 @@ jobs: # run: opam exec -- dune runtest # # - name: Run Base bigstring tests +# # sandboxing issue # if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} # working-directory: ./j/lib/base_bigstring # run: opam exec -- dune runtest # # - name: Run Core tests +# # tests fails on windows # if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} # working-directory: ./j/lib/core # run: opam exec -- dune runtest @@ -156,6 +158,7 @@ jobs: # run: opam exec -- dune runtest # # - name: Run Bin_prot tests +# # tests fails on windows # if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} # working-directory: ./j/lib/bin_prot # run: opam exec -- dune runtest @@ -164,11 +167,12 @@ jobs: # if: matrix.all_jane_street_tests # working-directory: ./j/lib/string_dict # run: opam exec -- dune runtest - - - name: Run Zarith tests - if: matrix.all_jane_street_tests - working-directory: ./j/lib/zarith_stubs_js - run: opam exec -- dune runtest +# +# - name: Run Zarith tests +# # sandboxing issue +# if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} +# working-directory: ./j/lib/zarith_stubs_js +# run: opam exec -- dune runtest - name: Run Virtual_dom tests if: matrix.all_jane_street_tests From a6edf0324cd74362caf3f730a0731f838fc70d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 21:00:49 +0100 Subject: [PATCH 47/49] DEBUG --- .github/workflows/build-wasm_of_ocaml.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index e3779115c5..4a6cb49d40 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -173,11 +173,11 @@ jobs: # if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} # working-directory: ./j/lib/zarith_stubs_js # run: opam exec -- dune runtest - - - name: Run Virtual_dom tests - if: matrix.all_jane_street_tests - working-directory: ./j/lib/virtual_dom - run: opam exec -- dune runtest +# +# - name: Run Virtual_dom tests +# if: matrix.all_jane_street_tests +# working-directory: ./j/lib/virtual_dom +# run: opam exec -- dune runtest - name: Run Bonsai tests if: matrix.all_jane_street_tests From 48b6ac758558d21e5edb5a96ec93c26e1f4e6914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 21:26:30 +0100 Subject: [PATCH 48/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 105 +++++++++++----------- 1 file changed, 51 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 4a6cb49d40..74d302a0da 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -37,7 +37,7 @@ jobs: ocaml-compiler: "5.2" separate_compilation: true jane_street_tests: true - all_jane_street_tests: true + all_jane_street_tests: false - os: ubuntu-latest ocaml-compiler: "5.2" separate_compilation: true @@ -125,59 +125,56 @@ jobs: opam install . opam install num cohttp-lwt-unix ppx_expect cstruct uucp -# - name: Run tests -# if: ${{ matrix.separate_compilation }} -# working-directory: ./w -# run: opam exec -- dune build @runtest-wasm -# -# - name: Run tests with CPS effects -# if: ${{ matrix.ocaml-compiler >= '5.' && matrix.separate_compilation }} -# working-directory: ./w -# run: opam exec -- dune build @runtest-wasm --profile with-effects -# -# - name: Run Base tests -# if: matrix.all_jane_street_tests -# working-directory: ./j/lib/base -# run: opam exec -- dune runtest -# -# - name: Run Base bigstring tests -# # sandboxing issue -# if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} -# working-directory: ./j/lib/base_bigstring -# run: opam exec -- dune runtest -# -# - name: Run Core tests -# # tests fails on windows -# if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} -# working-directory: ./j/lib/core -# run: opam exec -- dune runtest -# -# - name: Run Bignum tests -# if: matrix.all_jane_street_tests -# working-directory: ./j/lib/bignum -# run: opam exec -- dune runtest -# -# - name: Run Bin_prot tests -# # tests fails on windows -# if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} -# working-directory: ./j/lib/bin_prot -# run: opam exec -- dune runtest -# -# - name: Run String_dict tests -# if: matrix.all_jane_street_tests -# working-directory: ./j/lib/string_dict -# run: opam exec -- dune runtest -# -# - name: Run Zarith tests -# # sandboxing issue -# if: ${{ matrix.all_jane_street_tests && matrix.os != 'windows-latest'}} -# working-directory: ./j/lib/zarith_stubs_js -# run: opam exec -- dune runtest -# -# - name: Run Virtual_dom tests -# if: matrix.all_jane_street_tests -# working-directory: ./j/lib/virtual_dom -# run: opam exec -- dune runtest + - name: Run tests + if: ${{ matrix.separate_compilation }} + working-directory: ./w + run: opam exec -- dune build @runtest-wasm + + - name: Run tests with CPS effects + if: ${{ matrix.ocaml-compiler >= '5.' && matrix.separate_compilation }} + working-directory: ./w + run: opam exec -- dune build @runtest-wasm --profile with-effects + + - name: Run Base tests + if: ${{ matrix.all_jane_street_tests || matrix.os == 'windows-latest' }} + working-directory: ./j/lib/base + run: opam exec -- dune runtest + + - name: Run Base bigstring tests + if: matrix.all_jane_street_tests + working-directory: ./j/lib/base_bigstring + run: opam exec -- dune runtest + + - name: Run Core tests + if: matrix.all_jane_street_tests + working-directory: ./j/lib/core + run: opam exec -- dune runtest + + - name: Run Bignum tests + if: ${{ matrix.all_jane_street_tests || matrix.os == 'windows-latest' }} + working-directory: ./j/lib/bignum + run: opam exec -- dune runtest + + - name: Run Bin_prot tests + # tests fails on windows + if: matrix.all_jane_street_tests + working-directory: ./j/lib/bin_prot + run: opam exec -- dune runtest + + - name: Run String_dict tests + if: ${{ matrix.all_jane_street_tests || matrix.os == 'windows-latest' }} + working-directory: ./j/lib/string_dict + run: opam exec -- dune runtest + + - name: Run Zarith tests + if: matrix.all_jane_street_tests + working-directory: ./j/lib/zarith_stubs_js + run: opam exec -- dune runtest + + - name: Run Virtual_dom tests + if: matrix.all_jane_street_tests + working-directory: ./j/lib/virtual_dom + run: opam exec -- dune runtest - name: Run Bonsai tests if: matrix.all_jane_street_tests From 5f2daf59d3e0f02b95180049621b020f6accdf64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 15 Jan 2025 21:52:15 +0100 Subject: [PATCH 49/49] WIP --- .github/workflows/build-wasm_of_ocaml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index 74d302a0da..fc6e57342b 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -162,7 +162,7 @@ jobs: run: opam exec -- dune runtest - name: Run String_dict tests - if: ${{ matrix.all_jane_street_tests || matrix.os == 'windows-latest' }} + if: matrix.all_jane_street_tests working-directory: ./j/lib/string_dict run: opam exec -- dune runtest