Skip to content

Commit 4517504

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

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-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

+25-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,27 @@ 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+
$ export OCAMLPATH=$PWD/vlib/_build/install/default/lib:$PWD/impl/_build/install/default/lib
33+
$ mkdir use-external-impl && cd use-external-impl
34+
$ cat >dune-project <<EOF
35+
> (lang dune 3.0)
36+
> EOF
37+
$ cat >dune <<EOF
38+
> (executable
39+
> (name blah)
40+
> (libraries dune-vlib.impl))
41+
> EOF
42+
$ cat >blah.ml <<EOF
43+
> Vlib.Foo.run ()
44+
> EOF
45+
$ dune exec ./blah.exe
46+
File "blah.ml", line 1, characters 0-12:
47+
1 | Vlib.Foo.run ()
48+
^^^^^^^^^^^^
49+
Error: Unbound module Vlib
50+
[1]
51+
$ cd ..

0 commit comments

Comments
 (0)