Skip to content

Commit

Permalink
test: transitive deps and link time code gen (#6641)
Browse files Browse the repository at this point in the history
reproduce the issue in PR #6633

link time code generation doesn't use the correct compilation closure
for the build info module. It uses the compile closure but we should use
the link closure

Signed-off-by: Rudi Grinberg <[email protected]>
  • Loading branch information
rgrinberg authored Dec 6, 2022
1 parent fb085c0 commit 54eeca4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/blackbox-tests/test-cases/dune
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,8 @@
(deps
(package stdune)
(package ppx_expect)))

(cram
(applies_to link-time-transitive-deps)
(deps
(package dune-build-info)))
24 changes: 24 additions & 0 deletions test/blackbox-tests/test-cases/link-time-transitive-deps.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Link time code generation should work with implicit transitive deps

$ cat >dune-project <<EOF
> (lang dune 3.0)
> (implicit_transitive_deps false)
> EOF

$ touch foo.ml bar.ml
$ cat >dune <<EOF
> (library
> (libraries dune-build-info)
> (modules foo)
> (name foo))
> (executable
> (modules bar)
> (libraries foo)
> (name bar))
> 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 54eeca4

Please sign in to comment.