Skip to content

Commit

Permalink
test: Move test for github issue 4345
Browse files Browse the repository at this point in the history
The issue was a dependency cycle when a public library copies files from
a parent directory using copy_files. The test was that a readible error
message is produced in that situation, but it's not necessary that this
situation result in a dependency cycle at all.

This change moves the test case to its own file and now asserts that the
case doesn't result in an error.

Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
  • Loading branch information
gridbugs authored and rgrinberg committed Oct 12, 2022
1 parent 94a4a6d commit 48a3ced
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
15 changes: 15 additions & 0 deletions test/blackbox-tests/test-cases/github4345.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
This is a reproduction case from issue #4345.
This was a bug where using (copy_files ...) to depend on files from a parent
directory would cause in internal error in dune due to a dependency cycle. The
bug is now fixed, so this project should build without error.

$ DIR="gh4345"
$ mkdir $DIR && cd $DIR
$ echo "(lang dune 2.8)" > dune-project
$ mkdir lib
$ touch lib.opam file lib/lib.ml
$ cat >lib/dune <<EOF
> (library (name lib) (public_name lib))
> (copy_files (files ../file))
> EOF
$ dune build --root .
19 changes: 0 additions & 19 deletions test/blackbox-tests/test-cases/reporting-of-cycles.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,3 @@ cryptic and can involve unrelated files:
-> required by _build/default/indirect/a.exe
-> required by alias indirect/indirect-deps in indirect/dune:6
[1]

This is a reproduction case from issue #4345
$ DIR="gh4345"
$ mkdir $DIR && cd $DIR
$ echo "(lang dune 2.8)" > dune-project
$ mkdir lib
$ touch lib.opam file lib/lib.ml
$ cat >lib/dune <<EOF
> (library (name lib) (public_name lib))
> (copy_files (files ../file))
> EOF
$ dune build --root .
Error: Dependency cycle between:
Computing installable artifacts for package lib
-> Evaluating predicate in directory _build/default
-> Computing directory contents of _build/default/lib
-> Computing installable artifacts for package lib
[1]
$ cd ..

0 comments on commit 48a3ced

Please sign in to comment.