[ANN] dune 3.9.0

The Dune team is pleased to announce the release of Dune 3.9.0. It comes with
many new features, including:

  • a new dune show command to display various pieces of information.
  • some fixes in the dialect support that will make it easier to work with Dream’s eml files
  • a new (build_if) toggle in the (test) stanza which will help packaging nonportable tests and benchmarks.

Added

  • Include the time it takes to read/write state files when --trace-file is
    enabled (#7960, @rgrinberg)

  • Include source tree scans in the traces produced by --trace-file (#7937,
    @rgrinberg)

  • Add --all option to dune rpc status to show all Dune RPC servers running.
    (#8011, fix #7902, @Alizter)

  • Add additional metadata to the traces provided by --trace-file whenever
    --trace-extended is passed (#7778, @rleshchinskiy)

  • $ dune describe is now a command group, so arguments to subcommands must be
    passed after subcommand itself. (#7919, @Alizter)

  • Add dune show command group which is an alias of dune describe. (#7946,
    @Alizter)

  • Add dune show env command and make dune printenv an alias of it. (#7985,
    @Alizter)

  • Add commands dune show targets and dune show aliases that display all the
    available targets and aliases in a given directory respectively. (#7770,
    grants #265, @Alizter)

  • Extensions used in (dialect) can contain periods (e.g., cppo.ml). (#7782,
    fixes #7777, @nojb)

  • The interface and implementation fields of a (dialect) are now optional
    (#7757, @gpetiot)

  • Add (build_if) to the (test) stanza. When it evaluates to false, the
    executable is not built. (#7899, fixes #6938, @emillon)

  • Allow (include_subdirs qualified) to be used when libraries define a
    (modules ...) field (#7797, fixes #7597, @anmonteiro)

  • Allow multiple globs in library’s (stdlib (internal_modules ..))
    (@anmonteiro, #7878)

Changed

  • Do not re-run OCaml syntax files on every iteration of the watch mode. This
    is too memory consuming. (#7894, fix #6900, @rgrinberg)

  • Attach melange rules to the default alias (#7926, @haochenx)

  • Compute digests and manage sandboxes in background threads (#7947,
    @rgrinberg)

Fixed

  • Validate file extension for $ dune ocaml top-module. (#8005, fixes #8004,
    @3Rafal)

  • Cinaps: The promotion rules for cinaps would only offer one file at a time no
    matter how many promotions were available. Now we offer all the promotions at
    once (#7901, @rgrinberg)

  • Add necessary parentheses in generated opam constraints (#7682, fixes #3431,
    @Lucccyo)

Removed

  • Remove some compatibility code for old version of dune that generated
    .merlin files. Now dune will never remove .merlin files automatically
    (#7562)

  • In opam constraints, reject (and) and (or) with no arguments at parse
    time (#7730, @emillon)

14 Likes

Thank you to the Dune team for all your fantastic work.

For anyone using macOS there is a know bug with this version `dune` process hangs on macos · Issue #8083 · ocaml/dune · GitHub that you might want to hold off until it is fixed before upgrading.

3 Likes

To expand on that:

In Dune 3.9.0, we added a feature that offloads some computations to background threads. Unfortunately, this has a bad interaction on macOS, where we fork processes to implement the RPC server and watch mode.

We marked Dune 3.9.0 unavailable on macOS, and released 3.9.1 with some mitigations: we don’t offload these computations on macOS, and we only fork when necessary.

The plan for the next release is to stop forking processes on macOS.

The first alpha for Dune 3.10.0 is planned to happen around 2023-07-24T22:00:00Z.

Here’s the changelog for 3.9.1:

Fixes

  • Disable background operations and threaded console on MacOS and other Unixes where we rely on fork. (#8100, #8121, fixes #8083, @rgrinberg, @emillon)
  • Initialize async IO thread lazily. (#8122, @emillon)
2 Likes

We just released dune 3.9.2. This bugfix-only release contains two platform-specific changes: one fixes the Dune cache on Windows, and the other one completes the fix on Linux when sendfile is not available. This makes Dune available where user directories are encrypted using ecryptfs for example.

Fixes

  • Disable background digests on Windows. This prevents an issue where
    unremovable files would make dune crash when the shared cache is enabled.
    (#8243, fixes #8228, @emillon)

  • Fix permission errors when sendfile is not available (#8234, fixes #8210,
    @emillon)

4 Likes

And to conclude the 3.9.x series:

The fix to sendfile in 3.9.2 was not quite enough so here is the last part of the fix. It brings compatibility with filesystems where sendfile is not available, in particular when ecryptfs is used.

Fixes

  • Fix flushing when using sendfile fallback (#8288, fixes #8284, @alan-j-hu)
2 Likes