Disable production of shared libraries (.cmxs, .so)
@rgrinberg is already working on this.
Since Nov 11, 2020.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
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:
(context
(default
(config
(supports_shared _libraries false))))
Originally posted by @rgrinberg in https://github.com/ocaml/dune/issues/3718#issuecomment-712428099
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.