Manifest: improve automatic generation of opam releases
This MR is based on !6871 (merged); please review it first.
Context
We recently added a CI job that creates a branch on https://github.com/tezos/opam-repository that serves as a source for the pull request that we create to release Octez on opam. This process has some flaws:
- it contains too many packages
- it does not release the meta-package
octez.opam(formerly known astezos.opam)
This merge request fixes this as follows.
- It generates the meta-package
octez.opamwhich depends on all explicitly released packages, identified with~release:Releasedin the manifest; plus additional packages that we can add manually (currently, onlyledgerwallet-tezos). - It updates the
~release_statusof some internal dependencies to force them to appear (or not) inoctez.opam. For instance, embedded protocols should be installed, otherwise the node will not have them by default since they are optional dependencies. - It uses the
opam_release_graphcomputed by !6871 (merged) to restrict the set of opam packages to release to those who are actually needed to buildoctez.opam.
The following pull request was generated from a similar set of patch on top of v15-release: https://github.com/ocaml/opam-repository/pull/22482 But note that if you run the opam-release.sh script on this MR, even after backporting it to v15-release, you will get differences. This is because for v15-release, I did the transitive closure of dune targets and not opam packages. This removed a few dependencies, and reordered all dependencies.
Commit !6803 (025606c7) is not really needed for this MR because for opam packages Unreleased and Experimental are equivalent. But it's a small commit that better reflects the status of experimental executables, so I figured "why not". It'll be useful in future MRs where we use the experimental/unreleased distinction.
Manually testing the MR
./scripts/opam-release.sh 15.0 https://gitlab.com/tezos/tezos/-/package_files/58329735/download
# View the resulting octez.opam
cat opam-repository/packages/octez/octez.15.0/opam
# The above command generates folder opam-repository.
# (Here you may want to create a new opam switch.)
# Add this folder as an opam remote:
opam remote add test-release opam-repository
opam install octez
opam remote remove --all test-release
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR