Thanks to David's great work upstream, OCaml 5.5 will be relocatable. Older versions of the compiler also have backports living in a custom opam repository https://github.com/dra27/opam-repository/blob/relocatable/packages/relocatable-compiler/relocatable-compiler.5.4.1.20251109.1/opam.
Supporting the relocatable compiler in package management would mean we can move away from toolchains and build the compiler like a regular package allowing it to be cached.
The constant rebuilds of the toolchains have been a common pain-point for users and the main focus of alternative proposals such as #12179.
In order to use this work in Dune, we need to be able to detect when a given compiler is relocatable. Checking the compiler version for 5.5 is a good start, but for older versions living in David's opam repo we can also check if we are using the relocatable meta package.
For the relocatable compiler to be fully integrated in Dune we will need to do the following work:
🧱 Done
🚧 Work-in-progress (in priority order)
Thanks to David's great work upstream, OCaml 5.5 will be relocatable. Older versions of the compiler also have backports living in a custom opam repository https://github.com/dra27/opam-repository/blob/relocatable/packages/relocatable-compiler/relocatable-compiler.5.4.1.20251109.1/opam.
Supporting the relocatable compiler in package management would mean we can move away from toolchains and build the compiler like a regular package allowing it to be cached.
The constant rebuilds of the toolchains have been a common pain-point for users and the main focus of alternative proposals such as #12179.
In order to use this work in Dune, we need to be able to detect when a given compiler is relocatable. Checking the compiler version for 5.5 is a good start, but for older versions living in David's opam repo we can also check if we are using the
relocatablemeta package.For the relocatable compiler to be fully integrated in Dune we will need to do the following work:
🧱 Done
build-idwhich we have so-far avoided interpreting in dune.ocamlc -> ocamlc.opt, this is fine but will mean that Dune will refuse to cache the directory target.%{pkg:ocaml-system:installed?system}compilervariable generation in ocaml.5.5.0 opam-repository#29224installedvariable at solve time #13776OPAMSWITCHin dune when building compiler #13887🚧 Work-in-progress (in priority order)
overlay Add relocatable ocamlbuild.0.16.1, patched to remove a symlink ocaml-dune/opam-overlays#10