File tree 3 files changed +32
-3
lines changed
test/blackbox-tests/test-cases/virtual-libraries/implements-external.t
3 files changed +32
-3
lines changed Original file line number Diff line number Diff line change 1
- (lang dune 1 .7)
1
+ (lang dune 1 .7)
2
+
3
+ ( package (name dune-vlib))
Original file line number Diff line number Diff line change 1
1
(library
2
2
(name impl)
3
- (implements vlib))
3
+ (public_name dune-vlib.impl)
4
+ (implements vlib))
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ First we create an external library
5
5
Entering directory ' vlib'
6
6
7
7
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
9
9
Entering directory ' impl'
10
10
bar from vlib
11
11
Foo. run implemented
@@ -25,3 +25,29 @@ Implement external virtual libraries with private modules
25
25
$ env OCAMLPATH= vlib/ _build/ install/ default / lib dune build -- root impl-private-module -- debug-dependency-path
26
26
Entering directory ' impl-private-module'
27
27
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 ..
You can’t perform that action at this time.
0 commit comments