Skip to content

Commit f566202

Browse files
authored
pkg: add repro for gh11265 (#11266)
Signed-off-by: Stephen Sherratt <[email protected]>
1 parent 1f98eb8 commit f566202

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Package conflicts are ignored when dune-projects contains multiple conflicts
2+
3+
$ . ./helpers.sh
4+
$ mkrepo
5+
$ mkpkg bar
6+
7+
A package which depends on a single package and also conflicts with the same package:
8+
$ solve_project << EOF
9+
> (lang dune 3.11)
10+
> (package
11+
> (name foo)
12+
> (allow_empty)
13+
> (depends bar)
14+
> (conflicts bar))
15+
> EOF
16+
Error: Unable to solve dependencies for the following lock directories:
17+
Lock directory dune.lock:
18+
Couldn't solve the package dependency formula.
19+
Selected candidates: foo.dev
20+
- bar -> (problem)
21+
foo dev requires conflict with all versions
22+
Rejected candidates:
23+
bar.0.0.1: Incompatible with restriction: conflict with all versions
24+
[1]
25+
26+
Now add an additional conflict on a non-existant package "baz". Dune will choose the package "bar" despite it being a conflict:
27+
$ solve_project << EOF
28+
> (lang dune 3.11)
29+
> (package
30+
> (name foo)
31+
> (allow_empty)
32+
> (depends bar)
33+
> (conflicts bar baz))
34+
> EOF
35+
Solution for dune.lock:
36+
- bar.0.0.1
37+

0 commit comments

Comments
 (0)