Dune 3.24.0

The Dune team is pleased to announce the release of dune 3.24.0.

Highlights include the following

  • Dune package management now uses the relocatable compiler by default, for all supported compiler versions. This brings a massive speedup to workspace setup in the many cases where built compiler versions can be reused. (ocaml/dune#14357, @Alizter)
  • Directory targets are now generally available (ocaml/dune#14579), allowing tools to produce entire directory trees as targets. See the documentation on directory targets for details.
  • Path handling has been refined, improving the consistency of paths across platforms (ocaml/dune#14278 and ocaml/dune#14278) and using a more consistent and disciplined location for %{bin:NAME} variable expansions (ocaml/dune#14432).
  • Path-valued percent forms (%{bin:...}, %{dep:...}, %{path:...}, and friends) now expand same-directory paths with a leading ./, so that shells like bash in (bash ...) and (system ...) actions execute them directly instead of looking them up in PATH (ocaml/dune#15156). This is a breaking change for configurations that were handling paths naively, and neglected to normalize the representation before using it test fixtures or for constructing other strings.
  • The deprecated lang coq has been removed, as scheduled, superseded by lang rocq. See ocaml/dune#12788 for details.

See the full changelog for all new features and fixes, and for attribution to the contributors who made it all possible. Thank you, contributors!

If you encounter a problem with this release, please report it in our issue tracker.

See full changelog

Fixed

  • Fix promotion failure when a target changes from a directory to a file between builds, causing "Is a directory" errors. (#14371, fixes #5647, fixes #6575, @Alizter)
  • Make dune build @doc pick up an odoc installed via dune tools install odoc even without DUNE_CONFIG__LOCK_DEV_TOOL=enabled, mirroring how dune fmt consumes a locked ocamlformat (#14426, fixes #14235, @mt-caret)
  • Reject (package ...) inside a named dependency binding ((deps (:name (package foo)))). Previously this was silently accepted but %{name} would resolve to an empty path list. (#14499, @Alizter)
  • Fix incorrect dependency in the .cmxs build for libraries with mode-dependent foreign stubs: the rule depended on the byte stubs archive instead of the native one, so parallel builds could fail to find -l<lib>_stubs_native. (#14500, fixes #12964, @Alizter)
  • Fix dune build failing with "No rule found" when lock_dir paths in dune-workspace contain a subdirectory (e.g. (path sub/dune.lock)). (#14524, fixes #14523, @Alizter)
  • Artifact substitution repairs executable bit if it's not set correctly in the workspace (#14556, @rgrinberg)
  • Ignore EINVAL when accepting sockets on MacOS (#14612, fixes #12660, @rgrinberg)
  • Validate profile names. Profile names must be non-empty and can only contain letters, digits, _ and -. The name _ is reserved as a wildcard in (env ...) stanzas. (#14657, fixes #14630, @rlepigre)

Added

  • Add %{pkg:<package>:<section>:<path>} pform for resolving package install files. Works with workspace packages, lock-file packages, and installed packages. (#14200, fixes #14193, fixes #3378, @Alizter)
  • Enable the relocatable compiler by default for package management (#14357, fixes #14012, @Alizter)
  • Add changed source files to the build-start trace event for watch-mode restarts, showing the paths that triggered the rebuild (#14396, @rgrinberg)
  • Add dune's rusage information in start/finish build trace events (#14402, @rgrinberg)
  • Add a status message for RPC clients that manage to connect (#14424, @rgrinberg)
  • Allow blang expressions in the runtest_alias field in the cram stanza (#14425, @rgrinberg)
  • Extend the stat based cache to cache the contents of directories and not just source files (#14469, @rgrinberg).
  • Show the number of connected RPC clients in the watch mode status line (#14489, @rgrinberg)
  • Promote directory targets from experimental to generally available in 3.24 (#14579, @rgrinberg)

Changed

  • Use / as directory separator when appending local paths to external paths, making path construction consistent across platforms. (#14278, @Alizter)
  • On Windows, normalise process paths to \ before passing them to CreateProcessW so that programs which scan argv[0] (notably cmd.exe) do not misparse mixed separators. (#14278, @Alizter)
  • %{bin:NAME} now resolves to the build artifact path rather than the install staging path. Rules with %{bin:NAME} deps additionally get a per-rule .binaries directory prepended to the action's PATH, containing correctly-named symlinks for each declared bin pform dep. (#14432, fixes #3324, @Alizter)
  • Replace the Rocq language field (stdlib ...) with the presence-only field (no_corelib) in Rocq language 0.14. (#14452, fixes #14358, @Durbatuluk1701)
  • Throttle sandbox creation to 250 concurrent sandboxes. (#14464, @rgrinberg)
  • The package solver now uses cached revision store lookups for improved performance. (#14494, fixes #12637, @Alizter, @rgrinberg)
  • Remove the deprecated (lang coq) Coq Build Language. Use the Rocq Build Language ((using rocq <version>)) instead. Projects that still declare (using coq <version>) now get an error pointing them at Rocq. (#14525, fixes #12788, @Alizter)
  • Path-valued pforms (%{bin:...}, %{dep:...}, %{path:...}, and friends) now expand same-directory paths with a leading ./, so that shells like bash in (bash ...) and (system ...) actions execute them directly instead of looking them up in PATH. (#15156, fixes #15147, @Alizter)