-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PR checks
Kate edited this page Feb 14, 2024
·
43 revisions
- make sure the opam-repo-ci linter succeeds (exceptions apply but there shouldn't be any "errors")
- if the package uses dune:
- Check that they use the standard way of calling dune. The
dune build
,dune runtest
anddune exec
command must have-p %{name}%
or--profile release
(check in the Makefile ifmake
is used)
- Check that they use the standard way of calling dune. The
- depopts should not contain any constraints (see note in https://opam.ocaml.org/doc/Manual.html#opamfield-depopts). Exceptions apply (e.g. see opam-file-format)
- make sure the version number doesn’t start with
v
(except for janestreet packages, and packages that have already been published in opam-repo long ago and made the mistake)- make sure janestreet packages that use this convention (not all do), do have the
v
prefix
- make sure janestreet packages that use this convention (not all do), do have the
- check that the known dependencies have an appropriate lower-bound constraint (for instance a package changed dramatically from one version to another and the package won't work with this version of the dependency). This is now checked by the CI
lower-bounds
tests, however it is to be noted that this test is an approximation and might not be 100% accurate - check that
{build}
dependencies are used properly (e.g.ppx
packages should not have this tag)- TODO (explain how the
build
tag interact with opam)
- TODO (explain how the
- check that
{post}
dependencies are used properly - archives should always have a checksum (exceptions apply, e.g.
ocaml-variants
) - avoid equality constraints (e.g.
{= "0.9.0"}
) and when possible ask the users to change their constraints to to a lower-bound constraint (>=
). Equality constraints are not user friendly as they won't allow people to install the packages with another one with different constraints in the same switch.- however, if the new packages being added should come together, have the same versions and come from the same repository (e.g.
js_of_ocaml
,js_of_ocaml-lwt
, ...), then encourage users to use the{= version}
constraints in subpackages if the author expects to do release in a grouped manner. Otherwise it is almost a guaranty for the previous releases to break at some point in the future and for users to be puzzled why packages that come together are out of sync.
- however, if the new packages being added should come together, have the same versions and come from the same repository (e.g.
- if there are extra sources pointing at github commits, their url must include
?full_index=1
. See https://github.com/ocaml/opam-repository/pull/23849 - make sure
opam-version: "2.0"
as unsupported versions will make opam fail (https://github.com/ocaml/opam/issues/5631). Hopefully that won’t be the case whenever the repository migrate to opam 3.0 syntax - make sure shell scripts use
set -e
orsh -e
, even when called usingsh -c
- add an explicit dependency towards
ocaml
if missing. This makes it easier to constrain against new versions of the compiler later. - check that the URLs are correct and do not contain things that might change (git branches are forbidden, exceptions apply)
-
remove
fields should not be present since opam 2.0 (rare exceptions can apply if for example a file has to be modified upon uninstallation) - the
opam
file should have a valid maintainer so that we can ping or send an email to them if needed - packagers should be encouraged to reduce the number and size of files in the
files/
subdirectory of a package if possible
- check that the project is actually the same and someone is not trying to take over. If they are, make sure this is official and the previous maintainer agreed in writing publicly available.
- check the name isn't too close to an existing one and that both can be distinguished
- check that the value added by the package is sufficient
- package names should not contain an
ocaml
suffix or prefix (exceptions can apply if theocaml
prefix is relevant)
- same as the "for any additions" section, except the linter doesn’t have to succeed (though it should still be free of "errors", vs. "warnings")
- extra care should be taken to make sure packages don’t get broken, on all supported platforms
- If an existing package changes their archive checksum, check that any of the meaningful content hasn't changed and post the diff, if any, in the PR for our own records
- check if they are still in the cache
https://opam.ocaml.org/cache/md5/MD5SUM[:2]/MD5SUM
(similarly for sha256 or sha512), upload them on https://github.com/ocaml/opam-source-archives and update the url in the opam file. There is currently a bug in the base images that makes the cache not that useful (https://github.com/ocurrent/docker-base-images/issues/249) but it could work - however if the archive is available elsewhere, upload it to https://github.com/ocaml/opam-source-archives and change
url.src
instead of the checksum to avoid existing users having to reinstall the package and packages that rely on it - You can check the Software Heritage archives if you can’t find the archive elsewhere and download it from there: https://archive.softwareheritage.org/browse/search/?q=opam.ocaml.org%2Fpackages&with_visit=true&with_content=true&visit_type=opam
- check if they are still in the cache
- if one of these checks could be done using one of the CI system, it might be worth requesting the feature in either opam-repo-ci or opam lint
- when doing a change in a PR, ask the maintainer to return it in the opam file upstream and make sure the change has been upstreamed so that you don’t have to do the change everytime they do a release
- if you are the first one to check the test runs and you see an error, try to copy/paste it back on the PR with a possible explanation on how to fix it
- If the revdeps check failed and the failures are not known, ask the maintainer if it is expected
- If it is expected: Open a separate PR to fix the constraint, merge it first and restart the revdeps check (click on the "rebuild" button for the Dockerfile generation in the revdeps section)
- If it is not expected, label the PR
needs reporter action
and wait for a fix.
- If a failure appears and is deemed unsolvable (unavailable system package, system library/system C compiler too old, ...) the distributions the package fails on should be added to the
x-ci-accept-failures
field. e.g.:x-ci-accept-failures: ["centos-8"]
- The platform name to put in the field is the same as the based dockerfile used (ocaml/opam).
- if a package fails due to missing
ocamlopt
, we need to make them conflict withocaml-option-bytecode-only
- if
menhir
is used withdune
, it will be called with the--infer-write-query
flag, the necessary bound is at least"menhir" {>= "20180528"}
- packages may fail with
the solution is to update the dune dependency to look like
# File "src/dune", line 7, characters 12-17: # 7 | (libraries bytes)) # ^^^^^ # Error: Library "bytes" not found.
("dune" {>= "1.4.0"} | "dune" {< "1.4.0"} & "base-bytes")
and the ocaml one to("ocaml" {>= "4.08" & < "5.0"} | "ocaml" {>= "5.0"} & "base-bytes")
. - if the error is about the
Stream
module being undefined, most recent packages will continue working by adding a dependency on"camlp-streams"
. Note that old packages may still not work and instead require the upper bound"ocaml" {<= "5.0"}
- opam-repo-ci might tell you that
dune subst
shouldn't be used without{dev}
. The reason why can be read about in ocaml/dune#3647