Skip to content

Package Archiving: Plan

Hannes Mehnert edited this page Dec 15, 2024 · 5 revisions

Philosophy

The opam-repository is steadily growing, using a substantial amount of space and inodes. Yet a lot of packages have become stale or uninstallable. We could slim it significantly and reduce power and time waste in the CI and in local solves, by periodically pruning the uninstallable and unmaintained packages.

Plan

Phase 0

Phase 1 (January 1st 2025)

Ready to implement

Preliminaries for Phase 2 from infra team #CI

  • Create a CI for this new repository
    • it should simply lint the files
      • checks that every dependency constraint is of the form "dep" {... & <= "<latest version of dep available in opam-repository at the time of the PR or lower>"} except for "ocaml" (needed for phase 2)
      • checks if the x-reason-for-archival is set (needed for phase 3)
      • checks if the x-opam-repository-commit-hash-at-time-of-archival is set (needed for phase 3)
  • Add the archive repo to the health-check but run it more infrequently (~1/month)

Phase 2 (OCaml < 4.08 -- the least aggressive pruning) - aim: 1 month from Phase 1 (February 1st 2025)

  • Call opam admin check --installability archive-opam --installable --pkg-all, make sure the output is correct and move all the packages it lists to opam-repository-archive #opam
  • Make a PR to move all ocaml packages < 4.08 (oldest version still in use in the wild according to https://repology.org/project/ocaml/versions) to the opam-repository-archive
  • Add a check to the CI lint of the opam-repository: the supported OCaml version is >= 4.08 #ci
  • Announce it in a Discuss post and wait a week for comments then merge

The above steps will be repeated each time we go on with this point with a more recent version of the compiler as bound.

Phase 3 (spring cleaning) - aim: March 1st 2025

To repeat each time

  • Use a script that reads every opam-repository package, takes the latest version of each package that has the x-maintenance-intent field and lists all versions that are not maintained anymore #tools #ci
  • use the installability check to ensure that we remove only packages that do not prevent installation of maintained packages #ci
  • Ping maintainers of large sets of packages individually so they can add this field to the latest version of each of their packages
  • Create the PR to remove the packages from the opam-repository and adds it to the opam-repository-archive
  • Announce the removal on discuss
    • once everything is ok merge

Tooling (basically to do once)

  • Support for intent field on dune release, opam publish, opam repo ci linter, ... to ensure it is present #ci #tools
  • Create a script that reads every opam-repository package, takes the latest version of each package that has the x-maintenance-intent field and lists all versions that are not maintained anymore #tools #ci
  • use the installability check to ensure that we remove only packages that do not prevent installation of maintained packages #ci

Phase 4 (coasting)

  • Repeat Phase 3 every 3 months
  • Repeat Phase 2 every year