Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: test wasm on windows #1796

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
69d6618
CI: test wasm on windows
hhugo Jan 11, 2025
336f15f
WIP
hhugo Jan 12, 2025
4b12d81
WIP
hhugo Jan 13, 2025
2d65cd1
WIP
hhugo Jan 13, 2025
935f988
WIP
hhugo Jan 13, 2025
39b34e7
WIP
hhugo Jan 13, 2025
d2ae8f8
WIP
hhugo Jan 13, 2025
cb5cabe
no sleep
hhugo Jan 13, 2025
e9240ca
5.3 effect syntax
hhugo Jan 13, 2025
f1a0a7f
WIP
hhugo Jan 13, 2025
178e6a8
WIP
hhugo Jan 13, 2025
22565af
WIP
hhugo Jan 13, 2025
78cb4dc
WIP
hhugo Jan 13, 2025
be753c1
WIP
hhugo Jan 13, 2025
4d07ad1
WIP
hhugo Jan 13, 2025
b94dc61
Update build-wasm_of_ocaml.yml
hhugo Jan 13, 2025
1c90615
WIP
hhugo Jan 14, 2025
6c5d2c6
Pin dune
vouillon Jan 14, 2025
52dcd72
Short dir name
vouillon Jan 14, 2025
28a2bfa
WIP
vouillon Jan 14, 2025
21262ab
WIP
vouillon Jan 14, 2025
7fc5b90
shorter names
hhugo Jan 14, 2025
41d721f
WIP
hhugo Jan 14, 2025
a3ca5d6
shorter names
hhugo Jan 14, 2025
d374d7d
WIP
hhugo Jan 14, 2025
ba54716
WIP
hhugo Jan 14, 2025
0b87a9f
WIP
vouillon Jan 14, 2025
d5ad99e
WIP
vouillon Jan 14, 2025
008e239
WIP
vouillon Jan 14, 2025
b4d6e0d
WIP
vouillon Jan 14, 2025
4a34c64
WIP
vouillon Jan 14, 2025
9a5e0b7
WIP
hhugo Jan 15, 2025
cdad738
WIP
hhugo Jan 15, 2025
e9d04fc
Update ci_setup.ml
hhugo Jan 15, 2025
44b7e07
WIP
vouillon Jan 15, 2025
e81d097
WIP
vouillon Jan 15, 2025
f88fda2
WIP
vouillon Jan 15, 2025
c962838
WIP
vouillon Jan 15, 2025
a565e83
WIP
vouillon Jan 15, 2025
891e806
WIP
vouillon Jan 15, 2025
26f5d48
WIP
vouillon Jan 15, 2025
dda5aa3
WIP
vouillon Jan 15, 2025
47da34e
clean-up
vouillon Jan 15, 2025
5794b91
DEBUG
vouillon Jan 15, 2025
180a842
DEBUG
vouillon Jan 15, 2025
ff24e37
DEBUG
vouillon Jan 15, 2025
a6edf03
DEBUG
vouillon Jan 15, 2025
48b6ac7
WIP
vouillon Jan 15, 2025
5f2daf5
WIP
vouillon Jan 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 43 additions & 27 deletions .github/workflows/build-wasm_of_ocaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ jobs:
separate_compilation: true
jane_street_tests: false
all_jane_street_tests: false
- os: windows-latest
ocaml-compiler: "5.2"
separate_compilation: true
jane_street_tests: true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vouillon, jane_street_tests currently doesn't change whether we perform more and less tests. Is that expected ?

all_jane_street_tests: false
- os: ubuntu-latest
ocaml-compiler: "5.2"
separate_compilation: true
Expand All @@ -48,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' }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to have the tests pass in presence of CRLF

run: |
git config --global core.autocrlf false
git config --global core.eol lf
Expand All @@ -57,15 +62,15 @@ 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
uses: actions/checkout@v4
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
Expand All @@ -86,16 +91,25 @@ jobs:
# 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: ./wasm_of_ocaml
run: opam pin -n --with-version `< VERSION` .
working-directory: ./w
run: opam pin . -n --with-version dev

- 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 install opam-format ocamlfind dune graphics cmdliner
opam exec -- ocaml wasm_of_ocaml/tools/ci_setup.ml
opam exec -- dune exec --root w tools/ci_setup.exe j

- name: Pin Jane Street packages
if: ${{ ! matrix.jane_street_tests }}
Expand All @@ -106,86 +120,88 @@ 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 `basename -s .opam *.opam` num cohttp-lwt-unix ppx_expect cstruct
opam install .
opam install num cohttp-lwt-unix ppx_expect cstruct uucp

- 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
if: matrix.all_jane_street_tests
working-directory: ./janestreet/lib/base
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: ./janestreet/lib/base_bigstring
working-directory: ./j/lib/base_bigstring
run: opam exec -- dune runtest

- 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
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: ./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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 1 addition & 6 deletions compiler/lib-wasm/link.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
(Filename.basename dir)
".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;
Expand Down
8 changes: 4 additions & 4 deletions compiler/tests-jsoo/dune
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,7 +10,7 @@
(pps ppx_expect)))

(library
(name jsoo_testsuite_compression)
(name j__comp)
(modules test_marshal_compressed)
(libraries unix compiler-libs.common js_of_ocaml-compiler)
(enabled_if
Expand All @@ -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
Expand All @@ -32,7 +32,7 @@
(pps ppx_expect)))

(library
(name jsoo_testsuite)
(name j__common)
(modules
(:standard
\
Expand Down
2 changes: 1 addition & 1 deletion compiler/tests-jsoo/lib-effects/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
(:standard --enable effects)))))

(library
(name jsoo_testsuite_effect)
(name j__effect)
(enabled_if
(>= %{ocaml_version} 5))
(inline_tests
Expand Down
1 change: 1 addition & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
(ppxlib (>= 0.15.0))
(re :with-test)
(cmdliner (>= 1.1.0))
(opam-format :with-test)
(sedlex (>= 2.3))
menhir
menhirLib
Expand Down
2 changes: 1 addition & 1 deletion lib/deriving_json/tests/dune
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading