Skip to content

Commit d0c5a89

Browse files
committed
Remove explicit OCaml transitive dependency files
Compute transitive module dependency closures directly from anonymous ocamldep and ocamlobjinfo actions instead of materializing .all-deps files. This removes the merge-file rule path for internal dependency setup while preserving module-level cycle diagnostics. As a side-effect, this fixes an ugly "Rule not found" error. Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
1 parent 5c705ee commit d0c5a89

22 files changed

Lines changed: 504 additions & 319 deletions

src/dune_graph/graph.ml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -220,17 +220,9 @@ module String_opt_map = Map.Make (struct
220220

221221
let serialize_summary t oc =
222222
let open Aggregated in
223-
(* CR-someday cmoseley: A memo node is created for each *.all-deps target
224-
which fills up the summary with noise. This is a hacky fix for it right
225-
now, it would be better to find something else to aggregate on or to move
226-
these nodes to a single table since they only have a single entry each *)
227-
let rename_all_deps label =
228-
Option.map label ~f:(fun label ->
229-
if String.ends_with ~suffix:".all-deps" label then "*.all-deps" else label)
230-
in
231223
let by_label =
232224
Int.Map.fold t.nodes ~init:String_opt_map.empty ~f:(fun node acc ->
233-
let label = rename_all_deps node.label in
225+
let label = node.label in
234226
let attributes =
235227
Option.value
236228
~default:Int.Map.empty
@@ -253,7 +245,7 @@ let serialize_summary t oc =
253245
let by_label =
254246
Edge.Set.fold t.edges ~init:by_label ~f:(fun edge acc ->
255247
let get_label id =
256-
Option.bind (Int.Map.find t.nodes id) ~f:(fun node -> rename_all_deps node.label)
248+
Option.bind (Int.Map.find t.nodes id) ~f:(fun node -> node.label)
257249
in
258250
let src_label = get_label edge.src_id in
259251
let dst_label = get_label edge.dst_id in

src/dune_rules/compilation_context.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ let create
210210
~sctx:super_context
211211
~impl:implements
212212
~modules
213-
~for_
214213
and+ bin_annot =
215214
match bin_annot with
216215
| Some b -> Memo.return b

0 commit comments

Comments
 (0)