diff --git a/CHANGES.md b/CHANGES.md index 3bac396f704..07018809ef4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,9 @@ Unreleased ---------- +- Fix the compilation of modules generated at link time when + `implicit_transitive_deps` is enabled (#6642, @rgrinberg) + - Allow `$ dune utop` to load libraries defined in data only directories defined using `(subdir ..)` (#6631, @rgrinberg) diff --git a/src/dune_rules/compilation_context.ml b/src/dune_rules/compilation_context.ml index cba3358bd20..9675e284e93 100644 --- a/src/dune_rules/compilation_context.ml +++ b/src/dune_rules/compilation_context.ml @@ -257,11 +257,15 @@ let for_module_generated_at_link_time cctx ~requires ~module_ = Ocaml.Version.supports_opaque_for_mli ctx.version in let modules = singleton_modules module_ in + let includes = + Includes.make ~project:(Scope.project cctx.scope) ~opaque ~requires + in { cctx with opaque ; flags = Ocaml_flags.empty ; requires_link = Memo.lazy_ (fun () -> requires) ; requires_compile = requires + ; includes ; modules } diff --git a/test/blackbox-tests/test-cases/link-time-transitive-deps.t b/test/blackbox-tests/test-cases/link-time-transitive-deps.t index 0100d3daf5a..61599683445 100644 --- a/test/blackbox-tests/test-cases/link-time-transitive-deps.t +++ b/test/blackbox-tests/test-cases/link-time-transitive-deps.t @@ -18,7 +18,3 @@ Link time code generation should work with implicit transitive deps > EOF $ dune build ./bar.exe - File ".bar.eobjs/build_info_data.ml-gen", line 1: - Error: Could not find the .cmi file for interface - .bar.eobjs/build_info_data.ml-gen. - [1]