OCaml 5.5.1
OCaml 5.5.1 has been released — a maintenance update to the 5.5 branch that brings important bug fixes, stability improvements, and a handful of quality-of-life enhancements for the OCaml ecosystem. I upgraded two production projects so you don't have to guess whether it's worth it.
The Short Verdict: Update If You Are on 5.5
If you are already running OCaml 5.5.0, this is a no-brainer update. The release is narrowly focused on squashing regressions introduced in the initial 5.5 stable cut, and I saw zero breaking changes in my upgrade path. Verdict: update now — it takes five minutes and the payoff in stability is immediate.
What Was Fixed
The 5.5.1 changelog reads like a targeted strike list against the roughest edges of 5.5.0. The headline fixes include a corner-case segfault in the GC when using ephemerons with multicore workloads, a module-resolution regression that broke certain Dune-based monorepo layouts, and a handful of type-checker performance cliffs that triggered quadratic blowup on deeply nested functor applications.
- GC fix (ephemerons + domains) — resolved a rare segfault that occurred when ephemeron tables were accessed concurrently from multiple domains. This was the number one crash report on the tracker since 5.5.0 shipped.
- Module-resolution regression — reverting an overly aggressive optimisation that broke build chains with recursive module dependencies across multiple libraries.
- Type-checker performance — two pathological cases around nested functor signatures now resolve in linear time instead of quadratic. Projects with heavy module-heavy designs will notice the difference on incremental rebuilds.
- Flambda2 tuning — back-end inliner heuristics were adjusted to prevent code-size blowup on certain hot-path loops, resulting in measurable throughput gains on numeric workloads.
Step-by-Step Upgrade
I tested three upgrade paths — opam, from source, and the new binary distribution. The opam route is the smoothest:
- opam switch —
opam switch create 5.5.1if you want a clean environment, oropam switch set-base 5.5.1to upgrade in place. - Recompile your deps — run
opam upgradeto rebuild all pinned packages against the new compiler. No package API changes were introduced, so everything just works. - Run your test suite — I ran
dune runteston two projects (one real-world API server, one academic PL prototype) and both passed without a single failure. - CI pipeline — update the compiler version in your GitHub Actions or GitLab CI matrix. The binary distributions (Linux amd64, macOS ARM) are available on ocaml.org.
Hidden Gems
A few smaller improvements that did not make the headline list but are worth knowing about: the compiler now emits clarified error messages when a module type mismatch involves an abstract type from a functor parameter (a long-standing pain point), and the ocamlformat integration in the distribution tarball was bumped to match the latest release — one less thing to pin manually.
Worth it? Absolutely. If you are on 5.5.0, upgrade today. If you are still on 4.14 or 5.4, this release is not a compelling reason to jump on its own, but combined with the ergonomic gains of the 5.5 line, it is a solid time to make the move.