Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
486 commits
Select commit Hold shift + click to select a range
e04f918
Use JS String Builtins for string conversions
vouillon Mar 22, 2024
628d4e0
Sourcemap support for wasm
OlivierNicole Mar 8, 2024
d8bb665
Merge pull request #27 from OlivierNicole/sourcemaps
vouillon Mar 27, 2024
b4c7103
Tuple syntax changes
vouillon Mar 15, 2024
6aa4b92
Merge pull request #31 from ocaml-wasm/syntax-update
vouillon Mar 28, 2024
3dd3b28
Name locals in WAT ouput
vouillon Mar 25, 2024
6cb2f7e
Use shorter names in WAT output
vouillon Mar 25, 2024
3c96f1e
Merge pull request #33 from ocaml-wasm/js-string-builtins
vouillon Mar 28, 2024
753732e
Source map fixes and improvements
vouillon Mar 29, 2024
2188fc7
Minify runtime
vouillon Mar 29, 2024
ab24656
Merge pull request #35 from ocaml-wasm/minify
vouillon Apr 2, 2024
d4c5423
WAT output: fix float output
vouillon Apr 29, 2024
ef48ae6
Merge pull request #34 from ocaml-wasm/names
vouillon May 13, 2024
a7dcef8
Move binaryen related operations to a distinct file
vouillon Mar 27, 2024
4a5ed46
Generate code for reporting missing primitives
vouillon Mar 29, 2024
bf1a8fa
AST: allow to export globals
vouillon Mar 22, 2024
91ad556
Move code around
vouillon Mar 29, 2024
5b063bb
Separate compilation: handle set/get globals + predefined exceptions
vouillon Mar 29, 2024
a7f25df
JSON serialization of build and unit info
vouillon Mar 29, 2024
d1902c0
Code generation changes
vouillon Mar 29, 2024
2d66d6a
Reading/writing zip file
vouillon Mar 29, 2024
555cb4e
Separate compilation
vouillon Mar 29, 2024
db69298
CI updates for separate compilation
vouillon Apr 2, 2024
1ef25fa
Limit parallelism when loading Wasm modules
vouillon Apr 26, 2024
92080d2
Use unique file names to avoid cache issues
vouillon May 6, 2024
7903a8d
improving installation instructions #37
benkb May 16, 2024
3e586e3
Partial application fix
vouillon May 21, 2024
9eb33a6
Add test
vouillon May 23, 2024
6d4d2fc
Merge pull request #40 from ocaml-wasm/fix-partial-app
vouillon May 23, 2024
78d2f29
Merge pull request #36 from ocaml-wasm/separate-compilation
vouillon Jun 3, 2024
b9fda54
Merge pull request #39 from bentxt/readme-installation
vouillon Jun 3, 2024
33f1577
CI updates
vouillon May 13, 2024
ef56d39
Source maps: emit annotations to indicate code with no debug location
vouillon May 17, 2024
e375df2
Remove caml_js_global primitive
vouillon Jun 19, 2024
8852bc7
Put back wasm-opt flag --skip-pass=inlining-optimizing
vouillon Jun 19, 2024
29c67a9
Array handling fix + clean-up
vouillon Jun 19, 2024
16d3606
Merge pull request #42 from ocaml-wasm/source-map
vouillon Jun 19, 2024
a63f952
Use sexps rather than Json for metadata
vouillon Apr 3, 2024
bfe3331
Bump ocamlformat
vouillon Jun 7, 2024
2832204
Fix comparison function
vouillon Jun 27, 2024
df5ccda
Comparisation function: add regression test
vouillon Jun 27, 2024
dae0661
Merge pull request #46 from ocaml-wasm/fix-compare
vouillon Jun 28, 2024
e641fbe
Rename wasm_of_ocaml's github build workflow
vouillon Jul 2, 2024
79a72c2
Fix marshaling of native integers
vouillon Jul 2, 2024
614cc25
Runtime: rename caml_string_cat into caml_string_concat
vouillon Jul 2, 2024
a759bbb
Test improvements
vouillon Jul 2, 2024
fc761ce
Add copyright headers
vouillon Jul 4, 2024
0f7baaa
Runtime: systematically use array.get_u rather array.get for strings
vouillon Jul 6, 2024
8b6a216
Add a warning when generating source maps if there is no debugging in…
vouillon Jul 6, 2024
83b7c68
Reduce constant string threshold
vouillon Jul 6, 2024
4b0706c
Merge pull request #50 from ocaml-wasm/headers
vouillon Jul 16, 2024
d5e9b95
Switch to Binaryen 118
vouillon Jul 16, 2024
059fbf2
Merge pull request #51 from ocaml-wasm/binaryen-118
vouillon Jul 16, 2024
074be74
Runtime: rename deprecated instruction i31.new
vouillon Jul 17, 2024
da3a0b2
Revert "Hack to make binaryen eliminate redundant casts"
vouillon Apr 17, 2024
1f38221
Wa_link: clean-up
vouillon Jul 19, 2024
3ef1eff
Enforce Binaryen 118 or greater
vouillon Jul 16, 2024
7cc2831
Rename conversion instructions extern.{in,ex}ternalize
vouillon Jul 16, 2024
b9a93a3
Wasm compiler: remove unused operators Extern{In,Ex}ternalize
vouillon Jul 16, 2024
156945d
Add type Js.number_t
vouillon Jun 7, 2024
a9b5bea
Effects: make continuation format compatible with OCaml 5.2
vouillon Jul 19, 2024
c75d050
Fix implementation of caml_register_named_value
vouillon Jul 31, 2024
eb6cd66
Merge pull request #54 from ocaml-wasm/effect-fix
vouillon Jul 31, 2024
6bf9b4b
Add missing primitives
OlivierNicole Jul 18, 2024
a87c5ae
Add missing runtime_events primitives
OlivierNicole Jul 23, 2024
3eac4d4
False-returning stub for caml_zstd_initialize
OlivierNicole Aug 1, 2024
da2b4f2
Merge pull request #60 from OlivierNicole/add-js-number
vouillon Aug 1, 2024
89fce85
Sync with Js_of_ocaml
vouillon Sep 15, 2023
8a7f021
Lib: use number_t in Typed_array as well
vouillon Jul 24, 2023
180c365
Merge pull request #61 from OlivierNicole/upd-number
vouillon Aug 1, 2024
992cdf4
Lib: use number_t in yet a few more places
vouillon Jul 24, 2023
212e4c5
Merge pull request #62 from OlivierNicole/upd-number
vouillon Aug 2, 2024
26b2820
fix bounds check
TheNumbat Aug 11, 2024
5b6215e
Merge pull request #63 from TheNumbat/main
vouillon Aug 20, 2024
5b98a6f
Merge pull request #58 from ocaml-wasm/named-value
vouillon Aug 20, 2024
09a8700
fix(url.ml): set_fragment need not any urlencode
erikmd Jul 27, 2023
1540ceb
fix(url.ml): Simplify get_fragment as well
erikmd Aug 2, 2023
5417acb
Merge pull request #64 from OlivierNicole/converge-jsoo-merge-01
vouillon Aug 22, 2024
390f9d7
Simplify the insertion of locations in wasm code
vouillon Aug 30, 2024
6b08f13
Add possibly missing debug information at beginning of functions
vouillon Aug 30, 2024
4d34679
Reenable optimization prevented by the insertion of locations
vouillon Aug 30, 2024
fb964b6
Merge pull request #59 from OlivierNicole/add-primitives
vouillon Aug 30, 2024
b38e20d
added 'ellipse' method to canvasRenderingContext2D (#1555)
FayCarsons Jan 18, 2024
e30e540
Fix hyperbolic tree example
vouillon Jun 7, 2024
5a0a119
Lib: Dialog element support (#1257)
sagotch Feb 29, 2024
4ce9356
Lib: fix paragraph construction and coercion
gpetiot Mar 1, 2024
e3f7aa1
Lib: Add Typed_array.Bytes module (#1609)
johnridesabike May 3, 2024
de31b5a
Add download attribute to anchor element
slegrand45 Sep 3, 2023
6dc6697
Compiler: dedicated type for "special" values (#1573)
hhugo Mar 1, 2024
c860567
Compiler: remove last argument of Pushtrap (#1575)
hhugo Mar 1, 2024
5db44d2
Compiler: track block mutability (#1603)
hhugo Apr 18, 2024
e2c98ec
Compiler: lower level switch
hhugo Jul 27, 2023
3146b32
Compiler: fix free variable for classes (#1524)
hhugo Nov 11, 2023
0ef5c70
Compiler: minify labels
hhugo Aug 3, 2023
6beaabe
Compiler: fix es6 scopes
hhugo Nov 13, 2023
7977f85
Compiler: improve complexity in parser production
hhugo Oct 14, 2023
2263216
Compiler: support for es6 import/export (#1529)
hhugo Nov 26, 2023
924ab20
Compiler: lazy cmdliner term
hhugo Oct 14, 2023
ad7a1c8
Compiler: js-parser: fix class member printing
hhugo Dec 11, 2023
df89877
Compiler: js-parser: preserve consise body
hhugo Dec 17, 2023
d2b703a
Compiler: js-parser: fix assignment target
hhugo Dec 7, 2023
ba117ee
Compiler: Make it possible to link runtime JavaScript file together w…
vouillon Sep 11, 2023
fa2742a
Compiler: small refactoring
hhugo Apr 27, 2024
4f541b9
Compiler: refactoring
hhugo Apr 29, 2024
3694f14
Compiler: remove deprecated cmdline runtime-only flag
hhugo Apr 20, 2024
efbe91a
Compiler: refactoring
hhugo Apr 29, 2024
0c71444
Compiler: new include-partial-runtime flag
hhugo May 3, 2024
b4be113
Tests: add test for compact option
hhugo Feb 21, 2024
7eee7ed
Compiler: use consise body in arrow when es6 is enabled
hhugo Mar 8, 2024
7721b16
Misc: disable some test on older ocaml
hhugo May 13, 2024
1c17c1e
Rename `cps_calls` into `trampolined_calls` for clarity
OlivierNicole Jul 4, 2024
56919bc
Merge pull request #65 from OlivierNicole/converge-jsoo-merge-02
vouillon Sep 5, 2024
08316ce
Misc: yojson is no longer optional
hhugo Jul 22, 2024
3d1241e
Compiler: speedup json parsing, relying on Yojson.Raw (#1640)
hhugo Aug 3, 2024
c211d81
Adapt Source_map after ocsigen/js_of_ocaml#1640
OlivierNicole Aug 20, 2024
6e90b4e
Move Sexp functions to wasm/ subdirectory
OlivierNicole Aug 1, 2024
929eed2
Compiler: fix toplevel
hhugo Jun 28, 2024
2326bd1
Merge pull request #68 from OlivierNicole/converge-jsoo-merge-04
vouillon Sep 11, 2024
ec0e24c
Merge pull request #69 from OlivierNicole/converge-jsoo-merge-05
vouillon Sep 11, 2024
5e51faa
Merge pull request #66 from ocaml-wasm/debug-fixes
vouillon Sep 11, 2024
238e5eb
Merge pull request #67 from OlivierNicole/converge-jsoo-merge-03
vouillon Sep 11, 2024
e15a9bc
Updated dune support
vouillon Jul 4, 2024
e6dbb0f
Always put Wasm code and source map into an asset directory
vouillon Jun 25, 2024
8d502f6
Merge pull request #45 from ocaml-wasm/target-dir
vouillon Sep 11, 2024
60a1203
Merge pull request #53 from ocaml-wasm/extern-conv
vouillon Sep 11, 2024
c758982
JS runtime: only link jslib_js_of_ocaml.js
vouillon Sep 11, 2024
a02584d
No longer ignore always annotation
vouillon Sep 11, 2024
c0f0c8f
Handle primitives that depend on the OCaml version
OlivierNicole Sep 12, 2024
d30fe1f
Move version-dependant files to subdirectory
vouillon Sep 13, 2024
5e9c0ea
Small fix
vouillon Sep 13, 2024
6d43b92
Format dune file
vouillon Sep 13, 2024
9744f89
Fix link of packed modules
vouillon Sep 13, 2024
f41575c
Marshal header size change in OCaml 5.1
vouillon Sep 13, 2024
aaf4198
Merge pull request #73 from OlivierNicole/missing-prim
vouillon Sep 13, 2024
9a01ecd
Merge pull request #75 from ocaml-wasm/packed-modules
vouillon Sep 13, 2024
73b3791
Wasm code linker
vouillon Jun 4, 2024
7d2d95c
Generate one single wasm file per cma archive
vouillon Jun 4, 2024
5a45804
Wasm output
vouillon Jun 4, 2024
965988a
Start function: directly generate wasm code
vouillon Jun 4, 2024
ca9dcba
Support linking wasmo files into one wasma file
vouillon Jun 5, 2024
db04a4a
Merge pull request #72 from ocaml-wasm/reduced-js-runtime
vouillon Sep 13, 2024
b2ab3a2
Merge pull request #43 from ocaml-wasm/separate-compilation-v2
vouillon Sep 13, 2024
dd01986
ocamlformat
vouillon Sep 13, 2024
3a3ca74
Update outdated info in readme
OlivierNicole Sep 13, 2024
c290fb1
Update README.md
OlivierNicole Sep 16, 2024
ab2525d
Fix warning
vouillon Sep 16, 2024
dc6ebd8
Merge pull request #77 from ocaml-wasm/OlivierNicole-patch-1
vouillon Sep 16, 2024
cfcef83
Revert "No longer ignore always annotation"
vouillon Sep 17, 2024
d3969be
Revert "JS runtime: only link jslib_js_of_ocaml.js"
vouillon Sep 17, 2024
272422e
Merge pull request #78 from ocaml-wasm/runtime-fix
vouillon Sep 17, 2024
d8a442c
README: Pin more than just dune
JasonGross Sep 18, 2024
e8f80e0
Update README.md
JasonGross Sep 18, 2024
e9befa0
Update README.md
JasonGross Sep 18, 2024
65a9948
Refactor distinction between integer types
vouillon Jun 11, 2024
2034c19
Distinguish float field accesses in the Code IR
OlivierNicole Aug 28, 2024
1a24255
WSOO side of "Distinguish float field accesses in the Code IR"
OlivierNicole Sep 3, 2024
989a1d6
Fix build
OlivierNicole Sep 19, 2024
d7de3b6
Fixes
vouillon Sep 20, 2024
19f23aa
Merge pull request #79 from JasonGross/patch-2
vouillon Sep 20, 2024
8a8664d
Merge pull request #70 from OlivierNicole/converge-jsoo-merge-06
vouillon Sep 20, 2024
d4853b3
Compiler: fix link of packed modules
hhugo Jul 24, 2024
4174f52
JavaScript linker: make it easier to add flags
vouillon Sep 20, 2024
a40f9a0
Compiler: Document non-trivial function Code.constant_equal, and fix …
OlivierNicole Aug 27, 2024
48b465f
WSOO side of ocsigen/js_of_ocaml#1659
OlivierNicole Sep 3, 2024
68bf91e
Fixes
vouillon Sep 20, 2024
26864d1
Fix constant_identical for Wasm target
OlivierNicole Sep 20, 2024
cfc3028
Merge pull request #71 from OlivierNicole/converge-jsoo-merge-07
vouillon Sep 20, 2024
13128c5
Fix performance issue when assigning short names to variables
vouillon Sep 23, 2024
91cfd1b
Merge pull request #82 from ocaml-wasm/naming-fix
vouillon Sep 23, 2024
c4fa5d4
opam: requires ocaml >= 4.14
vouillon Sep 23, 2024
87f2119
ocamlformat
vouillon Sep 23, 2024
99c46f0
Compiler: nativeInt is always 32bit
hhugo Sep 26, 2024
2ab1d30
Target-specific code (#1655)
OlivierNicole Sep 27, 2024
f27e20b
WSOO side of Target-specific code
OlivierNicole Sep 30, 2024
af34f71
Upgrade Dune lang version
OlivierNicole Oct 1, 2024
b078432
No longer ignore always annotation
vouillon Sep 11, 2024
2a7f413
JavaScript linker: add 'wasm' flag
vouillon Sep 17, 2024
fb225da
Fixup: Fix Source_map uses
OlivierNicole Sep 20, 2024
b16557e
Realign Driver.optimize
OlivierNicole Oct 2, 2024
509636e
Fix Parse_bytecode types
OlivierNicole Oct 2, 2024
d4c21f5
Merge pull request #85 from OlivierNicole/converge-jsoo-merge-08
vouillon Oct 2, 2024
3e3bf3e
Merge remote-tracking branch 'jsoo/master' into jsoo-merge
OlivierNicole Oct 2, 2024
a6eefa0
Add Int31.of_int32_truncate
OlivierNicole Oct 2, 2024
00c87cb
Add some Source_map functions
OlivierNicole Oct 2, 2024
b886536
Remove special Undefined
OlivierNicole Oct 2, 2024
d3faed0
CI fixes
OlivierNicole Oct 2, 2024
af6384d
Fix compilation of the Wasm runtime under Windows.
vouillon Oct 3, 2024
a54ca81
Fix parsing test
vouillon Oct 4, 2024
db1de96
Merge pull request #86 from ocaml-wasm/jsoo-merge
OlivierNicole Oct 4, 2024
a6c7e89
Bump ocaml/setup-ocaml from 2 to 3
dependabot[bot] Oct 4, 2024
7cd0e59
Merge pull request #94 from ocaml-wasm/dependabot/github_actions/ocam…
vouillon Oct 4, 2024
d49fe94
Runtime: fix primitive selection for OCaml 5.01
vouillon Oct 4, 2024
0b4b6d3
Disable js_of_ocaml tests
vouillon Oct 4, 2024
dd3c5c1
CI: test with OCaml 5.01
vouillon Oct 4, 2024
bcc399f
Merge branch 'master' of github.com:ocsigen/js_of_ocaml into targetint
vouillon Oct 4, 2024
90db9c5
Wasm runtime: JavaScript clean-up
vouillon Oct 4, 2024
78760fd
Wasm runtime: reformat the JavaScript code
vouillon Oct 4, 2024
67d2add
Disable BLAKE2b tests for now
vouillon Oct 4, 2024
eb1128b
CI: test with OCaml 5.02
vouillon Oct 4, 2024
86d3f4b
CI: test with MacOS
vouillon Oct 4, 2024
ef0be34
Merge pull request #95 from ocaml-wasm/ci-mac
vouillon Oct 7, 2024
734dceb
Merge pull request #96 from ocaml-wasm/targetint
vouillon Oct 7, 2024
62fc9ed
CI fix
vouillon Oct 8, 2024
090b7b2
Runtime: typos
vouillon Oct 8, 2024
364c37c
WAT output: no longer emit 'pop' instructions
vouillon Oct 8, 2024
5f736b1
Use Js_of_ocaml_compiler.Structure instead of Wa_structure
vouillon Oct 8, 2024
f4f188a
Remove code corresponding to an hypothetical core Wasm support
vouillon Oct 8, 2024
c3cf34b
Calculate fetchBase once at toplevel
rickyvetter Oct 8, 2024
5105f11
Merge pull request #100 from rickyvetter/patch-1
vouillon Oct 9, 2024
058036f
Merge pull request #99 from ocaml-wasm/clean-up
vouillon Oct 9, 2024
1bc3ab8
Use static Object.hasOwn
rickyvetter Oct 14, 2024
548a3b2
Merge pull request #106 from rickyvetter/patch-2
vouillon Oct 15, 2024
38abfd5
Move boxing/unboxing outside of some runtime primitives
vouillon Sep 25, 2024
6d62d29
Bigstring: add JavaScript functions to access 2 or 4 bytes at once
vouillon Sep 26, 2024
c3ba995
Optimized blitting between strings and bigstrings
vouillon Sep 26, 2024
4206f85
Add --linkall option for compatibility with Js_of_ocaml
vouillon Oct 21, 2024
a4e7b05
Source maps: fix documentation of command line arguments
vouillon Oct 21, 2024
c2a49a5
Merge pull request #84 from ocaml-wasm/bigstring-perfs
vouillon Oct 23, 2024
886b6b2
Test float record with dead field
vouillon Oct 23, 2024
0b432e7
Fix bad interaction of deadcode elimination and unboxed float records
vouillon Oct 23, 2024
7a1d85c
Tests: more test for float conv
hhugo Oct 10, 2024
aede507
Runtime: make float_of_string strict
hhugo Oct 10, 2024
48c22c6
Stricter float_of_string
vouillon Oct 24, 2024
15bea92
Merge pull request #108 from ocaml-wasm/dead-code-fix
vouillon Oct 24, 2024
102f8dd
Merge pull request #110 from ocaml-wasm/float_of_string
vouillon Oct 24, 2024
3698fe4
JavaScript if statement simplification: use appropriate locations
vouillon Oct 18, 2024
f1f0d24
Add location after return statement
vouillon Oct 18, 2024
d1ecd6b
Add location on new expression
vouillon Oct 18, 2024
eba73eb
Move source code location resolution from code output to code generation
vouillon Oct 22, 2024
fdbc151
Test: miscompilation of float array creation
vouillon Oct 24, 2024
65e727a
Fix creation of float arrays
vouillon Oct 24, 2024
badd68f
Merge remote-tracking branch 'jsoo/master' into jsoo
vouillon Oct 24, 2024
0310c5c
Add more tests of caml_make_array
vouillon Oct 24, 2024
fb4d189
Merge pull request #111 from ocaml-wasm/jsoo
vouillon Oct 24, 2024
c1390f7
Merge pull request #113 from ocaml-wasm/caml-make-array
vouillon Oct 24, 2024
9293f3f
Wasm linker fixes
vouillon Oct 24, 2024
ea93a52
Sourcemap improvements
vouillon Oct 24, 2024
3547c4c
Merge pull request #118 from ocaml-wasm/sm
vouillon Oct 29, 2024
b37c665
Compile a raise within a try as a branch to the exception handler
vouillon Oct 29, 2024
dea31d2
Delete asset directory if it already exists
vouillon Oct 29, 2024
f428e0e
Github action: automatically merge with js_of_ocaml
vouillon Oct 10, 2024
f33288a
Update README.md
vouillon Oct 29, 2024
ba44373
Source map: align with Js_of_ocaml
vouillon Oct 29, 2024
d6b458d
Run Bonsai test with profile release as well
vouillon Oct 30, 2024
5cf44d5
Make sure we open files in binary mode
vouillon Oct 31, 2024
5072ad2
Use dune tests
vouillon Jun 26, 2024
8783f83
Revised dune support
vouillon Oct 31, 2024
8bcee4b
CI: temporarily pin updated packages
vouillon Nov 2, 2024
fbe22bf
Compiler tests: lighter conditions
vouillon Nov 2, 2024
760a859
Library tests: lighter conditions
vouillon Nov 4, 2024
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
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
*.ml linguist-language=OCaml
*.mli linguist-language=OCaml

# We are pinning wasm_of_ocaml using this file in the CI. This would
# fail on Windows otherwise.
VERSION -text
228 changes: 228 additions & 0 deletions .github/workflows/build-wasm_of_ocaml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
name: Build wasm_of_ocaml

on:
pull_request:
push:

jobs:
build:
env:
OPAMJOBS: 2
OPAMYES: true

strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
ocaml-compiler:
- 4.14.x
- 5.00.x
- 5.01.x
- 5.02.x
include:
- os: macos-latest
ocaml-compiler: 5.02.x

runs-on: ${{ matrix.os }}

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
git config --global core.ignorecase false

- name: Install node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Restore cached binaryen
id: cache-binaryen
uses: actions/cache/restore@v4
with:
path: binaryen
key: ${{ runner.os }}-binaryen-version_118

- name: Checkout binaryen
if: steps.cache-binaryen.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: WebAssembly/binaryen
path: binaryen
submodules: true
ref: version_118

- name: Install ninja (Ubuntu)
if: matrix.os == 'ubuntu-latest' && steps.cache-binaryen.outputs.cache-hit != 'true'
run: sudo apt-get install ninja-build

- name: Install ninja (MacOS)
if: matrix.os == 'macos-latest' && steps.cache-binaryen.outputs.cache-hit != 'true'
run: brew install ninja

- name: Build binaryen
if: steps.cache-binaryen.outputs.cache-hit != 'true'
working-directory: ./binaryen
run: |
cmake -G Ninja .
ninja

- name: Cache binaryen
if: steps.cache-binaryen.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: binaryen
key: ${{ runner.os }}-binaryen-version_118

- name: Set binaryen's path
run: |
echo "$GITHUB_WORKSPACE/binaryen/bin" >> $GITHUB_PATH

- name: Restore cached OCaml
id: cache-ocaml
uses: actions/cache/restore@v4
with:
path: |
~/.opam
_opam
/opt/hostedtoolcache/opam
/Users/runner/hostedtoolcache/opam
key: ${{ runner.os }}-ocaml-${{ matrix.ocaml-compiler }}

- name: Install OCaml ${{ matrix.ocaml-compiler }}
if: steps.cache-ocaml.outputs.cache-hit != 'true'
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: true
opam-depext: true
opam-depext-flags: --with-test

- name: Install packages (Ubuntu)
if: matrix.os == 'ubuntu-latest' && steps.cache-ocaml.outputs.cache-hit
run: sudo apt-get install bubblewrap

- name: Install packages (MacOs)
if: matrix.os == 'macos-latest' && steps.cache-ocaml.outputs.cache-hit
# for graphics
run: brew install xquartz

- name: Set opam path
if: steps.cache-ocaml.outputs.cache-hit
run: |
echo /opt/hostedtoolcache/opam/*/x86_64 >> $GITHUB_PATH
echo /Users/runner/hostedtoolcache/opam/*/arm64 >> $GITHUB_PATH

- name: Cache OCaml
if: steps.cache-ocaml.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
~/.opam
_opam
/opt/hostedtoolcache/opam
/Users/runner/hostedtoolcache/opam
key: ${{ runner.os }}-ocaml-${{ matrix.ocaml-compiler }}

- name: Checkout code
uses: actions/checkout@v4
with:
path: wasm_of_ocaml

- name: Pin faked binaryen-bin package
# It's faster to use a cached version
working-directory: ./binaryen
run: |
echo opam-version: '"2.0"' > binaryen-bin.opam
opam pin -n .
rm binaryen-bin.opam

- name: Checkout Jane Street opam repository
uses: actions/checkout@v4
with:
repository: janestreet/opam-repository
ref: feaf8f831051fd5f316963b28efd728cf0b0eca1
path: jane-street/opam-repository

- name: Pin dune
run: |
opam pin add -n dune.3.17 https://github.com/vouillon/dune.git#wasm_of_ocaml-alternative

- name: Pin wasm_of_ocaml
working-directory: ./wasm_of_ocaml
run: |
for i in *.opam; do opam pin add -n `basename $i .opam`.`< VERSION` .; done

- name: Install opam file parser
run: opam install opam-format ocamlfind dune graphics

- name: Checkout Jane Street packages
run: opam exec -- ocaml wasm_of_ocaml/tools/ci_setup.ml

- name: Update test dependencies
run: opam install num cohttp-lwt-unix ppx_expect cstruct

- name: Install wasm_of_ocaml
working-directory: ./wasm_of_ocaml
run: opam install `basename -s .opam *.opam`

- name: Run tests
working-directory: ./wasm_of_ocaml
run: opam exec -- dune build @all @runtest --profile wasm

- name: Run tests with CPS effects
if: ${{ matrix.ocaml-compiler >= '5.' }}
working-directory: ./wasm_of_ocaml
run: opam exec -- dune build @all @runtest --profile wasm-effects

- name: Run Base tests
if: ${{ matrix.ocaml-compiler < '5.' }}
working-directory: ./jane-street/lib/base
run: opam exec -- dune runtest

- name: Run Base bigstring tests
if: ${{ matrix.ocaml-compiler < '5.' }}
working-directory: ./jane-street/lib/base_bigstring
run: opam exec -- dune runtest

- name: Run Core tests
if: ${{ matrix.ocaml-compiler < '5.' }}
working-directory: ./jane-street/lib/core
run: opam exec -- dune runtest

- name: Run Bignum tests
if: ${{ matrix.ocaml-compiler < '5.' }}
working-directory: ./jane-street/lib/bignum
run: opam exec -- dune runtest

- name: Run Bin_prot tests
if: ${{ matrix.ocaml-compiler < '5.' }}
working-directory: ./jane-street/lib/bin_prot
run: opam exec -- dune runtest

- name: Run String_dict tests
if: ${{ matrix.ocaml-compiler < '5.' }}
working-directory: ./jane-street/lib/string_dict
run: opam exec -- dune runtest

- name: Run Zarith tests
if: ${{ matrix.ocaml-compiler < '5.' }}
working-directory: ./jane-street/lib/zarith_stubs_js
run: opam exec -- dune runtest

- name: Run Virtual_dom tests
if: ${{ matrix.ocaml-compiler < '5.' }}
working-directory: ./jane-street/lib/virtual_dom
run: opam exec -- dune runtest

- name: Run Bonsai tests
if: ${{ matrix.ocaml-compiler < '5.' }}
working-directory: ./jane-street/lib/bonsai
run: opam exec -- dune runtest

- name: Run Bonsai tests (release profile)
if: ${{ matrix.ocaml-compiler < '5.' }}
working-directory: ./jane-street/lib/bonsai
run: opam exec -- dune runtest --profile release
26 changes: 25 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,31 @@ jobs:
dune-cache: true
opam-pin: false

- name: Pin dune
run: |
opam pin add dune.3.17 https://github.com/vouillon/dune.git#wasm_of_ocaml-alternative

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

- run: opam install . --best-effort
if: ${{ matrix.skip-test }}

- run: opam install . --with-test
- run: cat VERSION | xargs opam pin wasm_of_ocaml-compiler . -n --with-version
if: ${{ !matrix.skip-test }}
shell: bash

- run: opam install conf-c++
# Otherwise, the next step fails reinstalling gcc while compiling
# other packages
if: ${{ !matrix.skip-test && runner.os == 'Windows' }}

- run: opam install . --with-test --deps-only
# Install the test dependencies
if: ${{ !matrix.skip-test }}

- run: opam install .
# Install the packages (without running the tests)
if: ${{ !matrix.skip-test }}

- run: opam exec -- make all
Expand Down Expand Up @@ -158,6 +176,9 @@ jobs:
with:
ocaml-compiler: "5.2"
dune-cache: true
- name: Pin dune
run: |
opam pin add -n dune.3.17 https://github.com/vouillon/dune.git#wasm_of_ocaml-alternative
- uses: ocaml/setup-ocaml/lint-opam@v3

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

lint-runtime:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Automatic Merge with Js_of_ocaml

on:
schedule:
- cron: '0 0 * * *' # Executes daily at midnight UTC
workflow_dispatch: # Allows manual triggering of the workflow

permissions:
contents: write

jobs:
merge:
runs-on: ubuntu-latest

steps:
- name: Checkout this repository
uses: actions/checkout@v3
with:
ref: main
fetch-depth: 1000

- name: Set Git committer identity
run: |
git config user.name github-actions
git config user.email [email protected]

- name: Fetch js_of_ocaml master
run: git fetch https://github.com/ocsigen/js_of_ocaml.git master

- name: Merge js_of_ocaml master into current repository
run: git merge FETCH_HEAD

- name: Push merged changes to 'jsoo-merged' branch
run: |
if git show-ref --verify --quiet refs/heads/jsoo-merged; then
git branch -D jsoo-merged
fi
git checkout -b jsoo-merged
git push --force origin jsoo-merged
Loading
Loading