Open gridbugs opened 3 weeks ago
Improving the error message is a good first step. Although there's no fundamental reason not to support this. If a package uses opam to define its metadata, then it should not be a problem for us to pass along the metadata to the solver without interpreting anything.
This same error also occurs when trying to build some highly dependend-upon packages:
Package functoria-runtime (4340 revdeps) fails with
---> Building package n°18: package "functoria-runtime.4.4.2":
Successfully extracted to /tmp/pkg-coverage-f9e828-builder/functoria-runtime.4.4.2
File "mirage-runtime.opam", line 1, characters 0-0:
Error: Expected formula to be a conjunction of atoms but encountered non-atom
term 'result < "1.5" | ppxlib = "0.29.0"'
Package io-page (4340 revdeps) fails with
---> Building package n°22: package "io-page.3.0.0":
Successfully extracted to /tmp/pkg-coverage-9be759-builder/io-page.3.0.0
File "io-page.opam", line 1, characters 0-0:
Error: Expected formula to be a conjunction of atoms but encountered non-atom
term 'mirage-xen < "6.0.0" | ocaml-freestanding < "0.4.1"'
The revdep count is according to check.ci.ocaml.org
I looked at it and this looks like it should be fairly easy to fix as we parse the dependencies from a filtered_formula
into an dependency set, use this set mostly for hashing and taking out a random element and then reconstruct a filtered_formula
to give to the solver.
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:
To reproduce:
The package
lutin
contains this disjunction in its dependencies: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.