This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,21 @@
(library
(name a)
(libraries b)
(modules))
(library
(name b)
(libraries c)
(modules))
(library
(name c)
(libraries a)
(modules))
(executable
(name cycle)
(libraries a)
(modules cycle))
(rule (with-stdout-to cycle.ml (echo "")))

View file

@ -0,0 +1 @@
(lang dune 1.2)

View file

@ -0,0 +1,34 @@
Test various errors related to resolving libraries
Cycle detection
---------------
$ dune build cycle.exe
Error: Dependency cycle between:
library "a" in _build/default
-> library "c" in _build/default
-> library "b" in _build/default
-> library "a" in _build/default
[1]
Select with no solution
-----------------------
$ mkdir select
$ cd select
$ echo "(lang dune 3.0)" > dune-project
$ cat <<EOF > dune
> (executable
> (name select_error)
> (libraries (select x from))
> (modules select_error))
> (rule (with-stdout-to select_error.ml (echo "")))
> EOF
$ dune build select_error.exe
File "dune", line 3, characters 12-27:
3 | (libraries (select x from))
^^^^^^^^^^^^^^^
Error: No solution found for this select form.
[1]