Skip to content

Finer dependency analysis between libraries #4572

@nojb

Description

@nojb

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

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions