diff --git a/src/inline_tests.ml b/src/inline_tests.ml index c0387fd4..4788f123 100644 --- a/src/inline_tests.ml +++ b/src/inline_tests.ml @@ -188,7 +188,7 @@ include Sub_system.Register_end_point( Result.List.concat_map backends ~f:(fun (backend : Backend.t) -> backend.runner_libraries) >>= fun libs -> - Lib.DB.find_many (Scope.libs scope) [Lib_name.of_local lib.name] + Lib.DB.find_many (Scope.libs scope) [Dune_file.Library.best_name lib] >>= fun lib -> Result.List.all (List.map info.libraries diff --git a/src/lib.ml b/src/lib.ml index dede5e94..8c3987c6 100644 --- a/src/lib.ml +++ b/src/lib.ml @@ -954,11 +954,11 @@ module DB = struct let info = Info.of_library_stanza ~dir ~ext_lib conf in match conf.public with | None -> - [Lib_name.of_local conf.name, Resolve_result.Found info] + [Dune_file.Library.best_name conf, Resolve_result.Found info] | Some p -> let name = Dune_file.Public_lib.name p in if name = Lib_name.of_local conf.name then - [(name, Found info)] + [name, Found info] else [ name , Found info ; Lib_name.of_local conf.name, Redirect (None, name) @@ -1032,10 +1032,10 @@ module DB = struct let available t name = available_internal t name ~stack:Dep_stack.empty let get_compile_info t ?(allow_overlaps=false) name = - match find_even_when_hidden t (Lib_name.of_local name) with + match find_even_when_hidden t name with | None -> Exn.code_error "Lib.DB.get_compile_info got library that doesn't exist" - [ "name", Lib_name.Local.to_sexp name ] + [ "name", Lib_name.to_sexp name ] | Some lib -> let t = Option.some_if (not allow_overlaps) t in Compile.for_lib t lib diff --git a/src/lib.mli b/src/lib.mli index a593850e..2d6644c6 100644 --- a/src/lib.mli +++ b/src/lib.mli @@ -284,8 +284,7 @@ module DB : sig (** Retrieve the compile information for the given library. Works for libraries that are optional and not available as well. *) - val get_compile_info - : t -> ?allow_overlaps:bool -> Lib_name.Local.t -> Compile.t + val get_compile_info : t -> ?allow_overlaps:bool -> Lib_name.t -> Compile.t val resolve : t -> Loc.t * Lib_name.t -> lib Or_exn.t diff --git a/src/lib_rules.ml b/src/lib_rules.ml index dbd8d2b4..2db4c20a 100644 --- a/src/lib_rules.ml +++ b/src/lib_rules.ml @@ -422,7 +422,7 @@ module Gen (P : Install_rules.Params) = struct let rules (lib : Library.t) ~dir_contents ~dir ~scope ~dir_kind : Compilation_context.t * Merlin.t = let compile_info = - Lib.DB.get_compile_info (Scope.libs scope) lib.name + Lib.DB.get_compile_info (Scope.libs scope) (Library.best_name lib) ~allow_overlaps:lib.buildable.allow_overlapping_dependencies in SC.Libs.gen_select_rules sctx compile_info ~dir; diff --git a/src/odoc.ml b/src/odoc.ml index 8724f5fe..7f5ee36d 100644 --- a/src/odoc.ml +++ b/src/odoc.ml @@ -197,7 +197,7 @@ module Gen (S : sig val sctx : SC.t end) = struct ~requires ~(dep_graphs:Ocamldep.Dep_graph.t Ml_kind.Dict.t) = let lib = Option.value_exn (Lib.DB.find_even_when_hidden (Scope.libs scope) - (Lib_name.of_local library.name)) in + (Library.best_name library)) in (* Using the proper package name doesn't actually work since odoc assumes that a package contains only 1 library *) let pkg_or_lnu = pkg_or_lnu lib in @@ -517,7 +517,7 @@ module Gen (S : sig val sctx : SC.t end) = struct let scope = SC.find_scope_by_dir sctx w.ctx_dir in Some (Option.value_exn ( Lib.DB.find_even_when_hidden (Scope.libs scope) - (Lib_name.of_local l.name)) + (Library.best_name l)) ) end | _ -> None diff --git a/src/super_context.ml b/src/super_context.ml index 1e09a276..35291aa8 100644 --- a/src/super_context.ml +++ b/src/super_context.ml @@ -541,7 +541,7 @@ let create let keep = match (stanza : Stanza.t) with | Library lib -> - Lib.DB.available (Scope.libs scope) (Lib_name.of_local lib.name) + Lib.DB.available (Scope.libs scope) (Library.best_name lib) | Documentation _ | Install _ -> true | _ -> false diff --git a/src/utop.ml b/src/utop.ml index b3f4e6f8..aa2e612a 100644 --- a/src/utop.ml +++ b/src/utop.ml @@ -65,9 +65,7 @@ let setup sctx ~dir ~(libs : Library.t list) ~scope = let requires = let open Result.O in Lib.DB.find_many (Scope.libs scope) - (Lib_name.of_string_exn "utop" - :: List.map libs ~f:(fun (lib : Library.t) -> - Lib_name.of_local lib.name)) + (Lib_name.of_string_exn "utop" :: List.map libs ~f:Library.best_name) >>= Lib.closure in let cctx =