Skip to content

Do not link js_of_ocaml in the server library - #277

Merged
balat merged 1 commit into
masterfrom
server-no-jsoo
Oct 29, 2026
Merged

balat merged 1 commit into
masterfrom
server-no-jsoo

Conversation

@balat

@balat balat commented Oct 29, 2026

Copy link
Copy Markdown
Member

Since #247, the server library depends on js_of_ocaml (--server-libraries js_of_ocaml, which replaced the old type_includes hack). I think this breaks every application loaded by ocsigenserver from a configuration file: ocsigen-toolkit.server now requires js_of_ocaml, so ocsigenserver loads js_of_ocaml.cma with the application, and its module Js fails at initialisation outside a browser:

Fatal error: Unimplemented Javascript primitive caml_pure_js_expr!

A standalone executable does not link these modules, which is why the CI and dune exec do not see it (found while testing os_template in both modes).

The server library still needs the interfaces of js_of_ocaml, for the types of client values in shared signatures (Dom_html.touchEvent Js.t in swipe, File.file Js.t in picture_uploader, form). So this adds only the include directory, through a type_includes rule and an env stanza in the hand-written part of src/widgets/Ot/dune, and removes the dependency. The generated part is unchanged (dune runtest is clean).

Checked: the META of ocsigen-toolkit.server no longer requires js_of_ocaml; ocsigen-start builds against it without change; os_template loads from a configuration file again (together with ocsigen/eliom's fix for the <eliommodule> configuration).

Since #247 the server library depended on js_of_ocaml for the types of
client values in shared signatures. ocsigenserver then loaded
js_of_ocaml.cma with the application, and its module Js failed at
initialisation (Unimplemented Javascript primitive caml_pure_js_expr).
Add only the include directory, as before #247.
@balat
balat merged commit 82a0d8e into master Oct 29, 2026
3 checks passed
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.

1 participant