caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Helmut Brandl <helmut.brandl@gmx.net>
To: caml-list@inria.fr
Subject: [Caml-list] Dune compilation problems using js_of_ocaml with libraries
Date: Fri, 6 Dec 2019 15:05:22 -0600	[thread overview]
Message-ID: <5E22BE69-349B-4612-93CC-FAE5F2F4AFD6@gmx.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 2456 bytes --]

Hello list.

I have a project with various libraries which I compile using dune. One of the executable is a javascript executable (executable under nodejs).

For the javascript executable I encounter the following problem:

- If I build with ‘—profile release’ everything works fine, except that I get a warning that some primitives are missing. But the program works fine i.e. the missing primitives are obviously not used.

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


- If I build with the default profile (i.e. — profile dev), then starting the program I get the error message

/Users/helmut/myprogs/alba/program/_build/default/ocaml/alba-node/alba_node.bc.js:51209
    runtime.ml_setup_bridges(0);
            ^

TypeError: runtime.ml_setup_bridges is not a function
    at /Users/helmut/myprogs/alba/program/_build/default/ocaml/alba-node/alba_node.bc.js:51209:13
    at Object.<anonymous> (/Users/helmut/myprogs/alba/program/_build/default/ocaml/alba-node/alba_node.bc.js:51243:3)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)
    at executeUserCode (internal/bootstrap/node.js:342:17)
    at startExecution (internal/bootstrap/node.js:276:5)

I assume that there is something missing to load the libraries.

Using the release profile is no principal problem, but compile times are much longer than compiling with the development profile.

Does anybody have an idea how to get the build with development profile working? Should I report the problem to another forum?

Thanks for any hints.
Helmut

[-- Attachment #2: Type: text/html, Size: 9367 bytes --]

                 reply	other threads:[~2019-12-06 21:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5E22BE69-349B-4612-93CC-FAE5F2F4AFD6@gmx.net \
    --to=helmut.brandl@gmx.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).