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

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

Open
dbuenzli opened this issue Mar 9, 2025 · 2 comments
Open

Comments

@dbuenzli
Copy link
Contributor

dbuenzli commented Mar 9, 2025

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 ?

@hhugo
Copy link
Member

hhugo commented Mar 11, 2025

What about --quiet ?

@dbuenzli
Copy link
Contributor Author

-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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants