bigstringaf icon indicating copy to clipboard operation
bigstringaf copied to clipboard

Wasm_of_ocaml runtime file

Open vouillon opened this issue 1 year ago • 1 comments

vouillon avatar Dec 20 '24 00:12 vouillon

Is there a way to test this PR perhaps?

rgrinberg avatar Dec 27 '24 22:12 rgrinberg

With the following diff, one can test by running WASM_OF_OCAML=true dune build @runtest-wasm:

diff --git a/dune-workspace b/dune-workspace
new file mode 100644
index 0000000000..a9b4271989
--- /dev/null
+++ b/dune-workspace
@@ -0,0 +1,9 @@
+(lang dune 3.17)
+
+(env
+ (_
+  (wasm_of_ocaml
+   (enabled_if %{env:WASM_OF_OCAML=false})
+   (runtest_alias runtest-wasm))
+ )
+)
diff --git a/lib_test/dune b/lib_test/dune
index 48789f33a1..789dea0184 100644
--- a/lib_test/dune
+++ b/lib_test/dune
@@ -1,4 +1,5 @@
 (test
  (name test_bigstringaf)
  (libraries alcotest bigstringaf)
- (modules test_bigstringaf s))
+ (modules test_bigstringaf s)
+ (modes exe wasm))

Currently, this fails with

test_bigstringaf.bc.wasm.js: internal error, uncaught exception:
                             Failure("Error: caml_unix_mkdir not implemented")

presumably because upstream alcotest doesn’t support Wasm yet? (Although I see that there is some work from @vouillon in this direction: https://github.com/ocaml-wasm/alcotest/tree/wasm)

OlivierNicole avatar May 07 '25 15:05 OlivierNicole