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

User confusion when updating after system compiler upgrade. #2559

Closed
amirmc opened this issue May 13, 2016 · 1 comment
Closed

User confusion when updating after system compiler upgrade. #2559

amirmc opened this issue May 13, 2016 · 1 comment

Comments

@amirmc
Copy link
Member

amirmc commented May 13, 2016

Not sure if this is the correct repo to post this on. Just some feedback :)

I just updated to 4.03 via homebrew and then tried an opam update.
Normally my experience with this has been pretty straightforward but today I got the following (comments follow).

$ opam update
Your system compiler has been changed. Do you want to upgrade your OPAM installation ? [Y/n] y

=-=- Upgrading core -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫
[WARNING] bin_prot.112.35.00 is not available because your system doesn't comply with ocaml-version >= "4.02.1" & ocaml-version < "4.03". Skipping.
[WARNING] camlp4.4.02+system is not available because your system doesn't comply with preinstalled & ocaml-version >= "4.02" & ocaml-version < "4.03".
          Skipping.
[WARNING] core.112.35.01 is not available because your system doesn't comply with ocaml-version >= "4.02.1" & ocaml-version < "4.03". Skipping.
[WARNING] core_kernel.112.35.00 is not available because your system doesn't comply with ocaml-version >= "4.02.1" & ocaml-version < "4.03". Skipping.
[WARNING] enumerate.111.08.00 is not available because your system doesn't comply with ocaml-version >= "4.00.1" & ocaml-version < "4.03". Skipping.
[WARNING] fieldslib.109.20.03 is not available because your system doesn't comply with ocaml-version >= "4.00.0" & ocaml-version < "4.03". Skipping.
[WARNING] herelib.112.35.00 is not available because your system doesn't comply with ocaml-version >= "4.02.1" & ocaml-version < "4.03". Skipping.
[WARNING] pa_ounit.112.35.00 is not available because your system doesn't comply with ocaml-version >= "4.02.1" & ocaml-version < "4.03". Skipping.
[WARNING] pa_structural_sexp.112.35.00 is not available because your system doesn't comply with ocaml-version >= "4.02.1" & ocaml-version < "4.03". Skipping.
[WARNING] pa_test.112.24.00 is not available because your system doesn't comply with ocaml-version >= "4.02.1" & ocaml-version < "4.03". Skipping.
[WARNING] sexplib.112.35.00 is not available because your system doesn't comply with ocaml-version >= "4.02.1" & ocaml-version < "4.03". Skipping.
[WARNING] type_conv.112.01.02 is not available because your system doesn't comply with ocaml-version >= "4.02.0" & ocaml-version < "4.03". Skipping.
[WARNING] typerep.112.35.00 is not available because your system doesn't comply with ocaml-version >= "4.02.1" & ocaml-version < "4.03". Skipping.
[WARNING] variantslib.109.15.03 is not available because your system doesn't comply with ocaml-version >= "4.00.0" & ocaml-version < "4.03". Skipping.
The following dependencies couldn't be met:
  - comparelib -> camlp4
Your request can't be satisfied:
  - camlp4 is not available because your system doesn't comply with ocaml-version >= "4.04".

No solution found, exiting
The former package state can be restored with opam switch import "/Users/amir/.opam/backup/state-20160413122338.export" --switch core

Some notes and thoughts:

  • I get why the above happened (packages that don't support 4.03).
  • Most of my switches are aliases of the system switch. I have about 7 of them.
  • It wasn't immediately obvious which of those switches had the issue above.
  • Even though it failed on the core switch, it didn't do anything with the other switches. Printing a note about how far it got and what wasn't done might be nice (similarly to what happens with packages).
  • I didn't bother trying to restore the packages and now the switch is empty. The base packages are gone.

All of the above is easy for me to figure out but I thought I'd leave some comments here. If there's nothing to discuss, then I'll close the issue in a couple of days.

@AltGr
Copy link
Member

AltGr commented May 17, 2016

IIRC, the behaviour for opam 1.2.2 is to check for a new compiler on any command (i.e. this is not specific to the update you specified), and for the current switch. The other switches may trigger a similar reinstall once you switch to them.

Then, what is triggered is an equivalent of opam switch reinstall, itself a wrapper around opam switch import, which actually triggered the errors above.

Now, in 2.0~alpha, with the removed comp files (and associated notion of a system compiler), most of this has been changed. It remains a difficult case to handle, though:

  • packages now have a mechanism to indicate a dependency on the hash of system files, and will be filed for reinstall if that changes. The "system compiler package" polls the system and registers one such hook.
  • switch import could still be improved to better handle partially impossible situations (Best effort opam switch import #2450)
  • 2.0~alpha still relies on a ocaml-version variable and the available field; having actual dependencies on a given ocaml version would give a smoother experience in this case, but is not that easy. (See discussion at Next: ocaml-version not updated with ocaml's version #2537)

@AltGr AltGr closed this as completed Oct 19, 2016
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

No branches or pull requests

2 participants