ocsigen / js_of_ocaml

Compiler from OCaml to Javascript.
http://ocsigen.org/js_of_ocaml/
Other
943 stars 185 forks source link

[BUG] Missing primitives on OCaml 5.2 #1592

Closed kit-ty-kate closed 3 months ago

kit-ty-kate commented 3 months ago

I just noticed the json-data-encoding.1.0.1 package whose tests fail with:

# (cd _build/default/json-data-encoding/test && /home/opam/.opam/5.2/bin/js_of_ocaml -o test_list_map.bc.js /home/opam/.opam/5.2/lib/bigstringaf/runtime.js /home/opam/.opam/5.2/lib/cstruct/cstruct.js /home/opam/.opam/5.2/lib/alcotest/runtime.js test_list_map.bc-for-jsoo)
# There are some missing primitives
# Dummy implementations (raising 'Failure' exception) will be used if they are not available at runtime.
# You can prevent the generation of dummy implementations with the commandline option '--disable genprim'
# Missing primitives:
#   caml_domain_dls_compare_and_set
#   caml_reset_afl_instrumentation
#   caml_unix_close
#   caml_unix_getpid
#   caml_unix_kill
#   caml_unix_open
#   caml_unix_read
# (cd _build/default/json-data-encoding/test && ./test_seq_is_lazy.exe)
# Testing lazily seq streaming
# Success for lazily seq streaming
# Testing infinite seq streaming
# Success for infinite seq streaming
# (cd _build/default/json-data-encoding/test && /home/opam/.opam/5.2/bin/js_of_ocaml -o test_seq_is_lazy.bc.js /home/opam/.opam/5.2/lib/bigstringaf/runtime.js /home/opam/.opam/5.2/lib/cstruct/cstruct.js /home/opam/.opam/5.2/lib/alcotest/runtime.js test_seq_is_lazy.bc-for-jsoo)
# There are some missing primitives
# Dummy implementations (raising 'Failure' exception) will be used if they are not available at runtime.
# You can prevent the generation of dummy implementations with the commandline option '--disable genprim'
# Missing primitives:
#   caml_domain_dls_compare_and_set
# (cd _build/default/json-data-encoding/test && ./test_destruct.exe)
# Testing `json-data-encoding'.
# This run has ID `3OHH00I8'.
# 
#   [OK]          destruct          0   empty.
#   [OK]          destruct          1   unexpected_root.
#   [OK]          destruct          2   unexpected_field.
#   [OK]          destruct          3   list.
# 
# Full test results in `~/.opam/5.2/.opam-switch/build/json-data-encoding.1.0.1/_build/default/json-data-encoding/test/_build/_tests/json-data-encoding'.
# Test Successful in 0.000s. 4 tests run.
# (cd _build/default/json-data-encoding/test && /home/opam/.opam/5.2/bin/js_of_ocaml -o test_destruct.bc.js /home/opam/.opam/5.2/lib/bigstringaf/runtime.js /home/opam/.opam/5.2/lib/cstruct/cstruct.js /home/opam/.opam/5.2/lib/alcotest/runtime.js test_destruct.bc-for-jsoo)
# There are some missing primitives
# Dummy implementations (raising 'Failure' exception) will be used if they are not available at runtime.
# You can prevent the generation of dummy implementations with the commandline option '--disable genprim'
# Missing primitives:
#   caml_domain_dls_compare_and_set
# File "json-data-encoding/test/dune", line 3, characters 2-16:
# 3 |   test_generated
#       ^^^^^^^^^^^^^^
# (cd _build/default/json-data-encoding/test && /usr/bin/node test_generated.bc.js)
# Fatal error: exception Failure("caml_domain_dls_compare_and_set not implemented")
# File "json-data-encoding/test/dune", line 4, characters 2-20:
# 4 |   test_big_streaming
#       ^^^^^^^^^^^^^^^^^^
# (cd _build/default/json-data-encoding/test && /usr/bin/node test_big_streaming.bc.js)
# Fatal error: exception Failure("caml_domain_dls_compare_and_set not implemented")
# File "json-data-encoding/test/dune", line 5, characters 2-9:
# 5 |   test_mu
#       ^^^^^^^
# (cd _build/default/json-data-encoding/test && /usr/bin/node test_mu.bc.js)
# Fatal error: exception Failure("caml_domain_dls_compare_and_set not implemented")
# File "json-data-encoding/test/dune", line 6, characters 2-15:
# 6 |   test_list_map
#       ^^^^^^^^^^^^^
# (cd _build/default/json-data-encoding/test && /usr/bin/node test_list_map.bc.js)
# Fatal error: exception Failure("caml_domain_dls_compare_and_set not implemented")
# File "json-data-encoding/test/dune", line 7, characters 2-18:
# 7 |   test_seq_is_lazy
#       ^^^^^^^^^^^^^^^^
# (cd _build/default/json-data-encoding/test && /usr/bin/node test_seq_is_lazy.bc.js)
# Fatal error: exception Failure("caml_domain_dls_compare_and_set not implemented")
# File "json-data-encoding/test/dune", line 8, characters 2-15:
# 8 |   test_destruct)
#       ^^^^^^^^^^^^^
# (cd _build/default/json-data-encoding/test && /usr/bin/node test_destruct.bc.js)
# Fatal error: exception Failure("caml_domain_dls_compare_and_set not implemented")

It looks like https://github.com/ocsigen/js_of_ocaml/commit/8dd7d54ea474cf830652664f5bd8ba48294ad6d5 fixed the issue, but at the top of the log there might be other missing functions. If that's not the case could we have a 5.7.2 release with that fix, whenever you have some spare time?

Versions OCaml: 5.2.0~beta1 js_of_ocaml: 5.7.1

hhugo commented 3 months ago

Fixed by #1591

kit-ty-kate commented 3 months ago

It looks like 8dd7d54 fixed the issue, but at the top of the log there might be other missing functions. If that's not the case could we have a 5.7.2 release with that fix, whenever you have some spare time?

Yes, I noted that already, this issue was more of a question. Namely: is a release planned? ^^"""

hhugo commented 3 months ago

Sorry, I didn't read the full issue before closing. Ill try to release something next week or so.

kit-ty-kate commented 3 months ago

No worries! Thank you so much!