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,13 @@
(executable
(name foo)
(libraries bar impl2)
(modules foo))
(library
(name bar)
(libraries impl1)
(modules))
(alias
(name default)
(action (run ./foo.exe)))

View file

@ -0,0 +1 @@
let () = print_endline "should not run"

View file

@ -0,0 +1,3 @@
(library
(name impl1)
(implements vlib))

View file

@ -0,0 +1 @@
let run () = print_endline "impl1"

View file

@ -0,0 +1,3 @@
(library
(name impl2)
(implements vlib))

View file

@ -0,0 +1 @@
let run () = print_endline "impl1"

View file

@ -0,0 +1,12 @@
Executable that tries to use two implementations for the same virtual lib
$ dune build
Error: Conflicting implementations for virtual library "vlib" in
_build/default/vlib:
- "impl1" in _build/default/impl1
-> required by library "bar" in _build/default
- "impl2" in _build/default/impl2
This cannot work.
-> required by executable foo in dune:2
-> required by _build/default/foo.exe
-> required by alias default in dune:11
[1]

View file

@ -0,0 +1,3 @@
(library
(name vlib)
(virtual_modules vlib))