opam 2.3.0 release!
Feedback on this post is welcomed on Discuss!
As mentioned in our talk at the OCaml Workshop 2024, we decided to switch to a time-based release cycle (every 6 months), starting with opam 2.3.
As promised, we are very pleased to announce the release of opam 2.3.0, and encourage all users to upgrade. Please read on for installation and upgrade instructions.
Try it!
In case you plan a possible rollback, you may want to first backup your
~/.opam
or $env:LOCALAPPDATAopam
directory.
The upgrade instructions are unchanged:
- Either from binaries: run
For Unix systems
$ bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh)"
or from PowerShell for Windows systems
Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) }"
or download manually from the Github "Releases" page to your PATH.
- Or from source, manually: see the instructions in the README.
You should then run:
opam init --reinit -ni
Major breaking change: extra-files
When loading a repository, opam now ignores files in packages' files/
directories which aren't listed in the extra-files
field of the opam file.
This was done to simplify the opam specification where we hope the opam file to be the only thing that you have to look at when reading a package specification. It being optional to list all files in the extra-files:
field went against that principle. This change also reduces the surface area for potential file corruption as all extra-files must have checksums.
This is a breaking change and means that if you are using the files/
directory without listing them in the extra-files:
field, you need to make sure that all files in that directory are included in the extra-files
field.
The resulting opam file remains compatible with all previous opam 2.x releases.
If you have an opam repository, you should make sure all files are listed so every packages continues to work without any issue, which can be done automatically using the opam admin update-extrafiles
command.
Major changes
-
Packages requiring an unsupported version of opam are now marked unavailable, instead of causing a repository error. This means an opam repository can now allow smoother upgrade in the future where some packages can require a newer version of opam without having to fork the repository to upgrade every package to that version as was done for the upgrade from opam 1.2 to 2.0
-
Add a new
opam list --latests-only
option to list only the latest versions of packages. Note that this option respects the order options were given on the command line. For example:--available --latests-only
will first list all the available packages, then choose only the latest packages in that set; while--latests-only --available
will first list all the latest packages, then only show the ones that are available in that set -
Fix and improve
opam install --check
, which now checks if the whole dependency tree of the package is installed instead of only the root dependencies -
Add a new
--verbose-on
option to enable verbose output for specified package names. Thanks to @desumn for this contribution -
Add a new
opam switch import --deps-only
option to install only the dependencies of the root packages listed in the opam switch export file -
opam switch list-available
no longer displays compilers flagged withavoid-version
/deprecated
unless--all
is given, meaning that pre-release or unreleased OCaml packages no longer appear to be the latest version -
opam switch create --repositories
now correctly infers--kind=git
for URLs ending with.git
rather than requiring thegit+https://
protocol. This is consistant with other commands such asopam repository add
. Thanks to @Keryan-dev for this contribution -
opam switch set-invariant
now displays the switch invariant using the same syntax as the--formula
flag -
The
builtin-0install
solver was improved and should now be capable of being your default solver instead ofbuiltin-mccs+glpk
. It was previously mostly only suited for automated tasks such as Continuous Integration. If you wish to give it a try, simply callingopam option solver=builtin-0install
(callopam option solver=
restores the default) -
Most of the unhelpful conflict messages were fixed. (#4373)
-
Fix an opam 2.1 regression where the initial pin of a local VCS directory would store untracked and ignored files. Those files would usually be cleaned before building the package, however git submodules would not be cleaned and would cause issues when paired with the new behaviour added in 2.3.0~alpha1 which makes opam error when git submodules fail to update (it was previously a warning). (#5809)
-
Fix the value of the
arch
variable when the current OS is 32bit on a 64bit machine (e.g. Raspberry Pi OS). (#5949) -
opam now fails when git submodules fail to update instead of ignoring the error and just showing a warning
-
opam's libraries now compile with OCaml >= 5.0 on Windows
-
Fix the installed packages internal cache, which was storing the wrong version of the opam file after a build failure. This could be triggered easily for users with custom repositories with non-populated extra-files. (#6213)
-
Several improvements to the pre-built release binaries were made:
- The Linux binaries are now built on Alpine 3.20
- The FreeBSD binary is now built on FreeBSD 14.1
- The OpenBSD binary is now built on OpenBSD 7.6 and loses support for OpenBSD 7.5 and earlier
- Linux/riscv64 and NetBSD/x86_64 binaries are now available
And many other general, performance and UI improvements were made and bugs were fixed. You can take a look to previous blog posts. API changes and a more detailed description of the changes are listed in:
- the release note for 2.3.0~alpha1
- the release note for 2.3.0~beta1
- the release note for 2.3.0~beta2
- the release note for 2.3.0~rc1
- the release note for 2.3.0
This release also includes PRs improving the documentation and improving and extending the tests.
Please report any issues to the bug-tracker.
We hope you will enjoy the new features of opam 2.3!
About OCamlPro:
OCamlPro is a R&D lab founded in 2011, with the mission to help industrial users benefit from experts with a state-of-the-art knowledge of programming languages theory and practice.
- We provide audit, support, custom developer tools and training for both the most modern languages, such as Rust, Wasm and OCaml, and for legacy languages, such as COBOL or even home-made domain-specific languages;
- We design, create and implement software with great added-value for our clients. High complexity is not a problem for our PhD-level experts. For example, we helped the French Income Tax Administration re-adapt and improve their internally kept M language, we designed a DSL to model and express revenue streams in the Cinema Industry, codename Niagara, and we also developed the prototype of the Tezos proof-of-stake blockchain from 2014 to 2018.
- We have a long history of creating open-source projects, such as the Opam package manager, the LearnOCaml web platform, and contributing to other ones, such as the Flambda optimizing compiler, or the GnuCOBOL compiler.
- We are also experts of Formal Methods, developing tools such as our SMT Solver Alt-Ergo (check our Alt-Ergo Users' Club) and using them to prove safety or security properties of programs.
Please reach out, we'll be delighted to discuss your challenges: contact@ocamlpro.com or book a quick discussion.
Most Recent Articles
2024
- opam 2.3.0 release!
- Optimisation de Geneweb, 1er logiciel français de Généalogie depuis près de 30 ans
- Alt-Ergo 2.6 is Out!
- Flambda2 Ep. 3: Speculative Inlining
- opam 2.2.0 release!
- Flambda2 Ep. 2: Loopifying Tail-Recursive Functions
- Fixing and Optimizing the GnuCOBOL Preprocessor
- OCaml Backtraces on Uncaught Exceptions
- Opam 102: Pinning Packages
- Flambda2 Ep. 1: Foundational Design Decisions
- Behind the Scenes of the OCaml Optimising Compiler Flambda2: Introduction and Roadmap
- Lean 4: When Sound Programs become a Choice
- Opam 101: The First Steps
2023
- Maturing Learn-OCaml to version 1.0: Gateway to the OCaml World
- The latest release of Alt-Ergo version 2.5.1 is out, with improved SMT-LIB and bitvector support!
- 2022 at OCamlPro
- Autofonce, GNU Autotests Revisited
- Sub-single-instruction Peano to machine integer conversion
- Statically guaranteeing security properties on Java bytecode: Paper presentation at VMCAI 23
- Release of ocplib-simplex, version 0.5