-
Notifications
You must be signed in to change notification settings - Fork 470
Error solving project with deps specified in opam file when deps contain a disjunction #10837
Copy link
Copy link
Closed
Description
If a project defines a local package in an opam file instead of its dune-project file, and the opam file specifies a disjunction of packages among its dependencies, dune prints an error while solving:
Error: Expected formula to be a conjunction of atoms but encountered non-atom
term 'extlib {build} | extlib-compat {build}'
To reproduce:
$ opam source lutin.2.71.15
$ cd lutin.2.71.15
$ dune pkg lock
File "lutin.opam", line 1, characters 0-0:
Error: Expected formula to be a conjunction of atoms but encountered non-atom
term 'extlib {build} | extlib-compat {build}'
The package lutin contains this disjunction in its dependencies:
"extlib" {build} | "extlib-compat" {build}
Note that there's no way to describe a package disjunction in the DSL for specifying dependencies in dune-project, but opam files allow it. Dune can handle the case when an external package (ie. a dependency of the project) has a package disjunction in its dependencies, but not when the current project itself has a package disjunction in its dependencies.
I think it would be valid to just improve the error message here to make it clear that this case is not supported.
Reactions are currently unavailable