Skip to content

Commit

Permalink
test: reproduce #3636
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>

ps-id: 8C67C2BC-9A74-4CBC-A529-FF41DAD8A4F1
  • Loading branch information
rgrinberg committed Nov 4, 2021
1 parent 04167da commit 9203caf
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
(lang dune 1.7)
(lang dune 1.7)

(package (name dune-vlib))
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(library
(name impl)
(implements vlib))
(public_name dune-vlib.impl)
(implements vlib))
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ First we create an external library
Entering directory 'vlib'

Then we make sure that we can implement it
$ env OCAMLPATH=vlib/_build/install/default/lib dune build --root impl --debug-dependency-path
$ env OCAMLPATH=vlib/_build/install/default/lib dune build @default @install --root impl
Entering directory 'impl'
bar from vlib
Foo.run implemented
Expand All @@ -25,3 +25,25 @@ Implement external virtual libraries with private modules
$ env OCAMLPATH=vlib/_build/install/default/lib dune build --root impl-private-module --debug-dependency-path
Entering directory 'impl-private-module'
Name: implement virtual module. Magic number: 42

Now we install an implementation, and make sure that it remains usable
$ export OCAMLPATH=$PWD/vlib/_build/install/default/lib:$PWD/impl/_build/install/default/lib
$ mkdir use-external-impl && cd use-external-impl
$ cat >dune-project <<EOF
> (lang dune 3.0)
> EOF
$ cat >dune <<EOF
> (executable
> (name blah)
> (libraries dune-vlib.impl))
> EOF
$ cat >blah.ml <<EOF
> Vlib.Foo.run ()
> EOF
$ dune exec ./blah.exe
File "blah.ml", line 1, characters 0-12:
1 | Vlib.Foo.run ()
^^^^^^^^^^^^
Error: Unbound module Vlib
[1]
$ cd ..

0 comments on commit 9203caf

Please sign in to comment.