ocaml / ocaml/dune

Disable production of shared libraries (.cmxs, .so)

Open
#3,934 2 comments 0 reactions 1 assignee View on GitHub

@rgrinberg is already working on this.

Since Nov 11, 2020.

package management
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.