-
Notifications
You must be signed in to change notification settings - Fork 358
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
opam list --installable doesn't take the currently installed packages into account #4135
Comments
Then |
There is special handling internally for what we call "orphan packages": packages which are installed but no longer available ; the policy is to try to keep them as long as they can be kept unchanged, but they can't be recompiled, for example. The code is in |
The above no longer applies; however, the issue remains. It makes sense from a logics point of view: if your current state is already invalid, whatever the package you add it is still invalid, ergo the package is considered not installable... The simple solution would probably be to discard the information about installed packages when computing installability, since it shouldn't affect the result in any other way! I'll try that. |
(so the bug would actually be the opposite of what the issue subject says :D) |
alright, my above comments where a little off. What actually happens here is related to the switch invariant (or base packages in 2.0 terms): the switch gets to a situation where its invariant is no longer satisfiable. Theoretically at that point, it means the switch is in an invalid state and can't be fixed unless you manually change the invariant: so having no packages installable is actually the correct answer. However, there is some magic about "orphan packages", that can allow you to go on while they are still installed and as long as you don't need to change them: this explains the discrepancy between That has been changed in #4969 though: it removes that magic, resulting in a clearer and simpler theory, and removing a bunch of corner-case bugs along the way. This restores consistency with I am open to discussions if that's not a suitable outcome, but otherwise think this can be closed. |
I think it would be worth making |
We currently can’t make the difference between "this package has no revdeps" and "this package can’t even be installed" |
Agreed! Although that might be annoying to add since it is a condition on a conjuction of flags, while they are at the moment supposed to be independent...
Note that |
If one of the package currently installed is not available anymore (I suspect mainly the compiler packages), then
opam list --installable
does not work anymore.Here is a test-case using docker:
The first call to
opam list --installable
returns:but the second does not return anything, and even
opam list -s --all-versions --installable
, if we would try that, does not return anything at all.Would it be possible to add the currently installed packages to the global state to be consistent with
opam install
?The text was updated successfully, but these errors were encountered: