File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -134,17 +134,21 @@ module Deps = struct
134
134
in
135
135
loop deps
136
136
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. *)
138
142
let impl_deps archives =
139
143
List. map
140
- (fun l1 ->
144
+ (fun ( l1 : Archive.t ) ->
141
145
let deps =
142
146
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 ) &&
145
149
not
146
150
@@ StringSet. is_empty
147
- (StringSet. inter l1.Archive. impl_deps l2. Archive . modules))
151
+ (StringSet. inter l1.impl_deps l2.modules))
148
152
archives
149
153
in
150
154
(l1.name, List. map (fun x -> x.Archive. name) deps |> StringSet. of_list))
You can’t perform that action at this time.
0 commit comments