No description
  • OCaml 99%
  • Dune 1%
Find a file
Marcello Seri f0de45735f Update dependencies and deal with new tarballed repo
Signed-off-by: Marcello Seri <marcello.seri@gmail.com>
2026-09-10 18:00:42 +02:00
lib Update dependencies and deal with new tarballed repo 2026-09-10 18:00:42 +02:00
.gitignore add new check_source.ml to check checksums and compare with urls 2026-06-22 23:22:17 +02:00
.ocamlformat Update code 2025-05-15 22:51:49 +02:00
check_source.ml run dune build @fmt 2026-06-24 09:06:10 +02:00
dune run dune build @fmt 2026-06-24 09:06:10 +02:00
dune-project Update dependencies and deal with new tarballed repo 2026-09-10 18:00:42 +02:00
get_missing.ml run dune build @fmt 2026-06-24 09:06:10 +02:00
get_missing.opam Update dependencies and deal with new tarballed repo 2026-09-10 18:00:42 +02:00
LICENSE Update README and add the LICENSE 2026-06-24 23:49:37 +02:00
README.md Update 2026-06-24 23:50:45 +02:00
update_opam.ml Don't change opam file format when writing 2026-06-24 15:37:52 +02:00

get_missing

A set of half-baked rushed-up utilities for archiving missing or unreachable OPAM packages still available in caches, and updating ocaml/opam-repository with the relevant fallback URLs.

The context for this is on the opam-repository wiki. In brief: when upstream URLs for packages in opam-repository become unreachable, this tool helps to automate fetching them from OCaml/Robur cache servers, and update the package definitions with the new archive URLs.

The archival in the ocaml/opam-source-archives repository is manual and I don't have plans to automate it for the moment (even though it would benefit from some polishing).

Note that the commands have also a minimal help in case of doubts and a helpful (for me) debug flag. They were assembled for my own sake and automation, so the quality is what it is and I am not really intending to improve them more than I need: you could think of it as human slop (although now there are a couple of things that I let an AI write, see end of this file).

How to use

First install the dependencies with opam pin get_missing. Due to my laziness nothing really gets installed, besides the dependencies.

1. Download Missing/Unreachable Archives

Run get_missing to obtain the archive tarballs from OCaml cache servers, you pass the versions from a file or listing them in the form package-name or package-name.version.

In the first case it will get all versions of package-name which are currently unreachable but whose sources are still in the caches.

dune exec ./get_missing.exe -- package1 package2.version ...

The tool will download the archives in the downloads/ folder and append a mapping of each package and its fallback URL to saved_files.txt.

2. Upload to GitHub

Manually upload all files in the downloads/ directory to the ocaml/opam-source-archives GitHub repository.

3. Update Local OPAM Repository

Run update_opam pointing to your local clone of the ocaml/opam-repository, possibly checked out to a new branch.

dune exec ./update_opam.exe -- /path/to/local/opam-repository

This reads the entries from saved_files.txt, resolves the corresponding opam files in the local repository, and updates their url block with the new opam-source-archives URLs.

4. Open a Pull Request

From your local copy of ocaml/opam-repository, commit the changes, push the branch to your repo and submit a Pull Request to upstream ocaml/opam-repository.


Use of LLMs

Most of the code is written by me, except get_source.ml and a PR by Claude, and the deduplication of urls by gemma4-e4b run locally but then edited by hand (with a small refactor by Claude and a hand polish). None of this code has been accepted without me checking it first.