tarides / opam-monorepo

Assemble dune workspaces to build your project and its dependencies as a whole
ISC License
130 stars 27 forks source link

The repository "archive-mirrors" is not respected in a `pull`, thus downloads are always from the Internet. #336

Closed hannesm closed 2 years ago

hannesm commented 2 years ago

When executing opam-monorepo pull (after a lock), it looks up the tarball(s) in the local opam cache, but does not reach out to the archive-mirrors specified in the repo file of the repository(ies).

This leads, especially in low bandwidth scenarios with a network-local cache, to a lot of downloads that could be avoided.

As far as I can tell, at the moment, OpamRepository.pull_tree is used -- which does not respect the repository mirrors, but instead e.g. OpamUpdate.download_package_source could be used.

kit-ty-kate commented 2 years ago

See answer in https://github.com/ocaml/opam/issues/5313 for details on how to fix opam-monorepo

hannesm commented 2 years ago

Thanks @kit-ty-kate, I opened a PR here #337 which fixes the issue.