You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is needed primarily for MirageOS, but may also be useful for others. We would like a way to disable production of all shared libraries (.cmxs for OCaml, .so for C code) on a per-project (or indeed, for Mirage on a "entire universe") basis.
The only workaround which currently works without requiring any hacks or foreign library changes is to create a custom compiler variant where that compiler is configured with --disable-shared, which propagates down to dune nicely.
That doesn't seem like a hack. It seems like there should be a way to set this option for any context from inside dune.
How about we make it possible to override the -config options for any context from inside dune? This could be done in the workspace file:
Trying to do this at the dune-level is probably rather tricky (for example, ocamlmklib will produce shared libraries if those are supported by the compiler, and this cannot be controlled by an external flag if memory serves). So it feels like it would be better to address this issue at the level of the compiler.
@nojb Actually, dune already does "the right thing", if the compiler is built with --disable-shared, I tested this by adding a custom variant to OPAM. This is about having a way of "emulating" that behaviour against a compiler that hasn't been built that way, as I understand it, that should be possible by just modifying dune's "view" of the compiler configuration as Rudi suggested.
and this cannot be controlled by an external flag if memory serves
-custom will stop ocamlmklib from producing shared libraries.
This is needed primarily for MirageOS, but may also be useful for others. We would like a way to disable production of all shared libraries (.cmxs for OCaml, .so for C code) on a per-project (or indeed, for Mirage on a "entire universe") basis.
That doesn't seem like a hack. It seems like there should be a way to set this option for any context from inside dune.
How about we make it possible to override the
-config
options for any context from inside dune? This could be done in the workspace file:Originally posted by @rgrinberg in #3718 (comment)
The text was updated successfully, but these errors were encountered: