Skip to content

Commit

Permalink
pkg: add repro for gh11265
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Sherratt <[email protected]>
  • Loading branch information
gridbugs committed Jan 2, 2025
1 parent 8a30fb1 commit 9bc333f
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/blackbox-tests/test-cases/pkg/gh11265.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Package conflicts are ignored when dune-projects contains multiple conflicts

$ . ./helpers.sh
$ mkrepo
$ mkpkg bar

A package which depends on a single package and also conflicts with the same package:
$ solve_project << EOF
> (lang dune 3.11)
> (package
> (name foo)
> (allow_empty)
> (depends bar)
> (conflicts bar))
> EOF
Error: Unable to solve dependencies for the following lock directories:
Lock directory dune.lock:
Couldn't solve the package dependency formula.
Selected candidates: foo.dev
- bar -> (problem)
foo dev requires conflict with all versions
Rejected candidates:
bar.0.0.1: Incompatible with restriction: conflict with all versions
[1]

Now add an additional conflict on a non-existant package "baz". Dune will choose the package "bar" despite it being a conflict:
$ solve_project << EOF
> (lang dune 3.11)
> (package
> (name foo)
> (allow_empty)
> (depends bar)
> (conflicts bar baz))
> EOF
Solution for dune.lock:
- bar.0.0.1

0 comments on commit 9bc333f

Please sign in to comment.