Opam v2.0.0 pre-release testing on macOS

Hello,

In order to make it easier to use opam v2.0.0’s pre-releases on macOS, there is now a homebrew-based, quick and foolproof workflow that makes it safe and easy for you to switch from 1.2.2 to 2.0.0, and back with your previous setup if needed.

The instructions are available here:

https://github.com/ocaml/homebrew-ocaml/wiki/From-opam-1.2.2-to-2.0.0-and-back-with-the-OCaml-tap

You can now try to live day to day on opam 2.0.0 with the peace of mind of being able to come back in a breeze to the solid and reliable opam 1.2.2 you know if you hit any wall.

3 Likes

Thanks for this @dbuenzli!

Thanks for this, @dbuenzli! Another option instead of moving directories around is to:

export OPAMROOT=~/.opam2
brew unlink opam@2
brew link opam@2 

The environment variable controls the location of the opam state, so you can have as many concurrent installations as you like.

Please do feel free to post any feedback here, or on opam-devel@lists.ocaml.org, or on the bug tracker at https://github.com/ocaml/opam/issues

1 Like

Just a heads up, the current beta5 does not work, because brew has switched the system ocaml to 4.06.0, which breaks compilation of opam due to safe-string.

1 Like

@dbuenzli Do you think things are far enough along that I should package opam 2 for MacPorts as well?

True, I’d been meaning to bring this up but somehow it slipped my mind for a long time. I finally resorted to using the official installation script when writing my blog post. The script performs a backup of the existing opam so I can switch back and forth by moving opam binary and root directory (a bit more manual than the homebrew version).

I resorted to fixing the issue for now (because the code was fortunately already there), so if it does not work please report as an issue on the bug tracker :slight_smile:

2 Likes

Indeed, my apologies :smile: And thank you for fixing it!