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

Switching images to opam 2.1 by default #132

Open
3 tasks
dra27 opened this issue Sep 8, 2021 · 7 comments
Open
3 tasks

Switching images to opam 2.1 by default #132

dra27 opened this issue Sep 8, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@dra27
Copy link
Contributor

dra27 commented Sep 8, 2021

  • set-opam-version.sh 2.1 added to images. It's just sudo ln -f /usr/bin/opam-$1 /usr/bin/opam && rm -rf ~/.opam && opam init -k local -a /home/opam/opam-repository --bare (with error handling!)
  • opam-depext needs 2.1 support so that with OPAMCLI=2.0 opam depext package works
  • Images have ENV OPAMCLI=2.0 and /usr/bin/opam is /usr/bin/opam-2.1 by default. The root is therefore opam 2.1

This presently blocked on the opam depext part, since there's no compatibility for previous versions. Switching to opam 2.1 will expose some uses to problems with opam's integrated depext on certain platforms.

I propose set-opam-version.sh does a re-init for consistency: it only does fractionally more than opam update would, but it's a more consistent thing to do when downgrading from 2.1 to 2.0.

@dra27 dra27 changed the title Switching to opam 2.1 in the containers Switching images to opam 2.1 by default Sep 8, 2021
@tmcgilchrist tmcgilchrist added the enhancement New feature or request label Apr 22, 2022
@reynir
Copy link

reynir commented Aug 31, 2022

Are there any updates on this? Since mirage 4 requires opam-version >= 2.1.0 this would be very convenient :-)

@reynir
Copy link

reynir commented Aug 31, 2022

Ah, I see in #131 that /usr/bin/opam-2.1 is provided. Maybe the docker hub page can be updated to reflect this? Currently it claims the images come with the latest release of opam.

@reynir
Copy link

reynir commented Sep 9, 2022

FWIW mirage expects opam in $PATH to be opam 2.1. Copying opam-2.1 to /usr/local/bin/opam works around this.

@kit-ty-kate
Copy link
Contributor

kit-ty-kate commented Sep 9, 2022

yes, most of our CI projects start with:

FROM ocaml/opam:<tag>
RUN sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam
RUN opam init --reinit -ni

@tmcgilchrist
Copy link
Member

There is also a dev version of opam available if you do this:

FROM ocaml/opam:<tag>
RUN ln -f ~/local/bin/opam-dev ~/local/bin/opam
RUN opam init --reinit -ni

@hannesm
Copy link

hannesm commented Nov 5, 2024

A year later, could opam 2.2 be used by default? Or is the "do some ln -f" still the suggested modus operandi?

@tmcgilchrist
Copy link
Member

Doing sudo ln -f /usr/bin/opam-2.2 /usr/bin/opam && opam init --reinit -ni still works and most of our services are doing that.
I see less value in keeping opam 2.0 and even 2.1 around now that 2.2 supports all the platforms we need. I don't think anyone is deliberately using earlier opam versions. @shonfeder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants