Raising the minimum tested version of OCaml to 4.05 or 4.08 (from 4.02)

In the opam repository, we have been testing submitted packages on all versions of OCaml from 4.02.3 onwards, all the way up to 5.2-trunk. We need to come up a way to reduce this testing matrix, and in particular determine if there are a non-zero number of users who need these historical releases tested. There are thousands of potentially unnecessary builds running at the moment if these results are not needed.

The latest release of OCaml 4.02 was in 2014, and I am now proposing to increase the “floor” tested release of OCaml to 4.05, which is the version distributed in Debian 10 “buster”. This is a conservative choice, since Debian 10 “buster” is already at its end of life, with the long-term support coming to an end in mid-2024.

If we move onto Debian 11 “bookworm”, this packages up OCaml 4.11, which can become the next “floor” target for supported OCaml versions in 2024.

So my question to the community is: are any of you still using OCaml releases earlier than 4.11? If so, which version, and what configurations/platforms are of most interest to you?


I’m not personally using it much anymore, but I’m thinking of moving my
minimum supported OCaml version to 4.08. Why 4.08? It’s a milestone
release with many useful features added (notably let operators, open struct …end, Option, Fun, etc.).

I don’t think moving to 4.05 is that useful :-). But I might be missing
some reasonable use cases.


We have used the same rationale to decide that 4.08 would be Why3’s minimal version.


If the conservative choice is affordable, then I would advise taking it. Otherwise, I would recommend 4.08 instead of 4.11, because there are a lot more packages still claiming support for 4.08 than for any previous releases, and it might be good not to drop testing for 4.08 through 4.10 until sometime after all the distributions that included them are end of life.

1 Like

For what it’s worth, in terms of Ubuntu LTS releases, 18.04 has OCaml 4.05 and 20.04 has OCaml 4.08.1. Long term support = 5 years (or 10 for paying customers), so 18.04 is getting really old, but 20.04 is still good for a few years. Another point in favor of 4.08 as the minimal version?


Reminder that we also have results from the last OCaml Users Survey to guide these decisions:

Q21: What is the oldest version that you try to support in the software you develop? (273)

Besides the “latest release”, it seems that OCaml 4.08 is the oldest release for which compatibility
is deemed important. As a reminder, OCaml 4.08 was released in 2019, and was the first release to
feature the Bool, Fun, Int, Option and Result module as well as the let*, let+ and and+ operators.

However, maintainers of pre-4.08 software and devs installing OCaml from their package manager still summed up to 12-14% each. I wish the survey had looked at the relation between these two groups, as well as whether these users can afford to upgrade OCaml when upgrading their dependencies (if they feel a need to upgrade dependencies at all).

I personally think distro packages are a bad solution to manage toolchains anyway. Users of really outdated toolchains should expect their dependencies to become outdated as well.


Thanks everyone; sounds like 4.11 is too much of a leap, but 4.08 is a reasonable choice.

If anyone is using an OCaml version between 4.05 and 4.08, please do chirp up in the next few weeks. Otherwise, we’re converging on OCaml 4.08 being the new minimum version tested.

For those curious about the versions of OCaml shipped in distros other than Ubuntu and Debian, there’s a mapping in OCaml-Dockerfile.


Have you considered keeping 4.08 but skipping versions 4.09 and 4.10, as if treating 4.08 as an (unofficial) LTS?

1 Like

Is there a sense of LTS from the compiler maintainers? My observed experience is apart from serious bugs we move on quickly to the next version.

For context we use ocaml-dockerfile to guide the supported distros and versions in opam-repo-ci and ocaml-ci. If no one is using older versions of OCaml we could significantly trim the number of build we need to do.

For libraries I am supporting 4.08 is the earliest version I’m using but I’d consider moving forward and supporting the last 4 versions as a rolling window.

1 Like

No, there are no long-term-support releases. We do occasionally backport build fixes to enable building older compiler releases on newer systems (new C compilers or toolchain changes that break the build). On the other hand, other bugfixes do not get backported to older releases.

This said, in practice the compiler is reliable enough that users are rarely forced to move to newer releases because of blocking bugs. It therefore happens that sub-communities get “stuck” on older releases, sometimes by chance (they lock versions of their dependencies and never bothered to update their lockfiles to newer OCaml versions), sometimes for technical reasons, for example:

  • They may rely on an experimental (non-upstream) variant of the compiler that was forked from an old release. For example modular implicits are stuck on 4.02 I believe, and ReasonML users were stuck on an old release (not quite as old) for ages – now Melange provides support for recent OCaml versions. Before the Multicore merge, Multicore users were also stuck on 4.10 (iirc) for a while.

  • The Coq community is affected by a performance regression in 4.08, which I believe was never fully elucidated, and as far as 2020 they were recommending 4.07.1 as the “best” OCaml release for Coq users ( [install] Notes on OCaml versions and Coq configuration - Using Coq - Coq ). (I think that around 2022 they started using more recent releases again.)

1 Like

FWIW, there’s a great website covering a lot of distributions and their package versions – ocaml package versions - Repology

From my point of view, dropping everything < 4.08 is a fine move (as @c-cube mentioned).


Bump, we will move to 4.08 as the minimum version tested in OCaml infrastructure in the next few weeks. That includes opam-repo-ci, docker base images and ocaml-ci. Please get in touch if this is a problem.

Quick question regarding the publication of newer packages in opam-repository:

Should new packages be allowed to declare compatibility with ocaml<4.08?

Such new packages would not be tested for the whole range of their constraints. And we are likely to end up with a rapidly degrading ecosystem of packages for <4.08 where many packages are broken.