Skip to content

Commit

Permalink
Add repro for ocaml#7335.
Browse files Browse the repository at this point in the history
Signed-off-by: Rodolphe Lepigre <[email protected]>
  • Loading branch information
Rodolphe Lepigre committed Mar 17, 2023
1 parent a29a129 commit 2b686d2
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(executable
(name test2)
(public_name test2)
(package test2))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 3.6)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let _ = Printf.printf "Hello, world!\n%!"
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(executable
(name test1)
(public_name test1)
(package test1))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 3.6)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 3.6)
36 changes: 36 additions & 0 deletions test/blackbox-tests/test-cases/install/install-workspace.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
The setup for this test is two nested dune projects:
- a project at the root of the workspace (defining package "test1",
- a project in the "dep" folder defining package "test2".

When we prepare installation for the "test2" package from the workspace root,
the installation files are produced under "_build/install".

$ dune build --display=quiet -p test2 @install
$ find . -name _build
./_build
$ dune clean

If we do the same from the "dep" directory, we expect the same result, but the
files are rather produced in "dep/_build/install".

$ (cd dep && dune build --display=quiet -p test2 @install)
$ find . -name _build
./dep/_build

Calling "dune clean" at the workspace root does not clean the nested "_build"
directory that was produced by the previous call to "dune build".

$ dune clean
$ find . -name _build
./dep/_build

$ (cd dep && dune clean)
$ find . -name _build

Similarly, calling "dune build @install" in the "dep" folder only prepares the
installation of the packages under "dep", not all packages of the workspace.
The resulting files end up again under "dep/_build".

$ (cd dep && dune build @install)
$ find . -name _build
./dep/_build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let _ = Printf.printf "Hello, world!\n%!"
Empty file.

0 comments on commit 2b686d2

Please sign in to comment.