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
Add finer-grained dependency analysis between libraries. When a library's
interface changes, only modules that actually USE that library are
recompiled. Modules that don't reference the library are NOT recompiled.
Three key mechanisms:
1. Per-module filtering via ocamldep: Reads raw module names from ocamldep
output, maps them to libraries via Lib_index, and uses dyn_deps to add
library file deps only for libraries each module actually references.
2. Per-file deps for unwrapped libraries: Lib_index stores Module.t values
for local unwrapped library modules, enabling Dep.file dependencies on
specific .cmi/.cmx files instead of glob patterns. Changing helper.mli
only recompiles modules referencing Helper, not Utils.
3. Skip library deps for alias modules: Wrapper/alias modules (dune__exe)
only re-export stanza modules and don't reference library modules, so
they get no library file deps. This prevents a cascade where wrapper
.cmi changes would trigger recompilation of all stanza modules.
Changes:
- compilation_context.ml: Remove Hidden_deps from Includes.make; add
lib_file_deps that dispatches per-file vs glob based on entry type
- module_compilation.ml: Add per-module dyn_deps; skip lib deps for
Alias modules; adapt all paths to use entry list
- lib_file_deps.ml: Add Lib_index with (Lib.t * Module.t option) entries
and deps_of_module for per-file deps; expose deps_of_lib
- ocamldep.ml: Add read_immediate_deps_raw_of; handle missing dep files
- dep_graph.ml: Add dir accessor for synthetic context detection
This fixes issue #4572: Finer dependency analysis between libraries.
Signed-off-by: Robin Bate Boerop <me@robinbb.com>
0 commit comments