From ba131b151d0245d2047d9276d070e1fd63989d09 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Fri, 24 Mar 2023 19:10:46 -0700 Subject: [PATCH] test(x-compilation): demonstrate install files not found Signed-off-by: Antonio Nuno Monteiro --- .../cross-compilation-install.t/dune | 4 +++ .../cross-compilation-install.t/dune-project | 20 +++++++++++++++ .../etc/findlib.conf | 0 .../etc/findlib.conf.d/foo.conf | 0 .../cross-compilation-install.t/foo.ml | 1 + .../cross-compilation-install.t/run.t | 25 +++++++++++++++++++ 6 files changed, 50 insertions(+) create mode 100644 test/blackbox-tests/test-cases/cross-compilation-install.t/dune create mode 100644 test/blackbox-tests/test-cases/cross-compilation-install.t/dune-project create mode 100644 test/blackbox-tests/test-cases/cross-compilation-install.t/etc/findlib.conf create mode 100644 test/blackbox-tests/test-cases/cross-compilation-install.t/etc/findlib.conf.d/foo.conf create mode 100644 test/blackbox-tests/test-cases/cross-compilation-install.t/foo.ml create mode 100644 test/blackbox-tests/test-cases/cross-compilation-install.t/run.t diff --git a/test/blackbox-tests/test-cases/cross-compilation-install.t/dune b/test/blackbox-tests/test-cases/cross-compilation-install.t/dune new file mode 100644 index 000000000000..a1c964c47fe6 --- /dev/null +++ b/test/blackbox-tests/test-cases/cross-compilation-install.t/dune @@ -0,0 +1,4 @@ +(library + (name repro_main) + (public_name repro-main) + (modules foo)) diff --git a/test/blackbox-tests/test-cases/cross-compilation-install.t/dune-project b/test/blackbox-tests/test-cases/cross-compilation-install.t/dune-project new file mode 100644 index 000000000000..280486aecf5d --- /dev/null +++ b/test/blackbox-tests/test-cases/cross-compilation-install.t/dune-project @@ -0,0 +1,20 @@ +(lang dune 3.2) + +(using dune_site 0.1) + +(generate_opam_files true) + +(package + (name repro-main) + (depends + (ocaml + (>= 4.12.0)) + dune-site) + (sites + (share libs)) + (synopsis "Repro main")) + +(package + (name repro-libs) + (depends repro-main) + (synopsis "Repro libs")) diff --git a/test/blackbox-tests/test-cases/cross-compilation-install.t/etc/findlib.conf b/test/blackbox-tests/test-cases/cross-compilation-install.t/etc/findlib.conf new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/test/blackbox-tests/test-cases/cross-compilation-install.t/etc/findlib.conf.d/foo.conf b/test/blackbox-tests/test-cases/cross-compilation-install.t/etc/findlib.conf.d/foo.conf new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/test/blackbox-tests/test-cases/cross-compilation-install.t/foo.ml b/test/blackbox-tests/test-cases/cross-compilation-install.t/foo.ml new file mode 100644 index 000000000000..0547b3d0eee9 --- /dev/null +++ b/test/blackbox-tests/test-cases/cross-compilation-install.t/foo.ml @@ -0,0 +1 @@ +let x = 1 diff --git a/test/blackbox-tests/test-cases/cross-compilation-install.t/run.t b/test/blackbox-tests/test-cases/cross-compilation-install.t/run.t new file mode 100644 index 000000000000..3a6620a00e1f --- /dev/null +++ b/test/blackbox-tests/test-cases/cross-compilation-install.t/run.t @@ -0,0 +1,25 @@ + $ mkdir prefix + + $ export OCAMLFIND_CONF=$PWD/etc/findlib.conf + + + $ dune build --display short --promote-install-files=false -p repro-main @install -x foo + ocamlc .repro_main.objs/byte/repro_main.{cmi,cmo,cmt} [default.foo] + ocamldep .repro_main.objs/repro_main__Foo.impl.d [default.foo] + ocamlopt .repro_main.objs/native/repro_main.{cmx,o} [default.foo] + ocamlc .repro_main.objs/byte/repro_main__Foo.{cmi,cmo,cmt} [default.foo] + ocamlopt .repro_main.objs/native/repro_main__Foo.{cmx,o} [default.foo] + ocamlc repro_main.cma [default.foo] + ocamlopt repro_main.{a,cmxa} [default.foo] + ocamlopt repro_main.cmxs [default.foo] + + $ ls | grep *.install + repro-main-foo.install + + $ dune install --prefix prefix --display short -p repro-main --create-install-files repro-main -x foo + x: repro-main.install + Error: The following .install are missing: + - _build/default/repro-main.install + - _build/default.foo/repro-main.install + Hint: try running: dune build [-p ] @install + [1]