Skip to content

Commit

Permalink
test: vendored and public libs (#7197)
Browse files Browse the repository at this point in the history
Demonstrate that a public library is currently allowed to depend on a
public library that is vendored. This should not work.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg authored Mar 2, 2023
1 parent f6deaf9 commit e909c5a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/blackbox-tests/test-cases/vendor/public-libs.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
A public library shouldn't be allowed to depend on a vendored library.

A public library that depends on a vendored library is impossible to install,
since we cannot install the vendored artifacts.

$ cat >dune-project <<EOF
> (lang dune 3.7)
> (package (name foo))
> EOF

$ mkdir -p vendor/mypkg
$ cat >vendor/mypkg/dune-project <<EOF
> (lang dune 3.8)
> (package (name mypkg))
> EOF

$ cat >vendor/mypkg/dune <<EOF
> (library
> (name invendor)
> (public_name mypkg.invendor))
> EOF

$ cat >dune <<EOF
> (vendored_dirs vendor)
> (library
> (libraries mypkg.invendor)
> (public_name foo))
> EOF

$ dune build foo.cma

0 comments on commit e909c5a

Please sign in to comment.