-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test packages on the full range of supported OCaml versions #297
Comments
This might be easier: If a package's opam file contains an explicit constraint on the version of OCaml then:
|
I'm not sure I like the idea of adding artificial constraints in |
Given the potential for stopping testing a version without realising it, might it be an idea to be stronger and actually require a version constraint on ocaml? |
So if you have no constraint on OCaml, then your package should be testing on all supported versions, and either the lint or analyse phases will fail if packages aren’t installable in a given version |
Yes, I've been wondering about that too. My only concern is that sometimes a package is temporarily uninstallable on a new compiler release due to missing dependencies (e.g. Lwt not available on OCaml 4.12). We don't want to encourage people to go around adding But for lower bounds at least it seems fine. So if I say |
This is also an issue for Lwt now, since lwt_ppx is 4.04 only, but the rest of the opam packages should build on 4.02 but aren't being tested. |
To my understanding, the analysis phase for Opam projects works roughly as follows:
This has the consequence that only OCaml versions at which all packages are co-installable are tested in CI, even if certain packages have support for a larger set. This is problematic for repositories containing many packages, since it can severely limit the test matrix. For instance, Irmin is currently only tested on OCaml 4.11 despite almost all of the packages supporting back to at least 4.08.
It would be nice to have a mechanism that tests each package on the full range of OCaml versions that it (allegedly) supports. An obvious solution is to branch the pipeline for each package and install dependencies separately – as was previously done with
ocaml-ci-scripts
– but this is inefficient and doesn't provide any information about co-installability. Here's an initial proposal for how we might do better:p_i
;p_i
, emit the set of opam dependencies to install and the set of Dune packagesd_i
corresponding top_i
. The test phase can then usedune runtest --only-packages [... d_i]
to ensure that only these packages are tested at that version.The magic here is in calculating the
p_i
s andd_i
s. I suspectp_i
can be approximated by initially assuming total co-installability and then using counter-examples to iterate downwards, but perhaps there is better built-in solver magic for this. A complication is that bizarre sets of constraints can result in multiplep_i
s, in which case it seems sufficient to just pick one deterministically. Once that's done,d_i
might be computable fromp_i
usingopam-dune-lint
?The text was updated successfully, but these errors were encountered: