Fix the top closure for internal libs

keying by the private name isn't enough. We include the dir in the key, because
private names are unique per dir.
This commit is contained in:
Rudi Grinberg 2018-02-12 19:30:30 +08:00
parent baa009a0fb
commit 8781c81bd3
2 changed files with 14 additions and 2 deletions

View File

@ -246,10 +246,16 @@ let find_scope = Scope.find_scope
let local_public_libs t = t.local_public_libs
module Local_closure = Top_closure.Make(String)(struct
module Local_closure = Top_closure.Make(struct
type t = Path.t * string
let compare (p1, l1) (p2, l2) =
match String.compare l1 l2 with
| 0 -> Path.compare p1 p2
| x -> x
end)(struct
type graph = t
type t = Lib.Internal.t
let key ((_, lib) : t) = lib.name
let key ((dir, lib) : t) = (dir, lib.name)
let deps ((dir, lib) : Lib.Internal.t) graph =
let scope = find_scope graph ~dir in
List.concat_map lib.buildable.libraries ~f:(fun dep ->

View File

@ -1,7 +1,13 @@
$ $JBUILDER build @install -j1 --display short --root .
ocamldep a1/a.ml.d
ocamldep a2/a.ml.d
ocamlc a1/.a.objs/a.{cmi,cmo,cmt}
ocamlc a2/.a.objs/a.{cmi,cmo,cmt}
ocamlopt a1/.a.objs/a.{cmx,o}
ocamlc a1/a.cma
ocamlopt a2/.a.objs/a.{cmx,o}
ocamlc a2/a.cma
ocamlopt a1/a.{a,cmxa}
ocamlopt a2/a.{a,cmxa}
ocamlopt a1/a.cmxs
ocamlopt a2/a.cmxs