Skip to content
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

Avoid trying to be too clever when upgrading switches from opam 2.0 #5002

Closed
wants to merge 3 commits into from

Conversation

kit-ty-kate
Copy link
Member

Fixes #4501
See ocurrent/opam-repo-ci#148
See ocurrent/docker-base-images#150

I don’t see any good reason for trying to guess what the user meant instead of letting the user choose what they want afterward.

Transforming a 2.0 switch to "<compiler-package>" (without constraint) is dangerous (as shown above)
Transforming a 2.0 switch to "<compiler-package>" {>= "<current-version>"} is equally dangerous as it breaks switches named after its current compiler if the compiler is the latest. We can’t assume people with the latest compiler always want the latest

@AltGr
Copy link
Member

AltGr commented Jan 18, 2022

I don't really have an opinion on removing the magic... the cases pointed out in the above are very specific to a convoluted CI setup, and the code might still be helpful for normal users (the "remove the constraint" part was intended for system compilers, where I think it results in a better UX) ; then again, magic is bad in general and being conservative as proposed ensures that the behaviour remains similar after the opam version bump.

In the end my main worry is that it may be late to change this: we may start having the issue of both choices , depending on the migration path followed by the user...

@dra27
Copy link
Member

dra27 commented Sep 5, 2022

As noted in the end of the description in #5176, if we got to do the upgrade process, we'd probably opt to skip have the >= invariant trick, but it seems better to have 2.0->2.1 and 2.0->2.2 do the same upgrade, so we'll leave the main bug as fixed by #5176

@dra27 dra27 closed this Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[opam.2.1.0~beta4] Migration from 2.0 removes all constraints in the invariant
3 participants