First release candidate for OCaml 5.0.0

The release of OCaml version 5.0.0 is imminent. As a final step before the release,
we are publishing a release candidate that you can test while waiting for the release
in the upcoming weeks.

If you find any bugs, please report them here:

Issues · ocaml/ocaml · GitHub

Compared to the second beta release, this release contains one toplevel bug fix
and a minor type system fix.

If you are interested by the bug fixes beyond the new multicore runtime, the
full change log for OCaml 5.0.0 is available at:

ocaml/Changes at 5.0 · ocaml/ocaml · GitHub

A short summary of the two changes since the second beta release is also available below.

This release candidate will be followed shortly by a release candidate for OCaml 4.14.1 .
This updated minor version for OCaml 4.14 will mirror the safe bug fixes from the OCaml 5.0

Installation instructions

The base compiler can be installed as an opam switch with the following commands on opam 2.1:

opam update
opam switch create 5.0.0~rc1

For previous version of opam, the switch creation command line is slightly more verbose:

opam update
opam switch create 5.0.0~rc1 --repositories=default,beta=git+

It might be also interesting to check the new support for parallelism by installing the domainslib library with

opam install domainslib

The source code for the release candidate is available at these addresses:

Fine-tuned compiler configuration

If you want to tweak the configuration of the compiler, you can switch to the option variant with:

opam update
opam switch create <switch_name> ocaml-variants.5.0.0~rc1+options <option_list>

where <option_list> is a comma separated list of ocaml-option-* packages. For instance, for a flambda and no-flat-float-array switch:

opam switch create 5.0.0~rc1+flambda+nffa ocaml-variants.5.0.0~rc1+options ocaml-option-flambda ocaml-option-no-flat-float-array

The command line above is slightly more complicated for opam versions anterior to 2.1:

opam update
opam switch create <switch_name> --packages=ocaml-variants.5.0.0~rc1+options,<option_list> --repositories=default,beta=git+

In both cases, all available options can be listed with “opam search ocaml-option”.

Changes since the second beta release

Bug fixes

  • 11776: Extend environment with functor parameters in strengthen_lazy.
    (Chris Casinghino and Luke Maurer, review by Gabriel Scherer)

  • 11533, 11534: follow synonyms again in #show_module_type
    (this had stopped working in 4.14.0)
    (Gabriel Scherer, review by Jacques Garrigue, report by Yaron Minsky)


Hi, following the instructions for opam 2.1, getting the following error:

$ opam --version
$ opam update                                     
$ opam switch create 5.0.0~rc1
$ eval $(opam env)
$ opam install dune utop eio_main
#=== ERROR while compiling eio.0.7 ============================================#
# context     2.1.3 | macos/arm64 | ocaml-base-compiler.5.0.0~rc1 |
# path        ~/.opam/5.0.0~rc1/.opam-switch/build/eio.0.7
# command     ~/.opam/opam-init/hooks/ build dune build -p eio -j 7 --promote-install-files=false @install
# exit-code   1
# env-file    ~/.opam/log/eio-67256-56ca23.env
# output-file ~/.opam/log/eio-67256-56ca23.out
### output ###
# (cd _build/default && /Users/yawarquadiramin/.opam/5.0.0~rc1/bin/ocamlc.opt -w -40 -open Eio__core -open Eio__core.Private -g -bin-annot -I lib_eio/.eio.objs/byte -I /Users/yawarquadiramin/.opam/5.0.0~rc1/lib/bigstringaf -I /Users/yawarquadiramin/.opam/5.0.0~rc1/lib/cstruct -I /Users/yawarquadiramin/.opam/5.0.0~rc1/lib/fmt -I /Users/yawarquadiramin/.opam/5.0.0~rc1/lib/hmap -I /Users/yawarquad[...]
# File "lib_eio/", line 91, characters 14-29:
# 91 |       let d = Mtime.Span.to_s d in
#                    ^^^^^^^^^^^^^^^
# Error: Unbound value Mtime.Span.to_s
# (cd _build/default && /Users/yawarquadiramin/.opam/5.0.0~rc1/bin/ocamlopt.opt -w -40 -open Eio__core -open Eio__core.Private -g -I lib_eio/.eio.objs/byte -I lib_eio/.eio.objs/native -I /Users/yawarquadiramin/.opam/5.0.0~rc1/lib/bigstringaf -I /Users/yawarquadiramin/.opam/5.0.0~rc1/lib/cstruct -I /Users/yawarquadiramin/.opam/5.0.0~rc1/lib/fmt -I /Users/yawarquadiramin/.opam/5.0.0~rc1/lib/hmap [...]
# File "lib_eio/", line 91, characters 14-29:
# 91 |       let d = Mtime.Span.to_s d in
#                    ^^^^^^^^^^^^^^^
# Error: Unbound value Mtime.Span.to_s

downgrade mtime to the v1.X release line. A corresponding opam-repository PR should be opened for that constraint.

1 Like

I’ve opened one here:

Thanks both. That worked. Probably a good idea to set a Semver-like upper bound on all deps, right? I see a few more which only have lower bounds.

Normally, opam-repository’s CI would check all projects depending on mtime before it got accepted. But that check uses OCaml 4.14 so it doesn’t check packages that require OCaml 5, like Eio. I guess that will change once OCaml 5 is officially released.

1 Like

OK, but wouldn’t it be a good idea to guard against possible unforeseen issues like this in the future that slip past the CI? SemVer versioning isn’t perfect, but it’s a good layer of protection, right?