Skip to content

Error solving project with deps specified in opam file when deps contain a disjunction #10837

@gridbugs

Description

@gridbugs

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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions