-
Notifications
You must be signed in to change notification settings - Fork 371
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
[Feature Request] Provide a way to upgrade & install (build dependencies of a pinned project) at the same time #2764
Comments
Thanks once again for the detailed report and suggestions. There are several points to consider here:
So, until 2. is implemented, you are stuck with having to pin the package temporarily — you could ease the issue you mention by pinning under a temporary name, but that'd be an ugly workaround. However, there is a trick to resolve the main issue, that works with opam 1.2: If you use |
That's great :D
Well, I don't actually need all packages to be upgraded, just the entire recursive dependency chain from the things that are listed. So if I could do
Why should this be restricted to installing dependencies from a file? Is it because installing the entire thing from a file is already covered by
Wait, so setting |
This did not work, unfortunately. |
The issue is that, by implicitely removing the pin just afterwards (assuming
That is strange, the solution proposed by opam should first guarantee consistency (respect your strict dependencies), then only optimise according to the criteria. If you can reproduce, could you try running the NB: |
Ah, so opam doesn't independently just remember "this was the
Yes, it is easily reproducible. You got mail. |
Sorry for the delay in getting back to you. And thanks for the data!
Opam 2 does, actually; but at the moment we try to avoid reinstalling packages that no longer have an upstream, because there might be a reason for that (package removed from the repository because its upstream died, it has security issues, etc. ; also, if you unpinned a package that existed in the repository, you would expect to get back to the repository version upon reinstall...)
Ah, I understand: I thought you had a specific dependency from "At the first opportunity" may not be so soon, though: we put effort in not having The problem is the same with the current opam 2
Where 1. and 3. are mostly equivalent; Another option should be added for "upgrade all AND install
¹ I actually found a bug, that I just fixed, that made |
Note: a bit unrelated, but you may want to try versionning your git package with the output of |
Thanks a lot for reports, use-case and suggestions. |
Right, we can't have coq-lambda-rust depend on a specific commit of coq-iris as we can only depend on a version in the opam file and we can't have a new version for every commit. That's why we have the opam.pins file to express the dependency on a particular commit.
Great, thanks :) |
I think this issue should be reopened: it is not actually possible with opam 2 to do what I asked here. Namely, |
First, some context: For a CI build, I want to build whatever is in the git commit that is tested. There is an
opam
file at the root of this repository, documenting the build dependencies. The opam root is cached between CI builds so that build dependencies are re-built only when necessary.As part of this, I am trying to accomplish roughly the following: I want to say "Install the build dependencies given in that
opam
file, and at the same time upgrade everything that's already installed to make sure we got the latest version".Similarly, I'd like to provide a make target "build-dep" to the user that will install and upgrade build-dependencies in their opam.
(The reasons upgrade may be necessary is that the exact version of the build dependency is expressed via pins handled separately. Depending on how #2762 is handled, this may no longer be necessary.)
Currently, the best way to achieve this I can think of is:
This has some problems.
One minor problem is that I have to pin, install build-dependencies, and un-pin again. If the user had their own pin of this project, that would be lost on the way.
And finally, what is more annoying is that it may compile packages twice: Since upgrading and installing build dependencies is done in two transactions, it could happen that the
opam install
has to re-compile a package thatopam upgrade
also had to re-compile.One way to fix this would involve two orthogonal changes -- but maybe they make little sense and the goal should better be achieved in a different way, which is why I reported this as one feature request.
opam install
could gain a flag--upgrade
to also perform an upgrade (or vice versa,opam upgrade
could gain a flag to also install [the build dependencies of] something).opam install
could take a path to operate on, instead of a package, so that one could writeopam install <local dir>
oropam install <URL>#<HASH> --deps-only
.The text was updated successfully, but these errors were encountered: