opam 2.0 Beta5 is out!
After a few more months brewing, we are pleased to announce a new beta release of opam. With this new milestone, opam is reaching feature-freeze, with an expected 2.0.0 by the beginning of next year.
This version brings many new features, stability fixes, and big improvements to the local development workflows.
The features presented in past announcements: local switches, in-source package definition handling, extended dependencies are of course all present. But now, all the glue to make them interact nicely together is here to provide new smooth workflows. For example, the following command, if run from the source tree of a given project, creates a local switch where it will restore a precise installation, including explicit versions of all packages and pinnings:
opam switch create ./ --locked
this leverages the presence of
which are valid package definitions that contain additional details of the build
environment, and can be generated with the
opam-lock plugin (the
lock command may
be merged into opam once finalised).
But this new beta also provides a large amount of quality of life improvements,
and other features. A big one, for example, is the integration of a built-in
solver (derived from
glpk). This means that the
works out-of-the box, without requiring the external
aspcud solver, and on all
platforms. It is also faster.
Another big change is that detection of architecture and OS details is now done
in opam, and can be used to select the external dependencies with the new format
field, but also to affect dependencies or build flags.
How to try it out
Our warm thanks for trying the new beta and reporting any issues you may hit.
There are three main ways to get the update:
- The easiest is to use our pre-compiled binaries. This script will also make backups if you migrate from 1.x, and has an option to revert back:
sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)
This uses the binaries from https://github.com/ocaml/opam/releases/tag/2.0.0-beta5
- Another option is to compile from source, using an existing opam installation. Simply run:
opam update; opam install opam-devel
and follow the instructions (you will need to copy the compiled binary to your PATH).
If the build fails after updating a git repo from a previous version, try
git clean -fdx src/to remove any stale artefacts.
Note that the repository format is different from that of opam 1.2. Opam 2 will be automatically redirected from the opam-repository to an automatically rewritten 2.0 mirror, and is otherwise able to do the conversion on the fly (both for package definitions when pinning, and for whole repositories). You may not yet contribute packages in 2.0 format to opam-repository, though.
What we need tested
We are interested in all opinions and reports, but here are a few areas where your feedback would be specially useful to us:
- Use 2.0 day-to-day, in particular check any packages you may be maintaining. We would like to ensure there are no regressions due to the rewrite from 1.2 to 2.0.
- Check the quality of the solutions provided by the solver (or conflicts, when applicable).
- Test the different pinning mechanisms (rsync, git, hg, darcs) with your
project version control systems. See the
- Experiment with local switches for your project (and/or
opam install DIR). Give us feedback on the workflow. Use
opam lockand share development environments.
- If you have any custom repositories, please try the conversion to 2.0 format
opam admin upgrade --mirroron them, and use the generated mirror.
- Start porting your CI systems for larger projects to use opam 2, and give us
feedback on any improvements you need for automated scripting (e.g. the
OCamlPro is a R&D lab founded in 2011, with the mission to help industrial users benefit from state-of-the art programming languages like OCaml and Rust.
We design, create and implement custom ad-hoc software for our clients. We also have a long experience in developing and maintaining open-source tooling for OCaml, such as Opam, TryOCaml, ocp-indent, ocp-index and ocp-browser, and we contribute to the core-development of OCaml, notably with our work on the Flambda optimizer branch.
Another area of expertise is that of Formal Methods, with tools such as our SMT Solver Alt-Ergo (check our Alt-Ergo Users'). We also provide vocational trainings in OCaml and Rust, and we can build courses on formal methods on-demand. Please reach out, we'll be delighted to discuss your challenges: firstname.lastname@example.org or book a quick discussion.