Skip to content

Commit 79a06b7

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 d29a328 commit 79a06b7

22 files changed

Lines changed: 204 additions & 299 deletions

File tree

otherlibs/stdune/src/filename.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ module Extension = struct
3737
let cmsi = ".cmsi"
3838
let odoc = ".odoc"
3939
let d = ".d"
40-
let all_deps = ".all-deps"
4140
let js = ".js"
4241
let h = ".h"
4342
let mlg = ".mlg"

otherlibs/stdune/src/filename.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ module Extension : sig
5353
val odoc : t
5454
val h : t
5555
val d : t
56-
val all_deps : t
5756
val js : t
5857
val mlg : t
5958
val json : t

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

0 commit comments

Comments
 (0)