dune icon indicating copy to clipboard operation
dune copied to clipboard

pkg: the solver prefers unreleased version of ocaml-variants over ocaml-base-compiler

Open gridbugs opened this issue 1 year ago • 0 comments

Sometimes versions of the compiler that are not officially released are released on opam. At the time of writing, the latest officially released version of ocaml is 5.2.0, however the opam package ocaml.5.3.0 exists. It depends on the disjunction of ocaml-base-compiler.5.3.0 (which does not exist), and ocaml-variants.5.3.0+trunk which does exist but is marked avoid-version (dune currently ignores this flag due to https://github.com/ocaml-opam/opam-0install-solver/issues/23).

The consequence of this is that if a project depends on ocaml, dune will find a solution which includes ocaml-variants, as this is the only way that the latest version of the ocaml can also be chosen.

The output from the solver at the time of writing is:

$ dune pkg lock
Solving for Build PlanPackage "ocaml-variants" has source archive which lacks a checksum.
The source archive will be downloaded from:
https://github.com/ocaml/ocaml/archive/trunk.tar.gz
Dune will compute its own checksum for this source archive.
Solution for dune.lock:
- ocaml.5.3.0
- ocaml-config.3
- ocaml-variants.5.3.0+trunk

Repro: https://github.com/ocaml/dune/pull/10595

gridbugs avatar May 28 '24 01:05 gridbugs