opam 2.1.1

Feedback on this post is welcomed on Discuss!

We are pleased to announce the release of opam 2.1.1.

With opam 2.1.1, if you export OPAMCLI=2.0 into your environment then workflows expecting opam 2.0 should now behave even more equivalently.

opam 2.1.1 includes both the fixes in opam 2.0.10.

General fixes:

  • Restore support for switch creation with "positional" package arguments and --packages option for CLI version 2.0, e.g. OPAMCLI=2.0 opam switch create . 4.12.0+options --packages=ocaml-option-flambda. In opam 2.1 and later, this syntax remains an error (#4843)
  • Fix opam switch set-invariant: default repositories were loaded instead of the switch's repositories selection (#4869)
  • Run the sandbox check in a temporary directory (#4783)

Integrated depext support has a few updates:

  • Homebrew now has support for casks and full-names (#4800)
  • Archlinux now handles virtual package detection (#4833, partially addressing #4759)
  • Disable the detection of available packages on RHEL-based distributions. This fixes an issue on RHEL-based distributions where yum list used to detect available and installed packages would wait for user input without showing any output and/or fail in some cases (#4791)

And finally two regressions have been dealt with:

  • Regression: avoid calling Unix.environment on load (as a toplevel expression). This regression affected opam's libraries, rather than the binary itself (#4789)
  • Regression: handle empty environment variable updates (#4840)

A few issues with the compilation of opam from sources have been fixed as well (e.g. mingw-w64 with g++ 11.2 now works)


Opam installation instructions (unchanged):

  1. From binaries: run

    bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.1.1"
    

    or download manually from the Github "Releases" page to your PATH. In this case, don't forget to run opam init --reinit -ni to enable sandboxing if you had version 2.0.0~rc manually installed or to update you sandbox script.

  2. From source, using opam:

    opam update; opam install opam-devel
    

    (then copy the opam binary to your PATH as explained, and don't forget to run opam init --reinit -ni to enable sandboxing if you had version 2.0.0~rc manually installed or to update your sandbox script)

  3. From source, manually: see the instructions in the README.

We hope you enjoy this new minor version, and remain open to bug reports and suggestions.

See full changelog
  • Fix typo in error message for opam var [#4786 @kit-ty-kate - fix #4785]
  • Run the sandbox check in the temporary directory [#4787 @dra27 - fix #4783]
  • OpamSystem: avoid calling Unix.environment at top level [#4789 @hannesm]
  • Homebrew: Add support for casks and full-names [#4801 @kit-ty-kate]
  • Fix the cold target in presence of an older OCaml compiler version on macOS [#4802 @kit-ty-kate - fix #4801]
  • Archlinux: handle virtual package detection [#4833 @rjbou - partial fix #4759]
  • Disable the detection of available packages on RHEL-based distributions. This fixes an issue on RHEL-based distributions where yum list used to detect available and installed packages would wait for user input without showing any output and/or fail in some cases [#4791 @kit-ty-kate - fixes #4790]
  • Handle empty environment variable updates - missed cherry-pick from 2.0 [#4840 @dra27]
  • Fix vendored build on mingw-w64 with g++ 11.2 [#4835 @dra27]
  • Put back support for switch creation with packages argument and --packages option with cli 2.0, and a specific error message for cli 2.1 [#4853 @rjbou - fix #4843]
  • Fix reverting environment additions to PATH-like variables when several dirs added at once [#4861 @dra27]
  • Fix dose3 download url since gforge is gone [#4870 @avsm]
  • Ensure setenv can use package variables defined during the build [#4841 @dra27]
  • Fix `set-invariant: default repos were loaded instead of switch repos [#4866 @rjbou]