ocaml-wasm / wasm_of_ocaml

Other
249 stars 9 forks source link

opam deps are not precise enough #103

Open zapashcanon opened 1 month ago

zapashcanon commented 1 month ago

On my switch:

$ opam install opam install --deps-only ./wasm_of_ocaml-compiler.opam
$ dune build -p wasm_of_ocaml-compiler @install
[...]
File "compiler/lib/wasm/wa_source_map.ml", line 132, characters 41-65:
132 |   `Assoc ((m, v) :: List.remove_assoc m (Yojson.Raw.Util.to_assoc assoc))
                                               ^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unbound module Yojson.Raw.Util

File "compiler/lib/wasm/wa_source_map.ml", line 132, characters 41-65:
132 |   `Assoc ((m, v) :: List.remove_assoc m (Yojson.Raw.Util.to_assoc assoc))
                                               ^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unbound module Yojson.Raw.Util

107 |   let l = Structure.blocks_in_reverse_post_order g in
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unbound value Structure.blocks_in_reverse_post_order

File "compiler/lib/wasm/wa_globalize.ml", line 107, characters 10-48:
107 |   let l = Structure.blocks_in_reverse_post_order g in
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unbound value Structure.blocks_in_reverse_post_order
vouillon commented 1 month ago

Thanks for your report.

Indeed, I need to update the Yojson dependency.

The other error is because wasm_of_ocaml is not quite in sync with the latest release of Js_of_ocaml. So, you need to install a modified version of js_of_ocaml-compiler first. You can use the following commands to make sure that your get the right versions of the different packages:

opam pin add -n --with-version 5.8.2-wasm .
opam install wasm_of_ocaml-compiler
zapashcanon commented 1 month ago

Does it mean that wsoo depends on jsoo ? (I did that pin command but got the error anyway, then it disappeared when I upgraded yojson)

vouillon commented 1 month ago

It is built using the js_of_ocaml-compiler library. This library is part of the opam package js_of_ocaml-compiler together with the js_of_ocaml binary. There is a lot of code in common.