Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions .github/workflows/build-wasm_of_ocaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ jobs:
ref: feaf8f831051fd5f316963b28efd728cf0b0eca1
path: jane-street/opam-repository

- name: Pin dune
run: opam pin add -n dune.3.17 https://github.com/ocaml/dune.git

- name: Pin wasm_of_ocaml
working-directory: ./wasm_of_ocaml
run: opam pin -n --with-version `< VERSION` .
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@ jobs:
dune-cache: true
opam-pin: false

- name: Pin dune
run: |
opam pin add dune.3.17 https://github.com/ocaml/dune.git

- run: opam install conf-pkg-config
if: runner.os == 'Windows'

Expand Down Expand Up @@ -164,4 +160,4 @@ jobs:
branch: wikidoc
folder: doc-dev
clean: true
target-folder: doc/dev/
target-folder: doc/dev/
6 changes: 0 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ jobs:
with:
ocaml-compiler: "5.2"
dune-cache: true
- name: Pin dune
run: |
opam pin add -n dune.3.17 https://github.com/ocaml/dune.git
- uses: ocaml/setup-ocaml/lint-opam@v3

lint-fmt:
Expand All @@ -32,9 +29,6 @@ jobs:
with:
ocaml-compiler: "5.2"
dune-cache: true
- name: Pin dune
run: |
opam pin add -n dune.3.17 https://github.com/ocaml/dune.git
- uses: ocaml/setup-ocaml/lint-fmt@v3

lint-runtime:
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ The following commands will perform a minimal installation:
```
git clone https://github.com/ocaml-wasm/wasm_of_ocaml
cd wasm_of_ocaml
opam pin add -n --with-version 3.17 https://github.com/ocaml/dune.git
opam pin add -n --with-version 5.8.2-wasm .
opam install wasm_of_ocaml-compiler
opam pin add -n --with-version 6.0.0 .
opam install dune.3.17.0 wasm_of_ocaml-compiler
```
You may want to install additional packages. For instance:

Expand Down
49 changes: 42 additions & 7 deletions benchmarks/sources/ml/dune
Original file line number Diff line number Diff line change
@@ -1,14 +1,49 @@
(executables
(names almabench bdd binary_trees boyer boyer_no_exc fannkuch_redux_2
fannkuch_redux fft fib hamming kb kb_no_exc loop nucleic quicksort raytrace
soli splay takc taku))
(names
almabench
bdd
binary_trees
boyer
boyer_no_exc
fannkuch_redux_2
fannkuch_redux
fft
fib
hamming
kb
kb_no_exc
loop
nucleic
quicksort
raytrace
soli
splay
takc
taku))

(alias
(name benchmark)
(deps almabench.exe bdd.exe binary_trees.exe boyer.exe boyer_no_exc.exe
fannkuch_redux_2.exe fannkuch_redux.exe fft.exe fib.exe hamming.exe kb.exe
kb_no_exc.exe loop.exe nucleic.exe quicksort.exe raytrace.exe soli.exe
splay.exe takc.exe taku.exe))
(deps
almabench.exe
bdd.exe
binary_trees.exe
boyer.exe
boyer_no_exc.exe
fannkuch_redux_2.exe
fannkuch_redux.exe
fft.exe
fib.exe
hamming.exe
kb.exe
kb_no_exc.exe
loop.exe
nucleic.exe
quicksort.exe
raytrace.exe
soli.exe
splay.exe
takc.exe
taku.exe))

(env
(_
Expand Down
5 changes: 4 additions & 1 deletion compiler/bin-js_of_ocaml/dune
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@
(install
(section man)
(package js_of_ocaml-compiler)
(files js_of_ocaml.1 js_of_ocaml-link.1 js_of_ocaml-build-fs.1
(files
js_of_ocaml.1
js_of_ocaml-link.1
js_of_ocaml-build-fs.1
js_of_ocaml-build-runtime.1))

;; Generate and install runtime.js for compatibility reasons
Expand Down
7 changes: 5 additions & 2 deletions compiler/bin-wasm_of_ocaml/dune
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@

(rule
(target wa_runtime.ml)
(deps gen/gen.exe ../../runtime/wasm/runtime.wasm
../../runtime/wasm/runtime.js ../../runtime/wasm/deps.json)
(deps
gen/gen.exe
../../runtime/wasm/runtime.wasm
../../runtime/wasm/runtime.js
../../runtime/wasm/deps.json)
(action
(with-stdout-to
%{target}
Expand Down
4 changes: 3 additions & 1 deletion compiler/lib-dynlink/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
(foreign_stubs
(language c)
(names stubs))
(libraries js_of_ocaml-compiler js_of_ocaml-compiler.runtime
(libraries
js_of_ocaml-compiler
js_of_ocaml-compiler.runtime
compiler-libs.bytecomp))
24 changes: 20 additions & 4 deletions compiler/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
(name js_of_ocaml_compiler)
(public_name js_of_ocaml-compiler)
(synopsis "Js_of_ocaml compiler library")
(libraries compiler-libs.common compiler-libs.bytecomp menhirLib sedlex
(libraries
compiler-libs.common
compiler-libs.bytecomp
menhirLib
sedlex
yojson)
(flags
(:standard -w -7-37 -safe-string))
Expand All @@ -13,9 +17,21 @@

(menhir
(modules js_parser)
(flags --table --external-tokens Js_token --explain --unused-token TAnnot
--unused-token TComment --unused-token TCommentLineDirective --unused-token
T_ERROR --unused-token T_AT))
(flags
--table
--external-tokens
Js_token
--explain
--unused-token
TAnnot
--unused-token
TComment
--unused-token
TCommentLineDirective
--unused-token
T_ERROR
--unused-token
T_AT))

(menhir
(modules annot_parser)
Expand Down
36 changes: 30 additions & 6 deletions compiler/tests-check-prim/dune
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime +dynlink.js +toplevel.js
(run
%{bin:js_of_ocaml}
check-runtime
+dynlink.js
+toplevel.js
%{dep:main.bc}))))

(rule
Expand All @@ -37,7 +41,11 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime +dynlink.js +toplevel.js
(run
%{bin:js_of_ocaml}
check-runtime
+dynlink.js
+toplevel.js
%{dep:unix.bc}))))

(rule
Expand All @@ -51,7 +59,11 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime +dynlink.js +toplevel.js
(run
%{bin:js_of_ocaml}
check-runtime
+dynlink.js
+toplevel.js
%{dep:unix.bc}))))

(rule
Expand All @@ -63,7 +75,11 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime +dynlink.js +toplevel.js
(run
%{bin:js_of_ocaml}
check-runtime
+dynlink.js
+toplevel.js
%{dep:main.bc}))))

(rule
Expand All @@ -77,7 +93,11 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime +dynlink.js +toplevel.js
(run
%{bin:js_of_ocaml}
check-runtime
+dynlink.js
+toplevel.js
%{dep:unix.bc}))))

(rule
Expand All @@ -91,5 +111,9 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime +dynlink.js +toplevel.js
(run
%{bin:js_of_ocaml}
check-runtime
+dynlink.js
+toplevel.js
%{dep:unix.bc}))))
24 changes: 19 additions & 5 deletions compiler/tests-dynlink-js/dune
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@
(target main.js)
(enabled_if %{env:js-enabled=})
(action
(run %{bin:js_of_ocaml} --linkall %{read-strings:effects_flags.txt} -o
%{target} %{dep:main.bc})))
(run
%{bin:js_of_ocaml}
--linkall
%{read-strings:effects_flags.txt}
-o
%{target}
%{dep:main.bc})))

(rule
(target plugin.cmo)
Expand All @@ -50,19 +55,28 @@
(rule
(target plugin.js)
(action
(run %{bin:js_of_ocaml} %{read-strings:effects_flags.txt}
(run
%{bin:js_of_ocaml}
%{read-strings:effects_flags.txt}
%{dep:./plugin.cmo})))

(rule
(target plugin2.cma)
(action
(run %{bin:ocamlc} -a %{dep:./plugin2a.ml} %{dep:./plugin2b.ml} -o
(run
%{bin:ocamlc}
-a
%{dep:./plugin2a.ml}
%{dep:./plugin2b.ml}
-o
plugin2.cma)))

(rule
(target plugin2.js)
(action
(run %{bin:js_of_ocaml} %{read-strings:effects_flags.txt}
(run
%{bin:js_of_ocaml}
%{read-strings:effects_flags.txt}
%{dep:./plugin2.cma})))

(rule
Expand Down
9 changes: 8 additions & 1 deletion compiler/tests-dynlink/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
(enabled_if %{env:js-enabled=})
(deps plugin.cmo export)
(action
(run %{bin:js_of_ocaml} --dynlink --export export --pretty -o %{target}
(run
%{bin:js_of_ocaml}
--dynlink
--export
export
--pretty
-o
%{target}
%{dep:main.bc})))

(rule
Expand Down
14 changes: 12 additions & 2 deletions compiler/tests-full/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
(enabled_if
(= %{ocaml_version} "5.2.0"))
(action
(run %{bin:js_of_ocaml} --pretty --debuginfo %{lib:stdlib:stdlib.cma} -o
(run
%{bin:js_of_ocaml}
--pretty
--debuginfo
%{lib:stdlib:stdlib.cma}
-o
%{targets})))

(rule
Expand All @@ -26,7 +31,12 @@
(targets fs.output.js)
(deps file1 file2)
(action
(run %{bin:js_of_ocaml} build-fs -o %{targets} file1:/static/file1
(run
%{bin:js_of_ocaml}
build-fs
-o
%{targets}
file1:/static/file1
file2:/static/dir/file2)))

(rule
Expand Down
10 changes: 8 additions & 2 deletions compiler/tests-jsoo/dune
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@
(library
(name jsoo_testsuite)
(modules
(:standard \ test_io test_floats test_marshal_compressed test_parsing
calc_parser calc_lexer))
(:standard
\
test_io
test_floats
test_marshal_compressed
test_parsing
calc_parser
calc_lexer))
(libraries unix compiler-libs.common js_of_ocaml-compiler)
(foreign_stubs
(language c)
Expand Down
Loading