-
Notifications
You must be signed in to change notification settings - Fork 191
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
Making js_of_ocaml compiler self-contained ? #966
Comments
This seems reasonable. Note that there are other runtime files sometime required and not included in |
Work in progress #978 |
This is now done. I'll open a PR to cleanup dune rules later |
Great, thanks! I will try to test it in a bit. |
@hhugo this looks great.
|
@bobzhang, the findlib dependency is optional ! You should be able to build without it. (select findlib_support.ml from
;; Only link js_of_ocaml-compiler.findlib-support if it exists
(js_of_ocaml-compiler.findlib-support -> findlib_support.empty.ml)
( -> findlib_support.empty.ml)) |
@hhugo that's exactly what I need. FYI, we have successful stories using the bytecode compiler rescript-lang/rescript#4372 -- the motivation is less dependencies for the CI |
Currently the
js_of_ocaml
compiler requires theruntime.js
to be installed alongside it.dune
usesocamlfind
to locateruntime.js
. This means that one needs to haveocamlfind
to usejs_of_ocaml
and it means that you need to installjs_of_ocaml
in order to use it.To avoid the dependency on
ocamlfind
on Windows I implemented a workaround fordune
(ocaml/dune#1467). However, I was wondering if you had given any thought to the idea of getting rid of theruntime.js
file and simply including it as a string in the compiled compiler binary. A flags could be added to produce the file on standard output in case it is needed.This would make the binary completely self-contained. If there is interest in this proposal I could look into implementing it (together with the necessary adaptations for
dune
). I recently implemented something very similar formenhir
(which also depends on a "runtime" file likeruntime.js
) and it worked nicely.The text was updated successfully, but these errors were encountered: