All Releases

OCaml 5.5.1

This page describes OCaml version 5.5.1, released on 2026-09-05. Go here for a list of all releases.

This release is available as an opam package.

Installation Instructions

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

opam update
opam switch create 5.5.1

The source code for OCaml 5.5.1 is also directly available on:

Configuration Options

The configuration of the installed opam switch can be tuned with the following options:

  • ocaml-option-afl: Set OCaml to be compiled with afl-fuzz instrumentation
  • ocaml-option-bytecode-only: Compile OCaml without the native-code compiler
  • ocaml-option-flambda: Set OCaml to be compiled with flambda activated
  • ocaml-option-musl: Set OCaml to be compiled with musl-gcc
  • ocaml-option-no-flat-float-array: Set OCaml to be compiled with --disable-flat-float-array
  • ocaml-option-static: Set OCaml to be compiled with musl-gcc -static
  • ocaml-option-tsan : Set OCaml to be compiled with thread sanitiser support
  • ocaml-option-address-sanitizer: Set OCaml to be compiled with address sanitiser
  • ocaml-option-leak-sanitizer: Set OCaml to be compiled with leak sanitiser
  • ocaml-option-fp: Set OCaml to be compiled with frame pointers

For instance, one can install a switch with both flambda and the --disable-flat-float-array option with

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

Source Distribution

  • Source tarball (.tar.gz) for compilation under Unix (including Linux and macOS X) and Microsoft Windows (including Cygwin)
  • Also available in .zip format
  • Opam is a source-based distribution of OCaml and many companion libraries and tools. Compilation and installation are automated by powerful package managers.
  • The official development repo is hosted on GitHub.

The INSTALL file of the distribution provides detailed compilation and installation instructions. See also the Windows release notes for instructions on how to build under Windows.

Alternative Compilers

Additionally, the following projects allow you to compile OCaml code to targets traditionally associated with other languages:

User Manual

The user manual for OCaml can be:

Changes

Bug fixes

Type system

  • 14891, 14982: fix scope error leading to an erroneous typechecking for non-dependent application of module-dependent function in presence of dependent first-class module types:
    module type T = sig module type S end
    let f (module M:T) (m: (module M.S)) = m
    module type P = sig type 'a t end
    let error =
      f (module struct module type S = P end) (module List)
    
    (Florian Angeletti, report by Hazem ElMasry, review by Gabriel Scherer)

Runtime

  • 14872: harden loading of bytecode executable files against corrupted or malicious files having 2^29 TOC entries or more. (Xavier Leroy, review by Nicolás Ojeda Bär)

  • 15019: Marshal.from_{string,bytes}: guard against overflow in the computation of the total data length. (Xavier Leroy, report by Akshay Singh, review by Nicolás Ojeda Bär and Antonin Décimo)

  • 14933: Respect sysconf(_SC_SIGSTKSZ) when choosing the size for the alternate signal stack, avoiding fatal errors when linked against musl libc on some Intel CPUs. (Nat Mote, review by Florian Angeletti and Miod Vallat)

  • 14940, fix a memory leak in the OCaml runtime by bounding the size of the internal cache of stacks. (Vesa Karvonen, Florian Angeletti, review by Gabriel Scherer)

  • 15029: Fix a regression on Windows where an OCaml thread that never yielded voluntarily would keep the runtime lock forever, so that the other threads of its domain never ran. Preemptive switching between systhreads had no effect; only explicit calls to Thread.yield or blocking sections would let other threads run. (Nicolás Ojeda Bär, report by Daniel Larraz, review by Antonin Décimo)

Build system

  • 14883, 14884: fix Windows cross-compilation with older mingw32-gcc versions (Brian Ward, review by Antonin Décimo and Stefan Muenzel)

  • 14871, 14914: Ignore OCAMLTOP_INCLUDE_PATH during the build. (David Allsopp, report by Andreas Rossberg, review by Florian Angeletti)

  • 14901, 14923: Fix the generated installation script to cope with macOS's geriatric version of bash when executing in opam's sandbox. (David Allsopp, report by Julian Fondren and Sacha-Élie Ayoun, investigation and initial fix by Kate Deplaix, review by Florian Angeletti)

  • 14989: Improve build reproducibility by letting only otherlibs/{str,unix} build their own .cmi and .cmx. The generic %.cmi/%.cmx rules of the root Makefile were racing with them under make -j and recorded a different source path, which changed the interface digest (and, through it, most other compiled artefacts) as well as the debug info packed into str.a and unix.a. (Bernhard M. Wiedemann, review by David Allsopp and Stefan Muenzel)

User interface

  • 14881, 14882: fix printing of external types that are subject to module constraints. (Stefan Muenzel, review by Florian Angeletti)

Runtime events library

  • 14966: add the missing EV_MINOR_EPHE_CLEAN constructor to Runtime_events.runtime_phase, introduced in 13643. The runtime has emitted this phase since 5.4, when a minor collection has to clean locked ephemerons, but the OCaml type had no constructor for it, so consumers were handed an out-of-range value and crashed when matching on it. (Tim McGilchrist, review by Florian Angeletti)

  • 14969: Fix the units of the runtime events counter EV_C_MINOR_ALLOCATED_WORDS to report as the number of words of minor heap consumed, including headers. (Tim McGilchrist, review by Nicolás Ojeda Bär)