ocaml / dune

A composable build system for OCaml.

Home Page:https://dune.build/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

optional compilation

vbmithr opened this issue · comments

[vb@haramis ~/code/ocaml-websocket]% jbuilder external-lib-deps --missing @install
Error: The following required libraries are missing in the default context:
- cryptokit (optional)

I am using the following stanza:

(library
 ((name rng_cryptokit)
  (public_name websocket.rng_cryptokit)
  (modules (rng_cryptokit))
  (optional)
  (libraries (rng cryptokit))))

Why jbuilder insists on building this if it is flagged optional and that cryptokit is not installed?

Maybe it's required by a non-optional library or an executable that is to be installed?

No, not that I can see.
Maybe you can have a look and try to compile : https://github.com/vbmithr/ocaml-websocket/tree/jbuilder

Can you try putting the optional libraries in separate directories? It might have to do with the merging of the .merlin

This works. But still a bug.

Indeed, I documented it. I'd say it's low-priority

I head that merlin should eventually read flags from .cmt[i] files directly, which will solve this issue, so it's probably best to just wait for now