diff --git a/src/dune_rules/compilation_context.ml b/src/dune_rules/compilation_context.ml index 3694e05b502..3c1715c7586 100644 --- a/src/dune_rules/compilation_context.ml +++ b/src/dune_rules/compilation_context.ml @@ -227,5 +227,4 @@ let without_bin_annot t = { t with bin_annot = false } let root_module_entries t : Module_name.t list Or_exn.t = let open Result.O in let* requires = t.requires_compile in - let local_lib = Fdecl.get Super_context.modules_of_lib t.super_context in - Result.List.concat_map requires ~f:(Lib.entry_module_names ~local_lib) + Result.List.concat_map requires ~f:Lib.entry_module_names diff --git a/src/dune_rules/lib.ml b/src/dune_rules/lib.ml index 0b20f51d335..6fc399d1d3d 100644 --- a/src/dune_rules/lib.ml +++ b/src/dune_rules/lib.ml @@ -368,13 +368,13 @@ let main_module_name t = | This x -> x | From _ -> assert false ) -let entry_module_names t ~local_lib = +let entry_module_names t = match Lib_info.entry_modules t.info with | External d -> d | Local -> - let info = Lib_info.as_local_exn t.info in - let modules = local_lib ~dir:(Lib_info.src_dir info) ~name:t.name in - Ok (Modules.entry_modules modules |> List.map ~f:Module.name) + Ok + ( Option.value_exn t.modules |> Lazy.force |> Modules.entry_modules + |> List.map ~f:Module.name ) let wrapped t = let wrapped = Lib_info.wrapped t.info in diff --git a/src/dune_rules/lib.mli b/src/dune_rules/lib.mli index f87a955ff1a..5b02e92b758 100644 --- a/src/dune_rules/lib.mli +++ b/src/dune_rules/lib.mli @@ -27,10 +27,7 @@ val info : t -> Path.t Lib_info.t val main_module_name : t -> Module_name.t option Or_exn.t -val entry_module_names : - t - -> local_lib:(dir:Path.Build.t -> name:Lib_name.t -> Modules.t) - -> Module_name.t list Or_exn.t +val entry_module_names : t -> Module_name.t list Or_exn.t val wrapped : t -> Wrapped.t option Or_exn.t