Dear OCaml users,

We have the pleasure of celebrating the birthday of Giovanni Girolamo Saccheri
by announcing the release of OCaml version 5.5.1.

This patch-level release fixes a major type system bug for module-dependent
functions and also contains two security fixes for the runtime: one in the 
Marshal module, another inside the loading of bytecode.

At a less severe level, this release also fixes two bugs in the runtime for
concurrent programs, another runtime bug for musl users; and a handful of other
bugs.

The release also restores support for cloning the compiler on macOS.

Overall, we are strongly advising you to switch to OCaml 5.5.1 if you were
already using OCaml 5.5.0.

The full list of bug fixes is available below for more details.

Happy hacking,
-- Florian Angeletti, for the OCaml team.

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 the release is also directly available on:

* GitHub: https://github.com/ocaml/ocaml/archive/5.5.1.tar.gz)
* Inria archive: https://caml.inria.fr/pub/distrib/ocaml-5.5/ocaml-5.5.1.tar.gz

Changes compared to 5.5.0
-------------------------------------

### Type system

- [14891](https://github.com/ocaml/ocaml/issues/14891), [14982](https://github.com/ocaml/ocaml/issues/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:
  ```ocaml
  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](https://github.com/ocaml/ocaml/issues/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](https://github.com/ocaml/ocaml/issues/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](https://github.com/ocaml/ocaml/issues/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](https://github.com/ocaml/ocaml/issues/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](https://github.com/ocaml/ocaml/issues/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](https://github.com/ocaml/ocaml/issues/14883), [14884](https://github.com/ocaml/ocaml/issues/14884): fix Windows cross-compilation with older mingw32-gcc versions
  (Brian Ward, review by Antonin Décimo and Stefan Muenzel)

- [14871](https://github.com/ocaml/ocaml/issues/14871), [14914](https://github.com/ocaml/ocaml/issues/14914): Ignore OCAMLTOP_INCLUDE_PATH during the build.
  (David Allsopp, report by Andreas Rossberg, review by Florian Angeletti)

- [14901](https://github.com/ocaml/ocaml/issues/14901), [14923](https://github.com/ocaml/ocaml/issues/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](https://github.com/ocaml/ocaml/issues/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](https://github.com/ocaml/ocaml/issues/14881), [14882](https://github.com/ocaml/ocaml/issues/14882): fix printing of external types that are subject to module
  constraints.
  (Stefan Muenzel, review by Florian Angeletti)

### Runtime events library

- [14966](https://github.com/ocaml/ocaml/issues/14966): add the missing EV_MINOR_EPHE_CLEAN constructor to
  Runtime_events.runtime_phase, introduced in [13643](https://github.com/ocaml/ocaml/issues/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](https://github.com/ocaml/ocaml/issues/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)