You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[has OCaml 4.08 installed system wide]
$ opam init
$ opam install ocamlfind.1.8.0
[upgrades OCaml to 4.09]
[optionally call opam update, but it doesn't matter]
$ opam install menhir # or whichever other package
# this will alert opam that ocaml has been upgraded
# and opam will first try to reinstall ocamlfind
# but will fail during uninstall because ocamlfind.1.8.0
# is not compatible with OCaml 4.09 and the remove field
# will call the configure script which calls ocaml -vthread
# which doesn't exist anymore in ocaml 4.09
Opam will fail because of two things: first it stores package definitions locally and doesn't update constraints of already installed packages and second, it doesn't actually check for dependencies constraints during uninstall (I tried with a custom package using opam pin edit and opam install --ignore-constraints-on=ocaml and the remove field was called despite being incompatible with the current version of the compiler)
To mitigate this issue, I propose we do two things:
Urge the user to call opam update first (or even call opam update anyway) when in a system switch and opam is detecting a new OCaml compiler.
Update the constraints on the ocaml package in the locally stored packages definitions (used to uninstall packages). If one of the installed packages is not compatible with the new OCaml compiler (and doesn't have the light-uninstall flag), then skip the remove phase entirely.
The text was updated successfully, but these errors were encountered:
The first way to mitigate this kind of issues would be to remove the remove: fields, which is generally unneeded, or make it as small as possible in the other cases:
explicit remove: is basically only needed when during install you modify existing files
otherwise, it's best to comply with the light-uninstall package flag, i.e. not require the package source.
What I don't get is that, normally, failures during uninstall are printed but treated by opam as non-fatal (it will use a best-effort policy); and you seem to face a hard failure ?
Note 1: we have pending PRs improving the handling of modified system packages / system compilers
Note 2: you can force opam to update its definitions for already installed packages with opam reinstall --forget-pending (since opam detects the need for reinstallation by diffing the current and installed opam files, forgetting pending reinstalls is implemented by updating the latter with the former).
With the following setup:
Opam will fail because of two things: first it stores package definitions locally and doesn't update constraints of already installed packages and second, it doesn't actually check for dependencies constraints during uninstall (I tried with a custom package using
opam pin edit
andopam install --ignore-constraints-on=ocaml
and theremove
field was called despite being incompatible with the current version of the compiler)To mitigate this issue, I propose we do two things:
Urge the user to call
opam update
first (or even callopam update
anyway) when in a system switch and opam is detecting a new OCaml compiler.Update the constraints on the
ocaml
package in the locally stored packages definitions (used to uninstall packages). If one of the installed packages is not compatible with the new OCaml compiler (and doesn't have thelight-uninstall
flag), then skip theremove
phase entirely.The text was updated successfully, but these errors were encountered: