Skip to content

Commit d7bf42c

Browse files
authored
Merge pull request #126 from ocaml-wasm/wasm-dune
Revised dune support
2 parents bd01184 + ee35863 commit d7bf42c

File tree

53 files changed

+138
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+138
-99
lines changed

.github/workflows/build-wasm_of_ocaml.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ jobs:
148148

149149
- name: Pin dune
150150
run: |
151-
opam pin add -n dune.3.17 https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml-incremental
151+
opam pin add -n dune.3.17 https://github.com/ocaml/dune.git
152152
153153
- name: Pin wasm_of_ocaml
154154
working-directory: ./wasm_of_ocaml

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114

115115
- name: Pin dune
116116
run: |
117-
opam pin add dune.3.17 https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml
117+
opam pin add dune.3.17 https://github.com/ocaml/dune.git
118118
119119
- run: opam install conf-pkg-config
120120
if: runner.os == 'Windows'
@@ -178,7 +178,7 @@ jobs:
178178
dune-cache: true
179179
- name: Pin dune
180180
run: |
181-
opam pin add -n dune.3.17 https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml
181+
opam pin add -n dune.3.17 https://github.com/ocaml/dune.git
182182
- uses: ocaml/setup-ocaml/lint-opam@v3
183183

184184
lint-fmt:
@@ -193,7 +193,7 @@ jobs:
193193
dune-cache: true
194194
- name: Pin dune
195195
run: |
196-
opam pin add -n dune.3.17 https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml
196+
opam pin add -n dune.3.17 https://github.com/ocaml/dune.git
197197
- uses: ocaml/setup-ocaml/lint-fmt@v3
198198

199199
lint-runtime:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ The following commands will perform a minimal installation:
2424
```
2525
git clone https://github.com/ocaml-wasm/wasm_of_ocaml
2626
cd wasm_of_ocaml
27-
opam pin add -n --with-version 3.17 https://github.com/ocaml-wasm/dune.git#wasm_of_ocaml
28-
opam pin add -n --with-version 5.3.0-wasm .
27+
opam pin add -n --with-version 3.17 https://github.com/ocaml/dune.git
28+
opam pin add -n --with-version 5.8.2-wasm .
2929
opam install wasm_of_ocaml-compiler
3030
```
3131
You may want to install additional packages. For instance:

compiler/tests-env/dune

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
(test
2-
(modes js)
3-
(build_if
4-
(and
5-
(<> %{profile} wasm)
6-
(<> %{profile} wasm-effects)))
2+
(modes js) ; No env support in wasm_of_ocaml yet
73
(js_of_ocaml
84
(javascript_files setup.js)
95
(flags :standard --setenv JSOO_C=from-jsoo-args))

compiler/tests-io/dune

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
(names cat md5)
33
(modes
44
js
5+
wasm
56
(best exe)))
67

78
(rule
@@ -27,6 +28,14 @@
2728
(action
2829
(diff cat-js.stdout cat-native.stdout)))
2930

31+
(rule
32+
(action
33+
(copy cat.bc.wasm.js cat.bc.js))
34+
(enabled_if
35+
(or
36+
(= %{profile} wasm)
37+
(= %{profile} wasm-effects))))
38+
3039
(rule
3140
(target md5-native.stdout)
3241
(action
@@ -69,3 +78,11 @@
6978
(alias runtest)
7079
(action
7180
(diff md5-js.stdout md5-native.stdout)))
81+
82+
(rule
83+
(action
84+
(copy md5.bc.wasm.js md5.bc.js))
85+
(enabled_if
86+
(or
87+
(= %{profile} wasm)
88+
(= %{profile} wasm-effects))))

compiler/tests-jsoo/bin/dune

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(executables
22
(names error1 error2)
3-
(modes exe js)
3+
(modes exe js wasm)
44
(foreign_stubs
55
(language c)
66
(names named_value_stubs))
@@ -55,6 +55,14 @@
5555
(action
5656
(diff %{dep:error1-unregister.expected} %{dep:error1-unregister.js.actual})))
5757

58+
(rule
59+
(action
60+
(copy error1.bc.wasm.js error1.bc.js))
61+
(enabled_if
62+
(or
63+
(= %{profile} wasm)
64+
(= %{profile} wasm-effects))))
65+
5866
(rule
5967
(target error2.js.actual)
6068
(deps error2.html)
@@ -105,3 +113,11 @@
105113
(alias runtest)
106114
(action
107115
(diff %{dep:error2-unregister.expected} %{dep:error2-unregister.js.actual})))
116+
117+
(rule
118+
(action
119+
(copy error2.bc.wasm.js error2.bc.js))
120+
(enabled_if
121+
(or
122+
(= %{profile} wasm)
123+
(= %{profile} wasm-effects))))

compiler/tests-jsoo/dune

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
(enabled_if
66
(>= %{ocaml_version} 4.14))
77
(inline_tests
8-
(modes js best))
8+
(modes js wasm best))
99
(preprocess
1010
(pps ppx_expect)))
1111

@@ -16,7 +16,7 @@
1616
(enabled_if
1717
(>= %{ocaml_version} 5.1.1))
1818
(inline_tests
19-
(modes js best))
19+
(modes js wasm best))
2020
(preprocess
2121
(pps ppx_expect)))
2222

@@ -27,7 +27,7 @@
2727
(enabled_if
2828
(>= %{ocaml_version} 5.1.1))
2929
(inline_tests
30-
(modes js best))
30+
(modes js wasm best))
3131
(preprocess
3232
(pps ppx_expect)))
3333

@@ -41,7 +41,7 @@
4141
(language c)
4242
(names bigarray_stubs))
4343
(inline_tests
44-
(modes js best))
44+
(modes js wasm best))
4545
(preprocess
4646
(pps ppx_expect)))
4747

compiler/tests-jsoo/lib-effects/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
(inline_tests
1010
;; This requires the unreleased dune 3.7 to work
1111
(enabled_if true)
12-
(modes js best))
12+
(modes js wasm best))
1313
(preprocess
1414
(pps ppx_expect)))

compiler/tests-linkall/dune

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
(env
44
(_
55
(js_of_ocaml
6+
(compilation_mode separate))
7+
(wasm_of_ocaml
68
(compilation_mode separate))))
79

810
(test
911
(name test)
10-
(modes byte js)
12+
(modes byte js wasm)
1113
(libraries dynlink)
1214
;; It doesn't seem possible to create a pack-ed module with dune.
1315
;; However, dynlink uses pack to embed a copy
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
(tests
22
(names recursive_module_init)
33
(libraries)
4-
(modes js))
4+
(modes js wasm))

0 commit comments

Comments
 (0)