Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix js of ocaml #542

Merged
merged 3 commits into from
Jan 9, 2023
Merged

Fix js of ocaml #542

merged 3 commits into from
Jan 9, 2023

Conversation

Halbaroth
Copy link
Collaborator

This PR resolves the compilation error about the missing primitive unix_gettimeoftheday. Since the release 4.1.0 of js_of_ocaml, the function has been renamed as caml_unix_gettimeoftheday. See ocsigen/js_of_ocaml#1370.

  • I also fixed the command make js.
  • I set the option --no-source-map for the release profile only. Indeed, according to the js_of_ocaml documentation, producing a mapping between the OCaml source and the generated Javascript gives a bigger and slower binary. Yet, the option could be useful for debugging purposes.
  • I tried to remove the below warning message throwing by make:
Warning: '--source-map' is enabled but the bytecode program was compiled with no debugging information.
Warning: Consider passing '-g' option to ocamlc.

This error is produced during the compilation with js_of_ocaml of the Zarith library. The warning oddly disappears if we turn off the separation compilation in js_of_ocaml but we got a bunch of new warning messages about missing primitives:

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 provided by +dynlink.js:
  caml_dynlink_add_primitive
  caml_dynlink_get_current_libs
  caml_dynlink_lookup_symbol
  caml_dynlink_open_lib
Missing primitives provided by +toplevel.js:
  caml_get_section_table
  caml_realloc_global
  caml_reify_bytecode

@Halbaroth Halbaroth marked this pull request as ready for review December 23, 2022 09:04
Copy link
Collaborator

@Gbury Gbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@Halbaroth Halbaroth merged commit 5f63a49 into OCamlPro:next Jan 9, 2023
@Ninjapouet Ninjapouet added this to the 2.5.0 milestone Jan 17, 2023
Halbaroth added a commit to Halbaroth/alt-ergo that referenced this pull request Apr 15, 2023
* Upgrade to js_of_ocaml 5

* Fix the makefile for the js target

* Simplify dune file

* Require dune 2.8+
Halbaroth added a commit that referenced this pull request Apr 17, 2023
* CI: avsm/setup-ocaml@v2 -> ocaml/setup-ocaml@v2

* Fix CI: (#525)

- Replaced `ocaml-version` with `ocaml-compiler`
- Switched to `actions/checkout@v3`

* Fix js of ocaml (#542)

* Upgrade to js_of_ocaml 5

* Fix the makefile for the js target

* Simplify dune file

* Require dune 2.8+

* Fix CI (#560)

* JS: add missing primitives

* Set upper bound 5.0.1 for js_of_ocaml

---------

Co-authored-by: hra687261 <hra687261@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants