From 343198f1d770234dc0c187f0ff2124f3f400368a Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Thu, 23 May 2024 15:01:05 +0200 Subject: [PATCH] Reproduction case to show that installing deps to the stdlib breaks Signed-off-by: Marek Kubica --- .../test-cases/pkg/dependency-install-file.t | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 test/blackbox-tests/test-cases/pkg/dependency-install-file.t diff --git a/test/blackbox-tests/test-cases/pkg/dependency-install-file.t b/test/blackbox-tests/test-cases/pkg/dependency-install-file.t new file mode 100644 index 000000000000..246d32a0f1ca --- /dev/null +++ b/test/blackbox-tests/test-cases/pkg/dependency-install-file.t @@ -0,0 +1,69 @@ +A package that installs itself into the ocaml stdlib should work. + + $ . ./helpers.sh + + $ mkdir nondune + $ cd nondune + $ cat > nondune.ml < let main () = print_endline "Nondune" + > let () = main () + > EOF + $ ocamlc -c nondune.ml + $ ocamlc -o nondune.cma -a nondune.cmo + $ cat > nondune.install < lib_root: [ + > "nondune.cma" {"ocaml/nondune.cma"} + > "nondune.cmi" {"ocaml/nondune.cmi"} + > ] + > lib: [ + > "META" {"META"} + > ] + > EOF + $ cat > META < directory = "^" + > archive(byte) = "nondune.cma" + > EOF + $ cat > nondune.opam < opam-version: "2.0" + > build: [ + > [true] + > ] + > EOF + $ cd .. + +With this project set up, lets depend on it. + + $ mkdir foo + $ cd foo + $ mkrepo + $ solve_project < (lang dune 3.15) + > (pin + > (url "file://$PWD/../nondune") + > (package (name nondune))) + > (package + > (name foo) + > (depends nondune)) + > EOF + Solution for dune.lock: + - nondune.dev + $ cat > dune < (library + > (name foolib) + > (modes byte) + > (modules foolib) + > (wrapped false) + > (libraries nondune)) + > (executable + > (name foo) + > (modules foo) + > (libraries foolib) + > (modes byte)) + > EOF + $ cat > foo.ml < let () = Foolib.main () + > EOF + $ cat > foolib.ml < let main () = Nondune.main () + > EOF + $ dune exec ./foo.exe 2>&1 | sed -e 's#File unavailable: .*ocaml/nondune.cma$#File unavailable: ocaml/nondune.cma#'