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]>
Signed-off-by: Ali Caglayan <[email protected]>
  • Loading branch information
Rodolphe Lepigre authored and Alizter committed Apr 30, 2023
1 parent 9ebbb77 commit 9231583
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 3.8)
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 3.8)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 3.8)
53 changes: 53 additions & 0 deletions test/blackbox-tests/test-cases/workspaces/root-detection.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
This test checks the

$ unset INSIDE_DUNE

$ ls . dep
.:
dep
dune-project
dune-workspace
test1.opam

dep:
dune-project
test2.opam

Testing the root detection for:

- dune build -p packages
- dune build
- dune clean

First we test in the workspace root. We expect the root to be the same directory
since that is where the dune-workspace file lives.

$ dune build -p test2 --verbose |& grep -A 1 'Workspace root:'
Workspace root:
$TESTCASE_ROOT
$ dune build -p test1 --verbose |& grep -A 1 'Workspace root:'
Workspace root:
$TESTCASE_ROOT
$ dune build --verbose |& grep -A 1 'Workspace root:'
Workspace root:
$TESTCASE_ROOT
$ dune clean --verbose |& grep -A 1 'Workspace root:'
Workspace root:
$TESTCASE_ROOT

Next we try inside the dep directory. We expect the root to be the parent
directory since that is where the dune-workspace file lives. However strangely
for -p this doesn't appear to be the case.

$ (cd dep && dune build -p test2 --verbose |& grep -A 1 'Workspace root:')
Workspace root:
$TESTCASE_ROOT/dep
$ (cd dep && dune build -p test1 --verbose |& grep -A 1 'Workspace root:')
Workspace root:
$TESTCASE_ROOT/dep
$ (cd dep && dune build --verbose |& grep -A 1 'Workspace root:')
Workspace root:
$TESTCASE_ROOT
$ (cd dep && dune clean --verbose |& grep -A 1 'Workspace root:')
Workspace root:
$TESTCASE_ROOT
Empty file.

0 comments on commit 9231583

Please sign in to comment.