Skip to content

Commit

Permalink
fix: link time code gen + implicit transtive deps (ocaml#6642)
Browse files Browse the repository at this point in the history
correctly set the includes when computing the compilation context for
link time modules

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg authored Dec 6, 2022
1 parent 54eeca4 commit 670b7fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 4 additions & 0 deletions src/dune_rules/compilation_context.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 0 additions & 4 deletions test/blackbox-tests/test-cases/link-time-transitive-deps.t
Original file line number Diff line number Diff line change
Expand Up @@ -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]

0 comments on commit 670b7fb

Please sign in to comment.