Dune 3.5.0

I'd like to announce the release of dune 3.5.0 on opam. This release is packed with fixes and new features, that are described below with a description of what this means for project maintainers.

See full changelog

dune executable

This lists features of the "dune" executable itself. Upgrading dune will bring in these changes. We consider these changes safe, but it is difficult to define what a breaking change is for a command-line tool (for example, some error messages change). It is important to note that just upgrading the dune executable is not supposed to change how dune interprets existing projects. If just upgrading dune breaks compilation, it is a bug in dune, please report it!

Added

  • Allow dune describe workspace to accept directories as arguments. The provided directories restrict the worskpace description to those directories. (#6107, fixes #3893, @esope)
  • Add a terminal persistence mode that attempts to clear the terminal history. It is enabled by setting terminal persistence to clear-on-rebuild-and-flush-history (#6065, @rgrinberg)

Fixed

  • Fix build-info version when used with flambda (#6089, fixes #6075, @jberdine)
  • Fix compilation of Dune under esy on Windows (#6109, fixes #6098, @nojb)
  • Improve error message when parsing several licenses in (license) (#6114, fixes #6103, @emillon)
  • Handle CSI n K code in ANSI escape codes from commands. (#6214, fixes #5528, @emillon)
  • Do not ignore rules marked (promote (until-clean)) when --ignore-promoted-rules (or -p) is passed. (#6010, fixes #4401, @emillon)

Changed

  • dune install: copy files in an atomic way (#6150, @emillon)
  • update vendored copy of cmdliner to 1.1.1. This improves the built-in documentation for command groups such as dune ocaml. (#6038, @emillon, #6169, @shonfeder)
  • Extend dune describe to include the root path of the workspace and the relative path to the build directory. (#6136, @reubenrowe)

macOS support

This is technically a subset of above section. For M1 mac users, dune 3.5.0 is the first version which will correctly support dune-build-info.

Added

  • on macOS, sign executables produced by artifact substitution (#6137, #6231, fixes #5650, fixes #6226, @emillon)
  • Enable file watching on MacOS SDK < 10.13. (#6218, @rgrinberg)

Fixed

  • macOS: Handle unknown fsevents without crashing (#6217, @rgrinberg)

(lang dune 3.5)

This lists changes if you opt into the new (lang dune 3.5) version in your dune-project file. For this too, these are changes that we consider safe, but they can require changes to your dune files. For example, sandboxing is enabled in more places, which means that you might have to be more precise in expressing your dependencies. Please reach out on the issue tracker if you have trouble fixing your dune file or if something does not seem to be possible anymore.

Added

  • Add a runtime_deps field in the cinaps stanza to specify runtime dependencies for running the cinaps preprocessing action (#6175, @rgrinberg)
  • Allow rules producing directory targets to be not sandboxed (#6056, @rgrinberg)
  • Introduce a dirs field in the install stanza to install entire directories (#5097, fixes #5059, @rgrinberg)
  • Add an (include <file>) term to the include_dirs field for adding directories to the include paths sourced from a file. (#6058, fixes #3993, @gridbugs)
  • Support (extra_objects ...) field in (executable ...) and (library ...) stanzas (#6084, fixes #4129, @gridbugs)
  • Allow rules producing directory targets to create symlinks (#6077, fixes #5945, @rgrinberg)
  • Added an (aliases ...) field to the (rules ...) stanza which allows the specification of multiple aliases per rule (#6194, @Alizter)
  • Allow include statement in install stanza (#6139, fixes #256, @gridbugs)
  • Add a new experimental feature mode_specific_stubs that allows the specification of different flags and sources for foreign stubs depending on the build mode (#5649, @voodoos)

Changed

  • Sandbox running cinaps actions starting from cinaps 1.1 (#6176, @rgrinberg)
  • Cinaps actions are now sandboxed by default (#6062, @rgrinberg)
  • Menhir rules are now sandboxed by default (#6076, @rgrinberg)
  • Inline tests are now sandboxed by default (#6079, @rgrinberg)

Fixed

  • Shadow alias module Foo__ when building a library Foo (#6126, @rgrinberg)
  • Disallow generating targets in sub direcories in inferred rules. The check to forbid this was accidentally done only for manually specified targets (#6031, @rgrinberg)
  • odoc rules now about ODOC_SYNTAX and will rerun accordingly (#6010, fixes #1117, @emillon)

Coq support

These changes, associated with (lang dune 3.5), are specific to coq.

Added

  • Add %{coq:...} macro for accessing data about the configuration about Coq. For instance %{coq:version} (#6049, @Alizter)
  • Starting with Coq build language 0.6, theories can be built without importing Coq's standard library by including (stdlib no). (#6165 #6164, fixes #6163, @ejgallego @Alizter @LasseBlaauwbroek)

Changed

  • Dune no longer considers .aux files as targets during Coq compilation. This means that .aux files are no longer cached. (#6024, fixes #6004, @alizter)
  • The test suite for Coq now requires Coq >= 8.16 due to changes in the plugin loading mechanism upstream (which now uses Findlib).
  • The (coq.theory ...) stanza will now ensure that for each declared (plugin ...), the META file for it is built before calling coqdep. This enables the use of the new Findlib-based loading method in Coq 8.16; however as of Coq 8.16.0, Coq itself has some bugs preventing this to work yet. (#6167 , workarounds #5767, @ejgallego)