OCaml 5.4.0 was released with labelled tuples, immutable arrays, atomic record fields, and new Pair, Pqueue, Repr, and Iarray modules. A new dune tools env command exports dev-tool environment variables, and opam install --depext-only now returns a non-zero exit code on package conflict.
Releases
- OCaml 5.4.0: Released 2025-10-09. Adds labelled tuples, immutable arrays, atomic record fields, and modules
Pair,Pqueue,Repr,Iarray. Release notes - opam-repository: OCaml 5.4.0 packages merged; trunk moves to
ocaml-variants.5.4.1+trunk. (#28683)
Fixes
- opam:
opam install --depext-onlynow returns a non-zero exit code on package conflict, fixing silent CI failures. (#6516) - opam:
opam install --deps-onlynow resolvespin-dependson simulated pins, restoring behaviour broken in 2.4. (#6611) - Dune pkg: Dev-tool and project builds share compiled package artifacts via a content-addressed directory, eliminating redundant rebuilds. (#12526)
Compatibility
Features
- Dune: New
dune tools envcommand prints shell-evaluablePATHand environment exports for installed dev tools. Intended use:eval $(dune tools env). (#12521) - Dune (OxCaml): New
(parameters p_intf q_intf ...)field in thelibrarystanza compiles each module with the corresponding-parameterflag. Requires the OxCaml compiler. (#12336) - opam:
opam optionnow allows modifyingdefault-invariantafter initialisation, removing the need to recreate a switch. (#6730) - OCaml (open PR): Typing recovery behind
-typing-recoveryflag allows the typer to report multiple errors per file. (#14241) - OCaml (open PR): Pipeline operator
x |> f ywould typecheck as(f y x)rather than((f y) x), avoiding extra closure allocations. (#14286)