-
Notifications
You must be signed in to change notification settings - Fork 414
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
Support pinning packages with an archive url #10121
Comments
This is defo a bug, but is it critical? One can just swap the URL to use git and move on. |
I guess it depends on how we measure the MVP, and whether the release process of the affected package is just making an archive of the repo at the given revision or if there is additional processing before archiving. |
I checked and in this case the archive is just a snapshot of the repo. |
@rgrinberg I have started to investigate this. The case of tailwind is a good example of why this is needed. If you use the git version, you end up downloading the entire git history with all the built executables. Using the archive prevent this by only downloading the required version. Digging into the project, the changes needed seem to be more important than expected. To make sure I don't go in the wrong direction, I was wondering what the best way to address that is. My understanding is that I need to alter this function in the let local_or_git_only url loc =
match (url : t).backend with
| `rsync when is_local url -> `Path (Path.of_string url.path)
| `git -> `Git
| `http -> (* Add this change. Check if tar or tar.gz and handle the situation*) `Tar
| `rsync | `darcs | `hg ->
User_error.raise
~loc
~hints:[ Pp.text "Specify either a file path or git repo via SSH/HTTPS" ]
[ Pp.textf "Could not determine location of repository %s" @@ OpamUrl.to_string url
]
;; The consequence of this is that it requires the Mount.of_opam_url function to extend the type backend =
| Path of Path.t
| Git of Rev_store.At_rev.t
| Tar of Path.t (* Or url? Or something else? *) Regarding this, my questions are the following:
|
It seems like the right place.
I think you can use our existing code untaring things. Doing things directly here without worrying about optimization is fine. There's a few other places where we re-download things anyway.
Creating the rev store does not download anything, but calls that fetch the contents of files might. It's an implementation detail of the rev store when this is done, so you shouldn't have to worry about this. Suffice to say that if the file already exists in the revision store, it will not be redownloaded. |
Currently it looks like we support packages pinned to local paths and git urls but not archive urls. The ocaml.org project has a pin
["tailwindcss.dev" "https://github.com/tmattio/opam-tailwindcss/archive/3e60fc32bbcf82525999d83ad0f395e16107026b.tar.gz"]
. Currently locking this project (after removing thepackage
stanza from its dune-project file to workaround #10120) produces the error:The text was updated successfully, but these errors were encountered: