Skip to content

Commit 3e916c8

Browse files
committed
Update comments in classify
1 parent e8c1c08 commit 3e916c8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/odoc/classify.cppo.ml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,21 @@ module Deps = struct
134134
in
135135
loop deps
136136

137-
(* Return a dag showing dependencies between archives due to module initialisation order *)
137+
(* Return a dag showing dependencies between archives due to module initialisation order.
138+
In rare cases, modules are shared between archives which would lead to the graph
139+
having cycles, so we explicitly remove those from consideration by checking that the
140+
intersection of module names in the archives is empty. These archives can't be linked
141+
together anyway. *)
138142
let impl_deps archives =
139143
List.map
140-
(fun l1 ->
144+
(fun (l1 : Archive.t) ->
141145
let deps =
142146
List.filter
143-
(fun l2 ->
144-
((StringSet.inter l1.Archive.modules l2.Archive.modules |> StringSet.cardinal) = 0) && (* Can't be co-linked if there are common module names *)
147+
(fun (l2 : Archive.t) ->
148+
((StringSet.inter l1.modules l2.modules |> StringSet.cardinal) = 0) &&
145149
not
146150
@@ StringSet.is_empty
147-
(StringSet.inter l1.Archive.impl_deps l2.Archive.modules))
151+
(StringSet.inter l1.impl_deps l2.modules))
148152
archives
149153
in
150154
(l1.name, List.map (fun x -> x.Archive.name) deps |> StringSet.of_list))

0 commit comments

Comments
 (0)