-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use cache urls from opam config #337
Conversation
Hi @hannesm, thanks for the PR. If I understand it correctly, I wonder: can you use the |
Yes and no, so it'll use the cache offered by opam instead of "only the main source of the tarball". Since the tarballs should have checksums assigned, it shouldn't matter where you get the data from. :) (but in CI systems and in remote locations, using a local mirror // something that doesn't overload github's restrictions is a fine way to save bandwidth)
So,
I don't know, try it out. |
Well, it sounds like a reasonable change (I first was worried that it would rewrite the URLs in the lockfile but as the cache URL switcheroo happens on I'll evaluate whether local URLs can be used. |
I tested with a local (file system) OPAM repo with
coupled with a tarball in the location you described and it worked right out of the box. Perfect, this will allow us to test |
Great to hear that @Leonidas-from-XIV. I pushed a changes entry. |
709a798
to
381d1e1
Compare
Thanks for the contribution! |
Sorry to bother you, but it looks like this now leads to With the current HEAD and the commit before my change, I understand the codebase even less. Would you mind to clarify why "use an explicit cache" is the desired behaviour? Who's going to support that argument (with a Fpath.t)? Why does |
This commit is to optimize the retrieval of repositories. Originally the way to use custom repos was to So |
Merging tarides#337 lead to a case where the merging didn't yield a working solution. This PR fixes it by changing the code to: - Retrieve the cache urls from the `global_state` as tarides#337 does - Do not pass cache urls if we're not dealing with an OPAM state
I have created #345 to fix the main branch for now. |
Thanks. I still don't quite understand which code path will be taken at what point and why. My concern is mainly that local caches are ignored, although they're present in Good news, I tested your PR with mirage 4.2.1 and it uses the archive-mirrors cache that I have in my |
The local cache will be ignored when locking when you specify Generally there are two modes: "use the OPAM state" and "configure stuff in opam-monorepo", whereas we try to push people to the latter, since that will yield more reproducible lock files, since the OPAM state can't be easily controlled whereas you can specify a revision of the git repos in |
Merging tarides#337 lead to a case where the merging didn't yield a working solution. This PR fixes it by changing the code to: - Retrieve the cache urls from the `global_state` as tarides#337 does - Do not pass cache urls if we're not dealing with an OPAM state
CHANGES: ### Added - Add support for specifying remote URLs in `x-opam-monorepo-repositories` (tarides/opam-monorepo#284, tarides/opam-monorepo#317, @Leonidas-from-XIV) ### Fixed - Enable locking of packages with depexts even with uninitialized system package manager state (tarides/opam-monorepo#322, @Leonidas-from-XIV) - Fix a bug where `pull` would crash if the lock file contained no package to vendor (tarides/opam-monorepo#321, @NathanReb) - Display a better error message when the depext command fails when getting the status of the packages (tarides/opam-monorepo#258, tarides/opam-monorepo#323, @RyanGibb, @Julow) - Take `archive-mirrors` from the global opam configuration into account to allow more local caches (tarides/opam-monorepo#337, @hannesm) - Log at WARN level when opam-monorepo chooses a source for a package that doesn't match the package's version (tarides/opam-monorepo#352, @reynir)
fixes #336 (it now respects the
archive-mirrors
in~/.opam/config
-- thanks to @kit-ty-kate)