Finer dependency analysis between libraries
@robinbb is already working on this.
Since May 20, 2026.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 17m
- Merged PRs (30d)
- 287
Description
Currently, dune uses per-module dependency information (as reported by ocamldep) within a given library. Between libraries, dune simply overapproximates by assuming that if a library libA depends on a library libB then every module of libA depends on every module of libB.
This means that as soon as a module in libB is changed, then every module in libA is recompiled (this is somewhat aliviated in dev mode, where changes to implementations in libB will not cause recompilation of of modules in libA).
This causes extra recompilation (especially in the case of unwrapped libraries). Today in the dev meeting it was proposed to use the output of ocamldep to specify per-module dependencies not only within a given library but also across libraries.
In the case when libB is wrapped, there is less potential improvement (given that as soon as a module in libA depends on the interface module of libB one must assume that it could depend on any module of libB), but even in that case, if a module in libA does not depend at all in libB one could avoid some recompilation.
cc @rgrinberg
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.