feat(pkg): support opam repository archive mirrors - #15615
Draft
Alizter wants to merge 1 commit into
Draft
Conversation
Alizter
force-pushed
the
pkg-opam-archive-mirrors
branch
from
July 29, 2026 09:00
8dcd64d to
72d7f77
Compare
Read the archive-mirrors field of opam repository metadata, record the mirrors in lock directories, and try checksum-addressed mirror objects before a package's primary source URL, falling back to the next mirror or the primary URL on failure or checksum mismatch. Design notes: - Local (file) sources are read directly and never consult mirrors. - Pinned packages never consult mirrors: pinned means pinned. - Mirrors are not part of the fetch action digest since they cannot change the produced content. - Relative mirror entries are skipped for git-backed repositories, and unsupported mirror schemes are dropped with a warning at solve time. Signed-off-by: Ali Caglayan <alizter@gmail.com>
Alizter
force-pushed
the
pkg-opam-archive-mirrors
branch
from
July 29, 2026 09:08
72d7f77 to
a61a9d3
Compare
Member
|
First, the change to the lock dir should be added and tested separately. Second, I find that the approach used to support this feature not to be consistent with the rest of the dune language. A more straightforward and flexible approach is to list more than 1 url in a fetch and allow dune to try them in sequence. The concept of an "archive mirror" need not leak at all to lock directories themselves. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
archive-mirrorsfrom an opam repository rootrepofile and resolve relative mirror URLs against the repository.https://opam.ocaml.org/cache.Related Issue and Motivation
Opam repositories can provide stable archive mirrors for packages whose upstream source is unavailable or flaky. Dune package management currently ignores this metadata and always starts with the upstream URL.
Fixes #13130
Testing
./dune.exe build @check @fmt./dune.exe runtest test/blackbox-tests/test-cases/pkg/archive-mirrors.t./dune.exe runtest test/expect-tests/dune_pkg./dune.exe runtest test/blackbox-tests/test-cases/pkg/compute-checksums-when-missing.tdune init projectlock/build against the central opam cache.The full
@runtestgate currently reaches three unrelated watch-mode tests that time out on their first RPC build in this local environment.Checklist