Migrating OCaml.org to Use Dune (Developer Preview)

As part of the maintainers of the Dune Developer Preview, I will and try to expand a bit on @shonfeder answer.

Dune Developer Preview is a nightly build of Dune’s main branch with all the experimental Dune Package Management features activated by default. However, regarding package management itself, the small set of features needed to support building project with it is already in opam. You have access out-of-the-box to package management since dune.3.16.0 and to OCaml Toolchain (the possibility to install OCaml compilers) since dune.3.17.0.

The other package management features provided by the Dune developer preview are protected by compilation feature flags (and actionable at runtime with environment variables). They are experimental Dune features that we want users to test but that are not stable enough to land enabled in the opam version. It includes:

  • A change in the format of the build progress (cargo-like format), actionable by export DUNE_CONFIG__PKG_BUILD_PROGRESS=enabled,
  • The possibility of installing OCaml Platform Dev Tools, actionable by export DUNE_CONFIG__LOCK_DEV_TOOL=enabled and,
  • The new lockfiles format allowing developer to have their lockfiles portables between systems, actionable by export DUNE_CONFIG__PORTABLE_LOCK_DIRS=enabled. @gridbugs wrote a detailed post about it.

This flags are available in the FAQ section but I agree this is not clear and we should be more explicit about the experimental features :sweat_smile:

On the binary side, we are considering to build stable versions of the binaries so people can have a standalone binary of Dune.

You guessed well :smile: The new portable lockfiles describe above is currently under test and not available in the opam version. It will be available in dune.3.20.0 under the condition of setting the environment variable.

The stable format is supported by the developer preview but the developer preview format is not supported by the opam

Should OCaml.org use the old but not portable format?

2 Likes