Skip to content

Commit e7d0008

Browse files
committed
chore!: Require jsoo >= 6.0
This supersedes grain-lang#211 in switching to jsoo 6, the main difference is we need to be using a later version of node on our opam workflows, similar to the changes required here grain-lang/libbinaryen#114
1 parent 2153b31 commit e7d0008

File tree

7 files changed

+18
-9
lines changed

7 files changed

+18
-9
lines changed

.github/workflows/opam.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ jobs:
2424
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2525
with:
2626
submodules: "recursive"
27+
28+
- name: Setup node.js
29+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
30+
with:
31+
node-version: "22"
32+
check-latest: true
2733

2834
- name: Setup OCaml ${{ matrix.ocaml-compiler }}
2935
uses: ocaml/setup-ocaml@c2e6bb92370612b89f302c3aaefa1da45ee2d702 # v3.2.15

binaryen.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ depends: [
1515
"ocaml" {>= "4.13.0"}
1616
"dune" {>= "3.0.0"}
1717
"dune-configurator" {>= "3.0.0"}
18-
"js_of_ocaml-compiler" {>= "4.1.0" < "6.0.0"}
18+
"js_of_ocaml-compiler" {>= "6.0.0" < "7.0.0"}
1919
"libbinaryen" {>= "116.0.0" < "117.0.0"}
2020
]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"@opam/dune-configurator": ">= 3.0.0"
1212
},
1313
"devDependencies": {
14-
"@opam/js_of_ocaml-compiler": ">= 4.1.0 < 6.0.0",
14+
"@opam/js_of_ocaml-compiler": ">= 6.0.0 < 7.0.0",
1515
"@opam/ocamlformat": "0.24.1",
1616
"@opam/ocaml-lsp-server": ">= 1.9.1 < 1.13.0"
1717
},

src/expression.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,11 +882,12 @@ function caml_binaryen_expression_id_array_len() {
882882

883883
//Provides: caml_binaryen_expression_print
884884
//Requires: Binaryen
885+
//Requires: caml_sys_fds
885886
//Requires: caml_string_of_jsstring
886887
//Requires: caml_ml_output, caml_ml_string_length
887888
function caml_binaryen_expression_print(expr) {
888889
var text = Binaryen.emitText(expr);
889-
var chanid = 1; // stdout
890+
var chanid = caml_sys_fds[1].chanid; // stdout
890891
var s = caml_string_of_jsstring(text);
891892
caml_ml_output(chanid, s, 0, caml_ml_string_length(s));
892893
}

src/module.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,34 @@ function caml_binaryen_module_parse(text) {
1717
}
1818

1919
//Provides: caml_binaryen_module_print
20+
//Requires: caml_sys_fds
2021
//Requires: caml_string_of_jsstring
2122
//Requires: caml_ml_output, caml_ml_string_length
2223
function caml_binaryen_module_print(wasm_mod) {
2324
var text = wasm_mod.emitText();
24-
var chanid = 1; // stdout
25+
var chanid = caml_sys_fds[1].chanid; // stdout
2526
var s = caml_string_of_jsstring(text);
2627
caml_ml_output(chanid, s, 0, caml_ml_string_length(s));
2728
}
2829

2930
//Provides: caml_binaryen_module_print_asmjs
31+
//Requires: caml_sys_fds
3032
//Requires: caml_string_of_jsstring
3133
//Requires: caml_ml_output, caml_ml_string_length
3234
function caml_binaryen_module_print_asmjs(wasm_mod) {
3335
var asm = wasm_mod.emitAsmjs();
34-
var chanid = 1; // stdout
36+
var chanid = caml_sys_fds[1].chanid; // stdout
3537
var s = caml_string_of_jsstring(asm);
3638
caml_ml_output(chanid, s, 0, caml_ml_string_length(s));
3739
}
3840

3941
//Provides: caml_binaryen_module_print_stack_ir
42+
//Requires: caml_sys_fds
4043
//Requires: caml_string_of_jsstring, caml_js_from_bool
4144
//Requires: caml_ml_output, caml_ml_string_length
4245
function caml_binaryen_module_print_stack_ir(wasm_mod, optimize) {
4346
var stackir = wasm_mod.emitStackIR(caml_js_from_bool(optimize));
44-
var chanid = 1; // stdout
47+
var chanid = caml_sys_fds[1].chanid; // stdout
4548
var s = caml_string_of_jsstring(stackir);
4649
caml_ml_output(chanid, s, 0, caml_ml_string_length(s));
4750
}

test/dune

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
(modes exe js)
55
(flags
66
:standard
7-
(:include ./config/ocamlopt_flags.sexp))
8-
(js_of_ocaml))
7+
(:include ./config/ocamlopt_flags.sexp)))
98

109
(rule
1110
(alias runtest)

test/test.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ let add =
8282
let _ = assert (Expression.Block.get_name add = Some "add")
8383

8484
(* Create the add function *)
85-
let adder = Function.add_function wasm_mod "adder" (params ()) results [||] add
85+
let _adder = Function.add_function wasm_mod "adder" (params ()) results [||] add
8686

8787
let call_adder =
8888
Expression.Call_indirect.make wasm_mod "table"

0 commit comments

Comments
 (0)