forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rudi Grinberg <[email protected]>
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
test/blackbox-tests/test-cases/virtual-libraries/github2896/run.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Reproduction of the issue in #2896 | ||
|
||
We have a dependency cycle of the form impl <- lib <- vlib | ||
|
||
where vlib is a virtual library, and impl implements this library. | ||
|
||
$ echo "(lang dune 2.3)" > dune-project | ||
$ mkdir vlib impl lib | ||
$ touch impl/vlib.ml | ||
$ echo "val run : unit -> unit" > vlib/vlib.mli | ||
$ cat >vlib/dune <<EOF | ||
> (library (name vlib) (virtual_modules vlib)) | ||
> EOF | ||
$ echo "let bar () = Vlib.run ();;" > lib/lib.ml | ||
$ cat >lib/dune <<EOF | ||
> (library (name lib) (libraries vlib)) | ||
> EOF | ||
$ echo "let run () = Lib.bar ();;" > impl/vlib.ml | ||
$ cat >impl/dune <<EOF | ||
> (library (name impl) (implements vlib) (libraries lib)) | ||
> EOF | ||
|
||
The implementation impl was built, but it's not usable: | ||
|
||
$ echo 'Vlib.run ()' > foo.ml | ||
$ echo "(executable (name foo) (libraries impl))" > dune | ||
$ dune exec ./foo.exe | ||
File "_none_", line 1: | ||
Error: No implementations provided for the following modules: | ||
Vlib referenced from lib/lib.cmxa(Lib) | ||
[1] |