From 6d3f9e00230d5b0585c1614fbc3114d40d9f1b11 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Tue, 28 Feb 2023 14:51:37 -0600 Subject: [PATCH] test: vendored and public libs 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 --- .../test-cases/vendor/public-libs.t | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/blackbox-tests/test-cases/vendor/public-libs.t diff --git a/test/blackbox-tests/test-cases/vendor/public-libs.t b/test/blackbox-tests/test-cases/vendor/public-libs.t new file mode 100644 index 00000000000..015b87c116b --- /dev/null +++ b/test/blackbox-tests/test-cases/vendor/public-libs.t @@ -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 < (lang dune 3.7) + > (package (name foo)) + > EOF + + $ mkdir -p vendor/mypkg + $ cat >vendor/mypkg/dune-project < (lang dune 3.8) + > (package (name mypkg)) + > EOF + + $ cat >vendor/mypkg/dune < (library + > (name invendor) + > (public_name mypkg.invendor)) + > EOF + + $ cat >dune < (vendored_dirs vendor) + > (library + > (libraries mypkg.invendor) + > (public_name foo)) + > EOF + + $ dune build foo.cma