Skip to content

Commit

Permalink
Fix vlib-default-impl for dune-package
Browse files Browse the repository at this point in the history
The library that was used for default-implementation didn't exist
previously and our error checking was lax.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
  • Loading branch information
rgrinberg committed Aug 20, 2019
1 parent 157ff12 commit 6706628
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(library
(name a_default)
(public_name a.default-impl)
(implements a))
Empty file.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(library
(public_name a)
(virtual_modules x)
(default_implementation a-default))
(default_implementation a_default))

(rule
(with-stdout-to
Expand Down
56 changes: 48 additions & 8 deletions test/blackbox-tests/test-cases/vlib-default-impl/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,55 @@ Check that ambiguity is handled correctly.
Check that default implementation data is installed in the dune package file.
$ dune build --root dune-package
Entering directory 'dune-package'
File "dune", line 4, characters 25-34:
4 | (default_implementation a-default))
^^^^^^^^^
Error: Library "a-default" not found.
Hint: try: dune external-lib-deps --missing --root dune-package @@default
[1]
$ cat dune-package/_build/install/default/lib/a/dune-package
cat: dune-package/_build/install/default/lib/a/dune-package: No such file or directory
[1]
(lang dune 2.0)
(name a)
(library
(name a)
(kind normal)
(virtual)
(foreign_archives (native a$ext_lib))
(default_implementation a.default-impl)
(main_module_name A)
(modes byte native)
(modules
(wrapped
(main_module_name A)
(modules
((name X) (obj_name a__X) (visibility public) (kind virtual) (intf)))
(alias_module
(name A)
(obj_name a)
(visibility public)
(kind alias)
(impl))
(wrapped true))))
(library
(name a.default-impl)
(kind normal)
(archives
(byte default-impl/a_default.cma)
(native default-impl/a_default.cmxa))
(plugins
(byte default-impl/a_default.cma)
(native default-impl/a_default.cmxs))
(foreign_archives (native default-impl/a_default$ext_lib))
(requires a)
(implements a)
(main_module_name A)
(modes byte native)
(modules
(wrapped
(main_module_name A)
(modules
((name X) (obj_name a__X) (visibility public) (kind impl_vmodule) (impl)))
(alias_module
(name A__a_default__)
(obj_name a__a_default__)
(visibility public)
(kind alias)
(impl))
(wrapped true))))

Test default implementation for an external library

Expand Down

0 comments on commit 6706628

Please sign in to comment.