Skip to content

Commit a113bfb

Browse files
committed
test: reproduce #3636
Signed-off-by: Rudi Grinberg <me@rgrinberg.com> ps-id: 8C67C2BC-9A74-4CBC-A529-FF41DAD8A4F1
1 parent d3ba724 commit a113bfb

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
(lang dune 1.7)
1+
(lang dune 1.7)
2+
3+
(package (name dune-vlib))
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
(library
22
(name impl)
3-
(implements vlib))
3+
(public_name dune-vlib.impl)
4+
(implements vlib))

test/blackbox-tests/test-cases/virtual-libraries/implements-external.t/run.t

+27-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ First we create an external library
55
Entering directory 'vlib'
66

77
Then we make sure that we can implement it
8-
$ env OCAMLPATH=vlib/_build/install/default/lib dune build --root impl --debug-dependency-path
8+
$ env OCAMLPATH=vlib/_build/install/default/lib dune build @default @install --root impl
99
Entering directory 'impl'
1010
bar from vlib
1111
Foo.run implemented
@@ -25,3 +25,29 @@ Implement external virtual libraries with private modules
2525
$ env OCAMLPATH=vlib/_build/install/default/lib dune build --root impl-private-module --debug-dependency-path
2626
Entering directory 'impl-private-module'
2727
Name: implement virtual module. Magic number: 42
28+
29+
Now we test the following use case:
30+
- A virtual library and its implementation are installed
31+
- We are able to use the implementation as an external dependency in a project
32+
Currently, dune's behavior is broken in this situation. The virtual library's
33+
modules remain hidden.
34+
$ export OCAMLPATH=$PWD/vlib/_build/install/default/lib:$PWD/impl/_build/install/default/lib
35+
$ mkdir use-external-impl && cd use-external-impl
36+
$ cat >dune-project <<EOF
37+
> (lang dune 3.0)
38+
> EOF
39+
$ cat >dune <<EOF
40+
> (executable
41+
> (name blah)
42+
> (libraries dune-vlib.impl))
43+
> EOF
44+
$ cat >blah.ml <<EOF
45+
> Vlib.Foo.run ()
46+
> EOF
47+
$ dune exec ./blah.exe
48+
File "blah.ml", line 1, characters 0-12:
49+
1 | Vlib.Foo.run ()
50+
^^^^^^^^^^^^
51+
Error: Unbound module Vlib
52+
[1]
53+
$ cd ..

0 commit comments

Comments
 (0)