tarides / ocaml-platform-installer

The best way for developers to write software in OCaml
ISC License
61 stars 8 forks source link

Use the `OPAMCLI` env var to fix the CLI version to "2.0" #92

Closed panglesd closed 2 years ago

panglesd commented 2 years ago

The opam cli is versioned. We want to support opam 2.0 and therefore have to define an OPAMCLI environment variable, ignored by opam 2.0, and making opam>2.0 use the opam 2.0 cli.

This environment variable is added to opam_opts's environment as it is only the Opam module which can decide which version to use.

Previous

ser@d6ed97d05644:~$ ocaml-platform -vv
ocaml-platform: [DEBUG] Running: 'opam' 'config' 'var' 'ocaml:compiler' '--yes' '-q' '--color=never' '--root' '/home/user/.opam'
ocaml-platform: [INFO] Error in 'opam' 'config' 'var' 'ocaml:compiler' '--yes' '-q' '--color=never' '--root' '/home/user/.opam':
[WARNING] var was deprecated in version 2.1 of the opam CLI. Use opam var instead or set OPAMCLI environment variable to 2.0.
ocaml-platform: [DEBUG] Running: 'opam' 'config' 'var' 'ocaml-system:version' '--yes' '-q' '--color=never' '--root' '/home/user/.opam'
ocaml-platform: [INFO] Error in 'opam' 'config' 'var' 'ocaml-system:version' '--yes' '-q' '--color=never' '--root' '/home/user/.opam':
[WARNING] var was deprecated in version 2.1 of the opam CLI. Use opam var instead or set OPAMCLI environment variable to 2.0.

are no longer here!