js_of_ocaml icon indicating copy to clipboard operation
js_of_ocaml copied to clipboard

[FEATURE REQUEST] Disable the "There are some missing primitives" message.

Open dbuenzli opened this issue 11 months ago • 2 comments

Unless I'm mistaken (based on a read of js_of_ocaml --help) there is no specific flag that allows to disable these error messages:

[jsont.test_brr js_of_ocaml][0]: (b0 log --id 4813)
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_unix_access
  caml_unix_chdir
  caml_unix_dup
  caml_unix_environment
  caml_unix_getcwd
  caml_unix_spawn
  caml_unix_waitpid

would it please be possible to add one ?

dbuenzli avatar Mar 09 '25 17:03 dbuenzli

What about --quiet ?

hhugo avatar Mar 11 '25 12:03 hhugo

-q, --quiet suppress non-error messages.

I don't know, it doesn't look very fine grained. I'm interested in suppressing only this particular message. So the question is what other interesting message would using that option hide ?

Basically my workflow is:

  1. By default I want to know about these and fix those that are appropriate.
  2. When I have determined the remaining ones should not end up being executed, add a flag to suppress the warning.

Another, more robust, alternative would be to be able to list identifiers in a file which should not be warned about.

Btw. I think I would rather have used a dedicated exception rather than raise Failure _, there's chances for Failure _ to be handled by code that surrounds use of primitives that are normally not expected to raise Failure _, e.g. because the programmer uses failwith for control flow.

dbuenzli avatar Mar 11 '25 15:03 dbuenzli

Thanks!

dbuenzli avatar Jun 23 '25 11:06 dbuenzli