OCaml 4.12.0, third alpha release

The release of OCaml 4.12.0 is approaching. We have released a third alpha
version to help fellow hackers join us early in our bug hunting and
opam ecosystem fixing fun.

Beyond the usual bug fixes, this new alpha version contains two small API fixes
for statmemprof and the Unix module. (Keen-eyed readers might notice a breaking
change in the change log below but this concerns a corner case of a corner case
of the type system that should not affect anyone.)

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

opam update
opam switch create 4.12.0~alpha3 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

If you want to tweak the configuration of the compiler, you can pick configuration options with

opam update
opam switch create <switch_name> --packages=ocaml-variants.4.12.0~alpha3+options,<option_list> --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

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

opam switch create 4.12.0~alpha3+flambda+afl --packages=ocaml-variants.4.12.0~alpha3+options,ocaml-option-flambda,ocaml-option-afl --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

All available options can be listed with “opam search ocaml-option”.

The source code for the alpha is also available at these addresses:


If you want to test this version, it is advised to install the alpha opam repository


opam repo add alpha git://github.com/kit-ty-kate/opam-alpha-repository.git

This alpha repository contains various packages patched with fixes in the
process of being upstreamed. Once the repository installed, these patched
packages will take precedence over the non-patched version.

If you find any bugs, please report them here:

Changes from the second alpha:

  • [additional fixes] 1128, 7503, 9036, 9722, +10069: EINTR-based signal handling.
    When a signal arrives, avoid running its OCaml handler in the middle
    of a blocking section. Instead, allow control to return quickly to
    a polling point where the signal handler can safely run, ensuring that
  • 9907: Fix native toplevel on native Windows.
    (David Allsopp, review by Florian Angeletti)

  • 10056: Memprof: ensure young_trigger is within the bounds of the minor
    heap in caml_memprof_renew_minor_sample (regression from 8684)
    (David Allsopp, review by Guillaume Munch-Maccagnoni and
    Jacques-Henri Jourdan)

  • 10062: set ARCH_INT64_PRINTF_FORMAT correctly for both modes of mingw-w64
    (David Allsopp, review by Xavier Leroy)

  • 10025: Track custom blocks (e.g. Bigarray) with Statmemprof
    (Stephen Dolan, review by Leo White, Gabriel Scherer and Jacques-Henri

  • 10070: Fix Float.Array.blit when source and destination arrays coincide.
    (Nicolás Ojeda Bär, review by Alain Frisch and Xavier Leroy)

  • [additional fixes] 9869, +10073: Add Unix.SO_REUSEPORT
    (Yishuai Li, review by Xavier Leroy, amended by David Allsopp)
  • 9877: manual, warn that multi-index indexing operators should be defined in
    conjunction of single-index ones.
    (Florian Angeletti, review by Hezekiah M. Carty, Gabriel Scherer,
    and Marcello Seri)

  • 10046: Link all DLLs with -static-libgcc on mingw32 to prevent dependency
    on libgcc_s_sjlj-1.dll with mingw-w64 runtime 8.0.0 (previously this was
    only needed for dllunix.dll).
    (David Allsopp, report by Andreas Hauptmann, review by Xavier Leroy)

  • 9896: Share the strings representing scopes, fixing some regression
    on .cmo/.cma sizes
    (Alain Frisch and Xavier Clerc, review by Gabriel Scherer)

  • 10044: Always report the detected ARCH, MODEL and SYSTEM, even for bytecode-
    only builds (fixes a “configuration regression” from 4.08 for the Windows
    (David Allsopp, review by Xavier Leroy)

  • 10071: Fix bug in tests/misc/weaklifetime.ml that was reported in 10055
    (Damien Doligez and Gabriel Scherer, report by David Allsopp)

  • [breaking change] 8907, 9878: Typemod.normalize_signature uses wrong environment
    Does not treat submodules differently when normalizing conjunctive types
    in polymorphic variants.
    This may break code that expose conjunctive types in inferred interface.
    (Jacques Garrigue, report and review by Leo White)
  • 9739, 9747: Avoid calling type variables, types that are not variables in
    recursive occurence error messages
    (for instance, “Type variable int occurs inside int list”)
    (Florian Angeletti, report by Stephen Dolan, review by Armaël Guéneau)

  • 10048: Fix bug with generalized local opens.
    (Leo White, review by Thomas Refis)


Just so I can know when I should really “get moving for reals”, do you have a projected (obviously soft) target date for the official release of 4.12 ? I ask only b/c I have my packages updated, but their tests don’t pass yet (some depend on not-yet-updated packages); if too much time passes, I could just disable the tests in the opam files and release them that way, but obvs. I’d rather wait for the dependent packages to get released, so I could ship code with fully-working tests.

It’s no biggie, just asking in case there’s a known answer.

I am currently targeting a release between mid and late January.