# OCaml 5.0.0 is out!

**URL:** <https://discuss.ocaml.org/t/ocaml-5-0-0-is-out/10974>\
**Category:** Ecosystem\
**Created:** [December 16, 2022, 12:20pm UTC](https://discuss.ocaml.org/t/ocaml-5-0-0-is-out/10974 "2022-12-16T12:20:17Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![octachron](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@octachron](https://discuss.ocaml.org/u/octachron)\
**Post date:** [December 16, 2022, 12:20pm UTC](https://discuss.ocaml.org/t/ocaml-5-0-0-is-out/10974/1 "2022-12-16T12:20:17Z")

</div>

We have the pleasure of celebrating the birthdays of Jane Austen and Arthur C. Clarke by announcing the release of OCaml version 5.0.0.

The highlight of this new major version of OCaml is the long-awaited runtime support for [shared memory parallelism](https://v2.ocaml.org/releases/5.0/manual/parallelism.html) and [effect handlers](https://v2.ocaml.org/releases/5.0/manual/effects.html).

This multicore support is the culmination of more than 8 years of effort, and required a full rewrite of the OCaml runtime environment. Consequently, OCaml 5.0.0 is expected to be a more experimental version of OCaml than the usual OCaml releases.

In this release, the native compiler only supports the x86-64 and arm64 architectures. In terms of operating systems, Linux, the BSDs, macOS and mingw64 on Windows are supported.

We are planning to restore the support for most previously supported architectures and operating systems, and address remaining known issues over the course of the next year.

Don’t let those words of caution hinder your experimentation with OCaml 5:  
OCaml 5 as a language is fully compatible with OCaml 4 down to the performance characteristics of your programs. In other words, any code that works with OCaml 4 should work the same with OCaml 5.

The currently known exceptions to this rule are:

- the removal of many long-deprecated functions and modules
- changes to the internal runtime API
- the performance of ephemerons is currently (and temporarily) strongly degraded.

Please report any unexpected behaviours on the [OCaml issue tracker](https://github.com/ocaml/ocaml/issues).

During the maturing period for OCaml 5, the OCaml 4.14 branch will be maintained by backporting bug fixes from the OCaml 5 branch at regular intervals. The next release on the OCaml 4.14 branch, OCaml 4.14.1, should soon follow this release.

The full list of changes can be found in the changelog below.

* * *

## Installation Instructions

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

```bash
opam update
opam switch create 5.0.0

```

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

```bash
opam install domainslib

```

The source code for the release candidate is also directly available on:

- [GitHub](https://github.com/ocaml/ocaml/archive/5.0.0.tar.gz)
- [OCaml archives at Inria](https://caml.inria.fr/pub/distrib/ocaml-5.0/ocaml-5.0.0.tar.gz)

### Fine-Tuned Compiler Configuration

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

```bash
opam update
opam switch create <switch_name> ocaml-variants.5.0.0+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:

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

```

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

```bash
opam update
opam switch create <switch_name> --packages=ocaml-variants.5.0.0+options,<option_list>

```

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

* * *

## Changelog for OCaml 5.0.0 (16 December 2022)

- [#10831](https://github.com/ocaml/ocaml/issues/10831): Multicore OCaml  
(Enguerrand Decorne, Stephen Dolan, Tom Kelly, Sadiq Jaffer,  
Anil Madhavapeddy, Sudha Parimala, KC Sivaramakrishnan,  
Leo White, the Tarides multicore team,  
review by Florian Angeletti, Damien Doligez, Xavier Leroy,  
Guillaume Munch-Maccagnoni, Olivier Nicole, Nicolás Ojeda Bär,  
Gabriel Scherer, the OCaml core development team, and many  
other valued reviewers.)

### Runtime system:

- [#11400](https://github.com/ocaml/ocaml/issues/11400): Runtime events counters fixes  
Fixes mismatch between OCaml and C APIs, removes events from 4.x that  
are not present in the 5.0 GC and adds some missing probes.  
(Sadiq Jaffer, review by Gabriel Scherer, Florian Angeletti)

- [#11368](https://github.com/ocaml/ocaml/issues/11368): Runtime events buffer size OCAMLRUNPARAMS fix  
The runtime events buffer size can now be set via the ‘e’ OCAMLRUNPARAM.  
This is previously mistakenly enabled/disabled tracing instead.  
(Sadiq Jaffer, review by KC Sivaramakrishnan, David Allsopp, Damien Doligez)

- [#11308](https://github.com/ocaml/ocaml/issues/11308): Add environment variable to preserve runtime\_events after exit  
If the environment variable OCAML\_RUNTIME\_EVENTS\_PRESERVE exists then the  
runtime will not remove the runtime events ring buffers at exit. This  
makes tracing very short running programs more reliable.  
(Sadiq Jaffer, review by KC Sivaramakrishnan)

- [#10964](https://github.com/ocaml/ocaml/issues/10964): Ring-buffer based runtime tracing (runtime\_events)  
Runtime\_events is a very low overhead runtime tracing system designed for  
continuous monitoring of OCaml applications.  
(Sadiq Jaffer, review by Anil Madhavapeddy, Enguerrand Decorne,  
Richard Warburton, Gabriel Scherer, Sabine Schmaltz, Florian Angeletti,  
Patrick Ferris, Tom Kelly)

- (_breaking change_) [#10723](https://github.com/ocaml/ocaml/issues/10723): do not use `-flat-namespace` linking for macOS.  
(Carlo Cabrera, review by Damien Doligez)

- (_breaking change_) [#10863](https://github.com/ocaml/ocaml/issues/10863), [#10933](https://github.com/ocaml/ocaml/issues/10933): Remove support for old, unprefixed C runtime function names  
such as `alloc`. The new names prefixed with `caml_` must be used instead,  
such as `caml_alloc`. Consequently, it is no longer needed to define  
`CAML_NAME_SPACE` to avoid bringing unprefixed names into scope: this is now  
the default behavior.  
(Nicolás Ojeda Bär, review by Xavier Leroy)

- [#10902](https://github.com/ocaml/ocaml/issues/10902): Do not register empty code fragments in natdynlink.  
(David Allsopp, review by Xavier Leroy and Damien Doligez)

- [#10965](https://github.com/ocaml/ocaml/issues/10965): `caml_fatal_error_hook`, GC timing hooks, and  
`caml_scan_roots_hook` are now atomic variables. Restore GC timing  
hooks in multicore.  
(Guillaume Munch-Maccagnoni, review by Enguerrand Decorne, Xavier  
Leroy, Gabriel Scherer, and KC Sivaramakrishnan)

- [#11209](https://github.com/ocaml/ocaml/issues/11209): Add a public and thread-safe timing hook running at domain  
termination, after this domain has stopped running any OCaml code:  
`caml_domain_terminated_hook`. This can be useful for implementing  
domain-local state in C.  
(Guillaume Munch-Maccagnoni, review by Xavier Leroy and Gabriel  
Scherer)

- [#10875](https://github.com/ocaml/ocaml/issues/10875), [#11731](https://github.com/ocaml/ocaml/issues/11731): Add option to allocate fiber stacks and sigaltstacks with  
mmap(MAP\_STACK) instead of malloc. This is exposed via a configure  
–enable-mmap-map-stack option, and is enabled by default on OpenBSD where  
it is mandatory.  
(Anil Madhavapeddy, review by Gabriel Scherer, Tom Kelly,  
Michael Hendricks and KC Sivaramakrishnan).

- [#10950](https://github.com/ocaml/ocaml/issues/10950): Do not use mmap to allocate Caml\_state.  
In order to reduce virtual memory usage, we dynamically allocate  
the domain\_state structure.  
(Enguerrand Decorne, KC Sivaramakrishnan and Tom Kelly,  
review by Anil Madhavapeddy and Gabriel Scherer)

- [#11010](https://github.com/ocaml/ocaml/issues/11010): Use strerror\_r for reentrant error string conversion.  
(Anil Madhavapeddy and Xavier Leroy, review by same and Edwin Török)

- [#11002](https://github.com/ocaml/ocaml/issues/11002), [#11066](https://github.com/ocaml/ocaml/issues/11066), [#11086](https://github.com/ocaml/ocaml/issues/11086): Do not use Begin\_roots/End\_roots macros in  
the runtime system. Also fix a missing root registration in the  
implementation of Unix.write on Windows.  
(Nicolás Ojeda Bär, Daniel Bünzli and Antonin Décimo,  
review by Xavier Leroy and David Allsopp)

- [#11022](https://github.com/ocaml/ocaml/issues/11022): Track GC work for all managed bigarray allocations  
(Stephen Dolan, report by Andrew Hunter, review by Damien Doligez)

- [#10802](https://github.com/ocaml/ocaml/issues/10802): Use 4.12 value macros and helpers in C code  
(Antonin Décimo, review by Gabriel Scherer)

- [#11105](https://github.com/ocaml/ocaml/issues/11105): Fix handling of fiber stack cache with multiple domains  
(Jon Ludlam, KC Sivaramakrishnan and Tom Kelly)

- [#11054](https://github.com/ocaml/ocaml/issues/11054): Respect user provided maximum stack space  
Make sure the stack we initially request is sized accordingly to  
the user provided settings. tmc/stack\_space is also updated by  
this PR in order to account for this change.  
(Enguerrand Decorne, report by Jon Ludlam,  
review by Tom Kelly, KC Sivaramakrishnan and Gabriel Scherer)

- [#11238](https://github.com/ocaml/ocaml/issues/11238): Increase the default limit for the stack size to 128 Mi words,  
i.e. 1 Gib for 64-bit platforms and 512 Mib for 32-bit platforms.  
(Xavier Leroy, review by Sébastien Hinderer)

- (_breaking change_) [#11295](https://github.com/ocaml/ocaml/issues/11295): An ISO C 2011 compliant compiler, including full support for atomic  
types, is now required to build the OCaml runtime system.  
(Xavier Leroy, review by David Allsopp and Sébastien Hinderer)

- [#10915](https://github.com/ocaml/ocaml/issues/10915), [#11039](https://github.com/ocaml/ocaml/issues/11039), [#11057](https://github.com/ocaml/ocaml/issues/11057), [#11095](https://github.com/ocaml/ocaml/issues/11095), [#11190](https://github.com/ocaml/ocaml/issues/11190): Implement quality treatment for  
asynchronous actions in multicore. Reimplement the old behaviour of  
`caml_process_pending*` for multicore.  
(Guillaume Munch-Maccagnoni, review by Sadiq Jaffer and Gabriel Scherer)

- [#11303](https://github.com/ocaml/ocaml/issues/11303): Ensure that GC is not invoked from bounds check failures  
(Stephen Dolan, review by Sadiq Jaffer and Xavier Leroy)

- [#11304](https://github.com/ocaml/ocaml/issues/11304): Fix data race on Windows file descriptors  
(Olivier Nicole and Xavier Leroy, review by Xavier Leroy, David Allsopp,  
and Sadiq Jaffer)

- (_breaking change_) [#11337](https://github.com/ocaml/ocaml/issues/11337): pass ‘flags’ metadata to root scanners, to optimize stack  
scanning in the bytecode interpreter.  
Changes the interface of user-provided root-scanning hooks.  
(Gabriel Scherer, review by Xavier Leroy,  
Guillaume Munch-Maccagnoni, Sadiq Jaffer and Tom Kelly)

- [#11144](https://github.com/ocaml/ocaml/issues/11144): Restore frame-pointers support for amd64  
(Fabrice Buoro, review by Frederic Bour and KC Sivaramakrishnan)

- (_breaking change_) [#11255](https://github.com/ocaml/ocaml/issues/11255): in the C interface, `&Field(v, i)` now has type `volatile value *`  
instead of `value *` in OCaml 4. This makes the memory model  
for mixed OCaml/C code better defined, but can cause warnings or type  
errors in user C code.  
(KC Sivaramakrishnan, review by Xavier Leroy, Gabriel Scherer and  
Guillaume Munch-Maccagnoni, additional discussions with Stephen  
Dolan and Luc Maranget)

- [#5299](https://github.com/ocaml/ocaml/issues/5299), [#4787](https://github.com/ocaml/ocaml/issues/4787), [#11138](https://github.com/ocaml/ocaml/issues/11138), [#11272](https://github.com/ocaml/ocaml/issues/11272), [#11506](https://github.com/ocaml/ocaml/issues/11506): To help debugging, `Caml_state`  
now dynamically checks that the domain lock is held, and fails  
otherwise (with a fatal error at most entry points of the C API, or  
systematically in debug mode). A new variable `Caml_state_opt` is  
introduced, and is `NULL` when the domain lock is not held. This  
allows to test from C code if the current thread holds the lock of  
its domain.  
(Guillaume Munch-Maccagnoni, review by Florian Angeletti, Damien  
Doligez, Sadiq Jaffer, Xavier Leroy, and Gabriel Scherer)

- [#11223](https://github.com/ocaml/ocaml/issues/11223): The serialization format of custom blocks changed in 4.08,  
but the deserializer would still support the pre-4.08 format. OCaml  
5.x removed support for this old format; provide a clear error message  
in this case.  
(Hugo Heuzard, review by Gabriel Scherer)

- [#11504](https://github.com/ocaml/ocaml/issues/11504), [#11522](https://github.com/ocaml/ocaml/issues/11522): Use static allocation in `caml_make_float_vect` in  
no-flat-float-array mode, it’s more efficient and avoids a a race condition  
(Xavier Leroy, report by Guillaume Munch-Maccagnoni, review by David Allsopp)

- [#11652](https://github.com/ocaml/ocaml/issues/11652): Fix benign off-by-one error in Windows implementation of caml\_mem\_map.  
(David Allsopp, review by Gabriel Scherer)

- [#11669](https://github.com/ocaml/ocaml/issues/11669), [#11704](https://github.com/ocaml/ocaml/issues/11704): Fix construction of Effect.Unhandled exceptions in the  
bytecode interpreter.  
(David Allsopp and Xavier Leroy, report by Samuel Hym, review by Xavier Leroy  
and Gabriel Scherer)

### Code generation and optimizations:

- [#10972](https://github.com/ocaml/ocaml/issues/10972): ARM64 multicore support: OCaml & C stack separation;  
dynamic stack size checks; fiber and effects support.  
(Tom Kelly and Xavier Leroy, review by KC Sivaramakrishnan, Xavier Leroy  
Guillaume Munch-Maccagnoni, Eduardo Rafael, Stephen Dolan and  
Gabriel Scherer)

- (_breaking change_) [#10845](https://github.com/ocaml/ocaml/issues/10845) Emit frametable size on amd64 BSD (OpenBSD, FreeBSD, NetBSD) systems  
(emitted for Linux in [#8805](https://github.com/ocaml/ocaml/issues/8805))  
(Hannes Mehnert, review by Nicolás Ojeda Bär)

### Standard library:

- [#10742](https://github.com/ocaml/ocaml/issues/10742): Use LXM as the pseudo-random number generator for module Random.  
Add `Random.State.split` and `Random.split` to “split” a PRNG off  
another PRNG.  
(Xavier Leroy, review by Gabriel Scherer and Hugo Heuzard)

- (_breaking change_) [#10867](https://github.com/ocaml/ocaml/issues/10867), [#11345](https://github.com/ocaml/ocaml/issues/11345): Remove deprecated values: Array.create, Array.make\_float,  
Array.create\_matrix, Bytes.uppercase, Bytes.lowercase, Bytes.capitalize,  
Bytes.uncapitalize, Char.lowercase, Char.uppercase, Filename.temp\_dir\_name,  
Int32.format, Int64.format, Nativeint.format, Format.bprintf, Format.kprintf,  
Format.set\_all\_formatter\_output\_functions,  
Format.get\_all\_formatter\_output\_functions,  
Format.pp\_set\_all\_formatter\_output\_functions,  
Format.pp\_get\_all\_formatter\_output\_functions, Format.pp\_open\_tag,  
Format.pp\_close\_tag, Format.open\_tag, Format.close\_tag,  
Format.formatter\_tag\_functions, Format.pp\_set\_formatter\_tag\_functions,  
Format.pp\_get\_formatter\_tag\_functions, Format.set\_formatter\_tag\_functions,  
Format.get\_formatter\_tag\_functions, Gc (mutability of the fields of type  
Gc.control), Lazy.lazy\_from\_fun, Lazy.lazy\_from\_val, Lazy.lazy\_is\_val,  
Obj.set\_tag, Obj.truncate, Obj.final\_tag, Obj.extension\_constructor,  
Obj.extension\_name, Obj.extension\_id, Scanf.stdib, Scanf.fscanf,  
Scanf.kfscanf, Stdlib.( & ), Stdlib.( or ), String.set, String.copy,  
String.fill, String.unsafe\_set, String.unsafe\_fill, String.uppercase,  
String.lowercase, String.capitalize, String.uncapitalize, Thread.kill,  
Thread.wait\_write, Thread.wait\_read, the whole ThreadUnix module, the  
infix operator (.\<-).  
(Nicolás Ojeda Bär, review by Damien Doligez)

- (_breaking change_) [#10896](https://github.com/ocaml/ocaml/issues/10896): Remove Stream, Genlex and Pervasives. Also remove legacy standalone  
bigarray library (the Bigarray module is now part of the standard library).  
(Nicolás Ojeda Bär, review by Kate Deplaix and Anil Madhavapeddy)

- [#10921](https://github.com/ocaml/ocaml/issues/10921): Use getentropy, when available, to seed the generator during  
`Random.self_init`  
(Michael Hendricks, review by Gabriel Scherer, Xavier Leroy, and  
Anil Madhavapeddy)

- (_breaking change_) [#10924](https://github.com/ocaml/ocaml/issues/10924): Add deprecated attribute to Printexc.catch, Printf.kprintf and  
Unix.SO\_ERROR.  
(Nicolás Ojeda Bär, review by Damien Doligez)

- [#10986](https://github.com/ocaml/ocaml/issues/10986): Add Scanf.sscanf\_opt, Scanf.bscanf\_opt and Scanf.scanf\_opt.  
(Nicolás Ojeda Bär, review by Florian Angeletti and Gabriel Scherer)

- (_breaking change_) [#11157](https://github.com/ocaml/ocaml/issues/11157): Rename “hash” in the “Hashtbl.SeededHashedType” signature to  
“seeded\_hash”. This allows defining both seeded and unseeded hash functions in  
the same module.  
(Nicolás Ojeda Bär, review by Gabriel Scherer and Xavier Leroy)

- [#8878](https://github.com/ocaml/ocaml/issues/8878): Add String.hash and String.seeded\_hash.  
(Tom Kelly, review by Alain Frisch and Nicolás Ojeda Bär)

### Other libraries:

- (_breaking change_) [#9071](https://github.com/ocaml/ocaml/issues/9071), [#9100](https://github.com/ocaml/ocaml/issues/9100), [#10935](https://github.com/ocaml/ocaml/issues/10935): Reimplement `Thread.exit()` as raising the  
exception `Thread.Exit`, and mark `Thread.exit` as deprecated.  
The new implementation changes the behavior compared with  
the OCaml 4 implementation. For example, the new implementation  
causes `Fun.finally` finalizers to be run and catch-all exception  
handlers to prevent termination.  
(Jacques-Henri Jourdan and Xavier Leroy, review by Damien Doligez,  
Guillaume Munch-Maccagnoni, Gabriel Scherer, and Enguerrand Decorne)

- [#11034](https://github.com/ocaml/ocaml/issues/11034): Dynlink library, add a global lock to make dynlinking  
thread-safe.  
(Florian Angeletti, review by Gabriel Scherer)

- [#11087](https://github.com/ocaml/ocaml/issues/11087): deprecate Thread.wait\_timed\_read, Thread.wait\_timed\_write,  
Thread.select, Thread.wait\_pid. The same functionality is available in the  
Unix module.  
(Nicolás Ojeda Bär, review by Anil Madhavapeddy)

- [#11309](https://github.com/ocaml/ocaml/issues/11309), [#11424](https://github.com/ocaml/ocaml/issues/11424), [#11427](https://github.com/ocaml/ocaml/issues/11427), [#11545](https://github.com/ocaml/ocaml/issues/11545): Add Domain.recommended\_domain\_count.  
(Christiano Haesbaert, Konstantin Belousov, review by David Allsopp,  
KC Sivaramakrishnan, Gabriel Scherer, Nicolas Ojeda Bar)

- [#11461](https://github.com/ocaml/ocaml/issues/11461), [#11466](https://github.com/ocaml/ocaml/issues/11466): Fix gethostbyaddr for IPv6 arguments and make it domain-safe  
(Olivier Nicole, Nicolás Ojeda Bär, David Allsopp and Xavier Leroy,  
review by the same)

- [#11479](https://github.com/ocaml/ocaml/issues/11479): Make Unix.symlink domain-safe on Windows  
(Olivier Nicole, review by Xavier Leroy and David Allsopp)

### Tools:

- (_breaking change_) [#11004](https://github.com/ocaml/ocaml/issues/11004): Litmus tests for checking the implementation of the  
memory model.  
(Luc Maranget, review by Gabriel Scherer and Xavier Leroy)

- [#11024](https://github.com/ocaml/ocaml/issues/11024): Handle alerts in ocamldoc.  
The alert `[@@alert deprecated]` is handled specifically and it’s no longer  
needed to duplicate the deprecated annotation (the alert for the compiler and  
the tag for the documentation). Every other alerts also appear in the  
documentation.  
(Jules Aguillon, review by Florian Angeletti)

- [#11065](https://github.com/ocaml/ocaml/issues/11065): Port the bytecode debugger to 5.0, adding support for effect handlers.  
(Damien Doligez and @fabbing, review by @fabbing and Xavier Leroy)

- [#11079](https://github.com/ocaml/ocaml/issues/11079): Add the -nobanners option to dumpobj.  
(Sébastien Hinderer, review by Gabriel Scherer and Vincent Laviron)

- [#11100](https://github.com/ocaml/ocaml/issues/11100): Fix ocamltest to make sure failed tests are not counted as  
“unexpected error”.  
(Damien Doligez, review by Sébastien Hinderer)

- [#11245](https://github.com/ocaml/ocaml/issues/11245): Merge the common code of ocamlcp and ocamloptp into a single module.  
(David Allsopp, review by Sébastien Hinderer)

- [#11382](https://github.com/ocaml/ocaml/issues/11382): OCamlmktop use a new initialization module “OCamlmktop\_init” to  
preserve backward-compatibility with user-module provided modules that install  
toplevel printers.  
(Florian Angeletti, review by Gabriel Scherer and David Allsopp)

### Manual and documentation:

- [#11058](https://github.com/ocaml/ocaml/issues/11058): runtime/HACKING.adoc tips on debugging the runtime  
(Gabriel Scherer, review by Enguerrand Decorne and Nicolás Ojeda Bär)

- [#11093](https://github.com/ocaml/ocaml/issues/11093): Add an effect handlers tutorial  
(KC Sivaramakrishnan, review by François Pottier, Gabriel Scherer, François  
Bobot and Wiktor Kuchta)

- [#11192](https://github.com/ocaml/ocaml/issues/11192): Better documentation for condition variables.  
(François Pottier, review by Luc Maranget, Xavier Leroy, and Wiktor Kuchta)

- [#11093](https://github.com/ocaml/ocaml/issues/11093): Add tutorials on parallelism features and the relaxed memory model  
(KC Sivaramakrishnan, review by Damien Doligez, Anil Madhavapeddy, Gabriel  
Scherer, Thomas Leonard, Tom Ridge, Xavier Leroy, Luc Maranget, Fabrice  
Buoro, Olivier Nicole, Guillaume Munch-Maccagnoni, Jacques-Henri Jourdan)

- [#11640](https://github.com/ocaml/ocaml/issues/11640): Add Flambda commonly-used options to the ocamlopt manpage  
(Amandine Nangah, review by David Allsopp, Florian Angeletti,  
Sébastien Hinderer, and Vincent Laviron)

- [#11676](https://github.com/ocaml/ocaml/issues/11676): Fix missing since annotation in the `Sys` and `Format` modules  
(Github user Bukolab99, review by Florian Angeletti)

- [#11813](https://github.com/ocaml/ocaml/issues/11813): Make new multicore chapters easier to discover, and emphasize impact  
on C bindings.  
(Edwin Török, review by KC Sivaramakrishnan, and Florian Angeletti)

### Compiler user-interface and warnings:

- [#9140](https://github.com/ocaml/ocaml/issues/9140), [#11131](https://github.com/ocaml/ocaml/issues/11131): New command-line flag -nocwd to not include implicit  
the current directory to the load path.  
(Thomas Roglin, review by Gabriel Scherer and Nicolás Ojeda Bär)

- [#11089](https://github.com/ocaml/ocaml/issues/11089): Add ‘since ’ information to compiler warnings.  
(André Maroneze, review by Florian Angeletti and Gabriel Scherer)

- [#10909](https://github.com/ocaml/ocaml/issues/10909): Disable warning 59 (assignment to immutable blocks) unless flambda  
invariant checks are enabled.  
(Vincent Laviron, review by Gabriel Scherer)

- [#10981](https://github.com/ocaml/ocaml/issues/10981), [#11276](https://github.com/ocaml/ocaml/issues/11276): Implement a -cmi-file option for ocamlc and ocamlopt.  
(Sébastien Hinderer, review by Damien Doligez, Daniel Bünzli and  
Florian Angeletti)

- (_breaking change_) [#11049](https://github.com/ocaml/ocaml/issues/11049): Stop padding 1-digit compiler minor version numbers.  
(So for instance OCaml 5.0 rather than 5.00)  
(Sébastien Hinderer, review by David Allsopp, Florian Angeletti and  
Xavier Leroy)

- [#11184](https://github.com/ocaml/ocaml/issues/11184), [#11670](https://github.com/ocaml/ocaml/issues/11670): Stop calling ranlib on created / installed libraries  
(Sébastien Hinderer and Xavier Leroy, review by the same)

- [#11253](https://github.com/ocaml/ocaml/issues/11253): Deprecate `ocaml script` and `ocamlnat` script where `script` has no  
extension and is an implicit basename.  
(David Allsopp, review by Florian Angeletti and Sébastien Hinderer)

### Internal/compiler-libs changes:

- [#10878](https://github.com/ocaml/ocaml/issues/10878), [#10909](https://github.com/ocaml/ocaml/issues/10909): restore flambda after the Multicore merge.  
(Vincent Laviron, review by Gabriel Scherer and Xavier Leroy)

- [#10864](https://github.com/ocaml/ocaml/issues/10864), [#10888](https://github.com/ocaml/ocaml/issues/10888): restore afl-fuzz mode for sequential programs.  
(Jan Midtgaard, review by Xavier Leroy and Gabriel Scherer)

- [#11008](https://github.com/ocaml/ocaml/issues/11008), [#11047](https://github.com/ocaml/ocaml/issues/11047): rework GC statistics in the Multicore runtime  
(Gabriel Scherer, review by Enguerrand Decorne)

- [#11058](https://github.com/ocaml/ocaml/issues/11058): basic debugging documentation in runtime/HACKING.adoc  
(Gabriel Scherer, review by Enguerrand Decorne and Nicolás Ojeda Bär)

- [#11199](https://github.com/ocaml/ocaml/issues/11199): Stop installing topdirs.cmi twice. The toplevel now reads topdirs.cmi  
from +compiler-libs, as the debugger does.  
(David Allsopp, review by Sébastien Hinderer)

- [#11007](https://github.com/ocaml/ocaml/issues/11007), [#11399](https://github.com/ocaml/ocaml/issues/11399): META files for the stdlib, compiler-libs and other libraries  
(unix, dynlink, str, runtime\_events, threads, ocamldoc) are now installed  
along with the compiler.  
(David Allsopp, Florian Angeletti, Nicolás Ojeda Bär and Sébastien Hinderer,  
review by Daniel Bünzli, Kate Deplaix, Anil Madhavapeddy and Gabriel Scherer)

### Build system:

- (_breaking change_) [#10893](https://github.com/ocaml/ocaml/issues/10893): Remove configuration options --disable-force-safe-string and  
DEFAULT\_STRING=unsafe as well as --enable-force-safe-string and  
DEFAULT\_STRING=safe which are now the default unconditionally.  
(Kate Deplaix, review by Gabriel Scherer and David Allsopp)

- [#11092](https://github.com/ocaml/ocaml/issues/11092): Build native-code compilers on OpenBSD/aarch64.  
(Christopher Zimmermann, review by Anil Madhavapeddy)

- [#11126](https://github.com/ocaml/ocaml/issues/11126): Build system: make it possible to choose which ocamldep  
(and flags) to use when computing dependencies for the compiler.  
Add a -no-slash option to ocamldep to let users override -slash.  
(Sébastien Hinderer, review by David Allsopp)

- [#11147](https://github.com/ocaml/ocaml/issues/11147): Factorize the stdlib-related compilation flags. Make it  
possible to control them consistently through the STDLIBFLAGS  
build variable. Make sure ocamldoc and ocamllex get compiled and  
linked with debugging information (-g).  
(Sébastien Hinderer, review by Gabriel Scherer)

- [#11149](https://github.com/ocaml/ocaml/issues/11149): Make the bootstrap process reproducible on systems with non-big-endian  
floating point. If the boot/ artefacts are up-to-date, this means that running  
make bootstrap on any platform should not change the images in boot/ and paves  
the way for automated testing that the bootstrap is repeatable.  
(David Allsopp, review by Damien Doligez and Sébastien Hinderer)

- [#11160](https://github.com/ocaml/ocaml/issues/11160): otherlibs: merge win32unix into unix.  
(Sébastien Hinderer, review by David Allsopp, Nicolás Ojeda Bär,  
Xavier Leroy, Vincent Laviron and Antonin Décimo)

- (_breaking change_) [#11198](https://github.com/ocaml/ocaml/issues/11198), [#11298](https://github.com/ocaml/ocaml/issues/11298): Install the Dynlink, Str and Unix libraries to individual  
subdirectories of LIBDIR. The compiler, debugger and toplevel automatically  
add `-I +lib` if required, but display an alert.  
(David Allsopp, review by Florian Angeletti, Nicolás Ojeda Bär,  
Valentin Gatien-Baron and Sébastien Hinderer)

- [#11200](https://github.com/ocaml/ocaml/issues/11200): Install ocamlprof’s Profiling runtime module to a +profiling,  
removing it from the default namespace.  
(David Allsopp, review by Sébastien Hinderer)

- [#11294](https://github.com/ocaml/ocaml/issues/11294): Switch minimum required autoconf to 2.71.  
(David Allsopp, review by Xavier Leroy)

- [#11370](https://github.com/ocaml/ocaml/issues/11370), [#11373](https://github.com/ocaml/ocaml/issues/11373): Don’t pass CFLAGS to flexlink during configure.  
(David Allsopp, report by William Hu, review by Xavier Leroy and  
Sébastien Hinderer)

- [#11487](https://github.com/ocaml/ocaml/issues/11487): Thwart FMA test optimization during configure  
(William Hu, review by David Allsopp and Sébastien Hinderer)

- [#11097](https://github.com/ocaml/ocaml/issues/11097): Build native-code compilers on NetBSD/aarch64  
(Kate Deplaix, review by Anil Madhavapeddy)

### Bug fixes:

- [#10768](https://github.com/ocaml/ocaml/issues/10768), [#11340](https://github.com/ocaml/ocaml/issues/11340): Fix typechecking regression when combining first class  
modules and GADTs.  
(Jacques Garrigue, report by François Thiré, review by Matthew Ryan)

- [#10790](https://github.com/ocaml/ocaml/issues/10790): don’t drop variance and injectivity annotations when pretty printing  
`with` constraints (for example, `with type +!'a t = ...`).  
(Florian Angeletti, report by Luke Maurer, review by Matthew Ryan and  
Gabriel Scherer)

- [#11167](https://github.com/ocaml/ocaml/issues/11167): Fix memory leak from signal stack.  
(Antoni Żewierżejew, review by Gabriel Scherer and Enguerrand Decorne)

- [#11112](https://github.com/ocaml/ocaml/issues/11112): harden -use-runtime against spaces or quotes in the provided path  
(Gabriel Scherer, report by Brahima Dibassi, review by David Allsopp)

- [#11068](https://github.com/ocaml/ocaml/issues/11068), [#11070](https://github.com/ocaml/ocaml/issues/11070): Fix typo in function name given in Unix\_error exception for  
Unix.readlink on Windows.  
(David Allsopp, report by Xia Li-yao)

- [#10807](https://github.com/ocaml/ocaml/issues/10807): Don’t duplicate standard handles in the child process  
spawned by win32unix Unix.create\_process if the handles were already  
inheritable. Fix broken signalling of EOF on standard handles if  
they were already inheritable.  
(Antonin Décimo, review by Xavier Leroy and Nicolás Ojeda Bär)

- [#10868](https://github.com/ocaml/ocaml/issues/10868): Fix off-by-1 bug when initializing frame hashtables  
(Jonah Beckford, review by Tom Kelly, Nicolás Ojeda Bär and  
KC Sivaramakrishnan)

- [#11077](https://github.com/ocaml/ocaml/issues/11077): Make dumpobj compatible with absence of naked pointer support  
(Olivier Nicole and Jan Midtgaard, review by Gabriel Scherer)

- [#11111](https://github.com/ocaml/ocaml/issues/11111): fix fork() usage in ocamltest C code.  
When calling fork() from C code with the Multicore runtime active,  
one needs to call caml\_atfork\_hook() on the forked child before it  
can use the OCaml runtime.  
(Gabriel Scherer, review by Xavier Leroy, report by Brahima Dibassi)

- [#10809](https://github.com/ocaml/ocaml/issues/10809): Use the WSA\_FLAG\_NO\_HANDLE\_INHERIT on Windows when creating  
sockets with WSASocket if the cloexec (non-inheritable) parameter is  
true. Fixes a race condition where a child process could inherit the  
socket and deadlock the parent.  
(Antonin Décimo, review by Xavier Leroy)

- [#11194](https://github.com/ocaml/ocaml/issues/11194), [#11609](https://github.com/ocaml/ocaml/issues/11609): Fix inconsistent type variable names in “unbound type var”  
messages  
(Ulysse Gérard and Florian Angeletti, review Florian Angeletti and  
Gabriel Scherer)

- [#11204](https://github.com/ocaml/ocaml/issues/11204): Fix regression introduced in 4.14.0 that would trigger Warning 17 when  
calling virtual methods introduced by constraining the self type from within  
the class definition.  
(Nicolás Ojeda Bär, review by Leo White)

- [#11263](https://github.com/ocaml/ocaml/issues/11263), [#11267](https://github.com/ocaml/ocaml/issues/11267): caml/misc.h: check whether `_MSC_VER` is defined before using  
it to ensure that the headers can always be used in code which turns on  
-Wundef (or equivalent).  
(David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and  
Sébastien Hinderer)

- [#11289](https://github.com/ocaml/ocaml/issues/11289), [#11405](https://github.com/ocaml/ocaml/issues/11405): fix some leaks on systhread termination  
(Fabrice Buoro, Enguerrand Decorne, Gabriel Scherer,  
review by Xavier Leroy and Florian Angeletti, report by Romain Beauxis)

- [#11314](https://github.com/ocaml/ocaml/issues/11314), [#11416](https://github.com/ocaml/ocaml/issues/11416): fix non-informative error message for module inclusion  
(Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer)

- [#11358](https://github.com/ocaml/ocaml/issues/11358), [#11379](https://github.com/ocaml/ocaml/issues/11379): Refactor the initialization of bytecode threading,  
This avoids a “dangling pointer” warning of GCC 12.1.  
(Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer)

- [#11387](https://github.com/ocaml/ocaml/issues/11387), module type with constraints no longer crash the compiler in presence  
of both shadowing warnings and the `-bin-annot` compiler flag.  
(Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer)

- [#11392](https://github.com/ocaml/ocaml/issues/11392), [#11392](https://github.com/ocaml/ocaml/issues/11392): assertion failure with -rectypes and external definitions  
(Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)

- [#11417](https://github.com/ocaml/ocaml/issues/11417): Fix regression allowing virtual methods in non-virtual classes.  
(Leo White, review by Florian Angeletti)

- [#11468](https://github.com/ocaml/ocaml/issues/11468): Fix regression from [#10186](https://github.com/ocaml/ocaml/issues/10186) (OCaml 4.13) detecting IPv6 on Windows for  
mingw-w64 i686 port.  
(David Allsopp, review by Xavier Leroy and Sébastien Hinderer)

- [#11482](https://github.com/ocaml/ocaml/issues/11482), [#11542](https://github.com/ocaml/ocaml/issues/11542): Fix random crash in large closure allocation  
(Damien Doligez, report by Thierry Martinez and Vincent Laviron, review by  
Xavier Leroy)

- [#11508](https://github.com/ocaml/ocaml/issues/11508), [#11509](https://github.com/ocaml/ocaml/issues/11509): make Bytes.escaped domain-safe  
(Christiano Haesbaert and Gabriel Scherer,  
review by Xavier Leroy,  
report by Jan Midtgaard and Tom Kelly)

- [#11516](https://github.com/ocaml/ocaml/issues/11516), [#11524](https://github.com/ocaml/ocaml/issues/11524): Fix the `deprecated_mutable` attribute.  
(Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti)

- [#11576](https://github.com/ocaml/ocaml/issues/11576): Fix bug in Bigarray.Genarray.init in the the case of zero-dimensional  
arrays.  
(Nicolás Ojeda Bär, Jeremy Yallop, report by Masayuki Takeda, review by Jeremy  
Yallop and Florian Angeletti)

- [#11587](https://github.com/ocaml/ocaml/issues/11587): Prevent integer comparison from being used on pointers  
(Vincent Laviron, review by Gabriel Scherer)

- [#11622](https://github.com/ocaml/ocaml/issues/11622): Prevent stack overflow when printing a constructor or record  
mismatch error involving recursive types.  
(Florian Angeletti, review by Gabriel Scherer)

- [#11662](https://github.com/ocaml/ocaml/issues/11662), [#11673](https://github.com/ocaml/ocaml/issues/11673): fix a memory leak when using Dynlink,  
the bug was only present in development version of OCaml 5.  
(Stephen Dolan, report by Andre Maroneze, review by Gabriel Scherer)

- [#11732](https://github.com/ocaml/ocaml/issues/11732): Ensure that types from packed modules are always generalised  
(Stephen Dolan and Leo White, review by Jacques Garrigue)

- [#11737](https://github.com/ocaml/ocaml/issues/11737): Fix segfault condition in Unix.stat under Windows in the presence of  
multiple threads.  
(Marc Lasson, Nicolás Ojeda Bär, review by Gabriel Scherer and David Allsopp)

- [#11776](https://github.com/ocaml/ocaml/issues/11776): Extend environment with functor parameters in `strengthen_lazy`.  
(Chris Casinghino and Luke Maurer, review by Gabriel Scherer)

- [#11533](https://github.com/ocaml/ocaml/issues/11533), [#11534](https://github.com/ocaml/ocaml/issues/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)

---

_[View the full topic](https://discuss.ocaml.org/t/ocaml-5-0-0-is-out/10974)._
