Feedback on this post is welcomed on Discuss!

We are happy to announce the first alpha release of opam 2.5.0. You can view the full list of changes in the release note.

This version is an alpha, we invite users to test it to spot previously unnoticed bugs as we head towards the stable release.

Try it!

The upgrade instructions are unchanged:

  1. Either from binaries: run

For Unix systems

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

or from PowerShell for Windows systems

Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) } -Version 2.5.0~alpha1"

or download manually from the Github "Releases" page to your PATH.

  1. Or from source, manually: see the instructions in the README.

You should then run:

opam init --reinit -ni

Major changes: speedup opam update up to 70%

Thanks to @arozovyk, opam update now loads opam file incrementally, only parsing the files that have changed since the last time you called opam update. Before that, opam files in opam repositories were all loaded from the file system after an update if there was any change. The performance improvement of this change thus depends on how often you call opam update and what type of repository and OS you are using. (#5824)

Major changes: improved shell integration

A number of users have been hitting issues with opam's shell integration where parts of a previous environment was kept in the current environment, causing a number of issues. These can be triggered by, for example, nuking your opam root directory (by default ~/.opam or %LocalAppData%\opam). For this particular case we are still working on a fix, but many other users have reported similar issues without nuking their root directory and in that case we believe to have fixed the majority of issues. (dbuenzli/topkg#142, #4649, #5761)

On top of that, for bash users, we've also changed the default file to which opam init writes the opam shell integration to be .bashrc instead of the previous .profile or .bash_profile. Doing it this way prevents some issues with existing .profile files that source the .bashrc file and causing an infinity loop when opam asks users to make sure to source their .bashrc file into their .profile file. (#5819, #4201, #3990)

We invite users to test this change for the editor integration, to spot any bug early.

Change to the install script

The opam install script now installs an appropriate apparmor profile on systems configured with apparmor. This change is not strictly speaking related to this release as it is deployed for every versions. (#5968)

We invite apparmor users (enabled by default on Ubuntu), to test this feature and let us know if some adjustments are needed.

Other noteworthy changes

  • Archives without checksums are now fetched only once per call of opam install if their url match (#5638)

  • extra-files whose name is invalid now make opam fail early instead of ignoring the error (#6679)

  • The specification of the pkg:opamfile variable was refined and its computation was updated accordingly (#5346)

  • The global option default-invariant is now modifiable. This is used as default value when creating a local switch (#6730)

  • opam now makes sure that git submodules are up-to-date when checking if a source git repository is up-to-date. This caused issues on subsequent package updates when git submodules originally failed to download or when the submodules got updated in some cases (#6132)

  • Fix opam install pkg --depext-only exiting with code 0 instead of 20 (not found) (#6488)

  • Fix the parsing of OPAMFETCH (support quotes / proper POSIX shell syntax) (#5490)

  • Fix opam remove --force that was launching commands in current directory (#6570)

  • Fix opam lock's error message on pinned packages with no git remote by handling exit code 2 from git remote get-url (#6422)

  • getconf was removed from the list of required runtime tools, which allows opam init to work out-of-the-box on Haiku (#6632)

  • ./configure --enable-static is now supported on OpenBSD. This mode is used in the prebuilt release binaries (#6705, thanks to @flumf)

Half a dozen UI improvements, such as improved error messages, handling of uncaught exceptions, displaying the invalid character in erroneous package names (contributed by @lefessan), etc.

Various performance and other improvements were made and bugs were fixed. API changes are also denoted in the release note linked above. This release also includes a handful of improvement the documentation and more than two dozen improvement and extensions to our testsuite.

Please report any issues to the bug-tracker.

Happy hacking!