OCaml Changelog

RSS

Read the latest releases and updates from the OCaml compiler, OCaml infrastructure and the OCaml Platform Tools.

Dune 3.20.0

The Dune Team is happy to announce the release of Dune 3.20.0.

This release contains some important bug fixes. It contains new features for tests, such as the possibility to use an alias and the possibility to declare a timeout for cram tests. This release also provides new possibilities for the watch mode, like the ability to run an executable or promote files while the watch mode is running.

A significant change in this release is how the dune file formatter acts. It will now try to fill the line instead of using the vertical format.

See full changelog

Fixed

  • Stop re-running cram tests after promotion when it's not necessary (#11994, @rgrinberg)

  • fix: $ dune subst should not fail when adding the version field in opam files (#11801, fixes #11045, @btjorge)

  • Kill all processes in the process group after the main process has terminated; in particular this avoids background processes in cram tests to stick around after the test finished (#11841, fixes #11820, @Alizter, @Leonidas-from-XIV)

Added

  • (tests) stanzas now generate aliases with the test name. To run (test (name a)) you can do dune build @runtest-a. (#11558, grants part of #10239, @Alizter)

  • Inline test libraries now produce aliases runtest-name_of_lib allowing users to run specific inline tests as dune build @runtest-name_of_lib. (#11109, partially fixes #10239, @Alizter)

  • feature: $ dune subst use version from dune-project when no version control repository has been detected (#11801, @btjorge)

  • Allow dune exec to run concurrently with another instance of dune in watch mode (#11840, @gridbugs)

  • Introduce %{os}, %{os_version}, %{os_distribution}, and %{os_family} percent forms. These have the same values as their opam counterparts. (#11863, @rgrinberg)

  • Introduce option (implicit_transitive_deps false-if-hidden-includes-supported) that is equivalent to (implicit_transitive_deps false) when -H is supported by the compiler (OCaml >= 5.2) and equivalent to (implicit_transitive_deps true) otherwise. (#11866, fixes #11212, @nojb)

  • Add dune describe location for printing the path to the executable that would be run (#11905, @gridbugs)

  • dune runtest can now understand absolute paths as well as run tests in specific build contexts (#11936, @Alizter).

  • Added 'empty' alias which contains no targets. (#11556 #11952 #11955 #11956, grants #4161, @Alizter and @rgrinberg)

  • Allow dune promote to properly run while a watch mode server is running (#12010, @ElectreAAS)

  • Add --alias and --alias-rec flags as an alternative to the @@ and @ syntax in the command line (#12043, fixes #5775, @rgrinberg)

  • Added a (timeout <float>) field to the (cram) stanza to specify per-test time limits. Tests exceeding the timeout are terminated with an error. (#12041, @Alizter)

Changed

  • Format long lists in s-expressions to fill the line instead of formatting them in a vertical way (#10892, fixes #10860, @nojb)

  • Switch from MD5 to BLAKE3 for digesting targets and rules. BLAKE3 is both more performant and difficult to break than MD5 (#11735, @rgrinberg, @Alizter)

  • Print a warning when dune build runs over RPC (#11833, @gridbugs)

  • Stop emitting empty module group wrapper .js file in melange.emit (#11987, fixes #11986, @anmonteiro)

We released Dune 3.20.0_alpha1 as a minor alpha release that adds one new feature and fixes a documentation reference:

  • New Feature: Added timeout support for cram tests - you can now specify (timeout <float>) in cram stanzas to automatically terminate tests that run too long
  • Documentation Fix: Corrected a reference in the RPC warning changelog entry

This unstable alpha release builds on alpha0 with minimal changes focused on improving test reliability and documentation accuracy.

See full changelog

Differences Between alpha0 and alpha1:

Added in alpha1:

  • Added a (timeout <float>) field to the (cram) stanza to specify per-test
    time limits. Tests exceeding the timeout are terminated with an error.
    (#12041, @Alizter)

Reference Changes:

  • RPC warning entry changed from referencing issue #11836 in alpha0 to pull request #11833 in alpha1

Dune 3.20.0~alpha0 is now available with several user-facing improvements and fixes.

Summary of Changes

Testing improvements: Individual tests can now be run using named aliases (@runtest-<name>), dune runtest accepts absolute paths and can target specific build contexts, and cram tests have better process cleanup.

New command-line features: dune exec works concurrently with watch mode, dune promote runs while watch mode is active, dune describe location shows executable paths, and --alias/--alias-rec flags provide alternatives to @/@@ syntax.

New variables: Added %{os}, %{os_version}, %{os_distribution}, and %{os_family} variables matching opam equivalents.

Fixes: dune subst properly handles version fields in opam files and works when no version control is detected.

Under the hood: Switched from MD5 to BLAKE3 for better performance, improved s-expression formatting, and added smart handling of transitive dependencies based on compiler capabilities.

Installation

opam install dune.3.20.0~alpha0

This is an alpha release for testing. Report issues on GitHub.

See full changelog

Fixed

  • Stop re-running cram tests after promotion when it's not necessary (#11994,
    @rgrinberg)

  • fix: $ dune subst should not fail when adding the version field in opam
    files (#11801, fixes #11045, @btjorge)

  • Kill all processes in the process group after the main process has
    terminated; in particular this avoids background processes in cram tests to
    stick around after the test finished (#11841, fixes #11820, @Alizter,
    @Leonidas-from-XIV)

Added

  • (tests) stanzas now generate aliases with the test name. To run
    (test (name a)) you can do dune build @runtest-a. (#11558, grants part of #10239,
    @Alizter)

  • Inline test libraries now produce aliases runtest-name_of_lib
    allowing users to run specific inline tests as dune build @runtest-name_of_lib. (#11109, partially fixes #10239, @Alizter)

  • feature: $ dune subst use version from dune-project when no version
    control repository has been detected (#11801, @btjorge)

  • Allow dune exec to run concurrently with another instance of dune in watch
    mode (#11840, @gridbugs)

  • Introduce %{os}, %{os_version}, %{os_distribution}, and %{os_family}
    percent forms. These have the same values as their opam counterparts.
    (#11863, @rgrinberg)

  • Introduce option (implicit_transitive_deps false-if-hidden-includes-supported)
    that is equivalent to (implicit_transitive_deps false) when -H is
    supported by the compiler (OCaml >= 5.2) and equivalent to
    (implicit_transitive_deps true) otherwise. (#11866, fixes #11212, @nojb)

  • Add dune describe location for printing the path to the executable that
    would be run (#11905, @gridbugs)

  • dune runtest can now understand absolute paths as well as run tests in
    specific build contexts (#11936, @Alizter).

  • Added 'empty' alias which contains no targets. (#11556 #11952 #11955 #11956,
    grants #4161, @Alizter and @rgrinberg)

  • Allow dune promote to properly run while a watch mode server is running
    (#12010, @ElectreAAS)

  • Add --alias and --alias-rec flags as an alternative to the @ and @@
    syntax in the command line (#12043, fixes #5775, @rgrinberg)

Changed

  • Format long lists in s-expressions to fill the line instead of
    formatting them in a vertical way (#10892, fixes #10860, @nojb)

  • Switch from MD5 to BLAKE3 for digesting targets and rules. BLAKE3 is both more
    performant and difficult to break than MD5 (#11735, @rgrinberg, @Alizter)

  • Print a warning when dune build runs over RPC (#11836, @gridbugs)

  • Stop emitting empty module group wrapper .js file in melange.emit
    (#11987, fixes #11986, @anmonteiro)

Utop 2.16.0

We're happy to announce the release of Utop 2.16.0!

This utop release adds OCaml 5.4 support, restores backtrace functionality, improves preprocessor and Emacs integration, and relocates configuration files to a dedicated utop subdirectory.

See full changelog

opam 2.4.1

Feedback on this post is welcomed on Discuss!

We are pleased to announce the release of opam 2.4.1 fixing a regression affecting some uses of pin-depends, and encourage all users to upgrade. Please read on for installation and upgrade instructions.

Changes

  • Fix pin-depends being ignored with opam install --deps-only (#6610)

This release also extends the tests.

Try it!

The upgrade instructions are unchanged:

  1. Either from binaries: run

For Unix systems

bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.4.1"

or from PowerShell for Windows systems

Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) } -Version 2.4.1"

or download manually from the Github "Releases" page to your PATH.

  1. Or from source, manually: see the instructions in the README.

You should then run:

opam init --reinit -ni

Please report any issues to the bug-tracker.

Happy hacking!

opam 2.4.0

Feedback on this post is welcomed on Discuss!

We are extremely happy to announce the release of opam 2.4.0 and encourage all users to upgrade. Please read on for installation and upgrade instructions.

Try it!

The upgrade instructions are unchanged:

  1. Either from binaries: run

For Unix systems

bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.4.0"

or from PowerShell for Windows systems

Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) } -Version 2.4.0"

or download manually from the Github "Releases" page to your PATH.

  1. Or from source, manually: see the instructions in the README.

You should then run:

opam init --reinit -ni

Major changes

  • On opam init the compiler chosen for the default switch will no longer be ocaml-system (#3509) This was done because the system compiler (as-is your ocaml installed system wide, e.g. /usr/bin/ocaml) is known to be under-tested and prone to a variety of bugs and configuration issues. Removing it from the default compiler allows new-comers a more smooth experience. Note: if you wish to use it anyway, you are always able to do it explicitly using opam init --compiler=ocaml-system

  • GNU patch and the diff command are no longer runtime dependencies. Instead the OCaml patch library is used (#6019, #6052, #3782, ocaml/setup-ocaml#933) Doing this we've removed some rarely used features of GNU Patch such as the support of Context diffs. The new implementation only supports Unified diffs including the git extended headers, however file permission changes via said extended headers have no effect.

  • Add Nix support for external dependencies (depexts) by adding support for stateless package managers (#5982). Thanks to @RyanGibb for this contribution

  • Fix opam install <local_dir> with and without options like --deps-only or --show-action having unexpected behaviours (#6248, #5567) such as:

    • reporting Nothing to do despite dependencies or package not being up-to-date
    • asking to install the wrong dependencies
  • opam switch create [name] <version> will not include compiler packages flagged with avoid-version/deprecated in the generated invariant anymore, unless compiler flagged avoid-version/deprecated are the only ones available (#6494). This will allow opam to avoid the use of the ocaml-system package unless actually explicitly requested by the user. The opam experience when the ocaml-system compiler is used is known to be prone to a variety of bugs and configuration issues.

  • opam install --deps-only no longer requires unicity of package version between the request and the installed packages. In other words, if you have pkg.1 installed, installing the dependencies of pkg.2 no longer removes pkg.1 if the installed packages are compatible. This also allows to install dependencies of conflicting packages when their dependencies are compliant. (#6520)

UI changes

  • opam show now displays the version number of packages flagged with avoid-version/deprecated gray (#6354)

  • opam upgrade: Do not show the message about packages "not up-to-date" when the package is tagged with avoid-version/deprecated (#6271)

  • Fail when trying to pin a package whose definition could not be found instead of forcing interactive edition (e.g. this could happen when making a typo in the package name of a pin-depends) (#6322)

New commands / options

  • Add opam admin compare-versions to compare package versions for sanity checks. Thanks to @mbarbin for this contribution

  • Add opam lock --keep-local to keep local pins url in pin-depends field (#4897)

  • Add opam admin migrate-extrafiles which moves all extra-files of an existing opam repository into extra-sources. Thanks to @hannesm for this contribution

  • The -i/--ignore-test-doc argument has been removed from opam admin check (#6335)

Other noteworthy changes

  • opam pin/opam pin list now displays the current revision of a pinned repository in a new column. Thanks to @desumn for this contribution

  • The prebuilt Windows binary now includes Cygwin's setup-x86_64.exe in the binary itself as fallback in case cygwin.com is inaccessible (#6538). Opam will also no longer fail if cygwin.com is inaccessible when checking for upgrades of setup-x86_64.exe (#6495, partial fix for #6474)

  • Symlinks in repositories are no longer supported (#5892)

  • Fix sandboxing support in NixOS (#6333)

  • Add the OPAMSOLVERTOLERANCE environment variable to allow users to fix solver timeouts for good (#3230)

  • Fix a regression on opam upgrade <package> upgrading unrelated packages (#6373). Thanks to @AltGr for this contribution

  • Fix pin-depends for with-* dependencies when creating a lock file (#5428)

  • opam admin check now sets with-test and with-doc to false instead of true

  • Add apt-rpm/ALTLinux family support for depexts. Thanks to @RiderALT for this contribution

  • Remove handling of the OPAMSTATS environment variable (#6485). Thanks to @hannesm for this contribution

  • Fix the detection of installed external packages on OpenBSD to not just consider manually installed packages (#6362). Thanks to @semarie for this contribution

  • Disable the detection of available system packages on SUSE-based distributions (#6426)

And many other general, performance and UI improvements were made and bugs were fixed. You can take a look to previous blog posts. API changes and a more detailed description of the changes are listed in:

This release also includes PRs improving the documentation and improving and extending the tests.

Please report any issues to the bug-tracker.

We hope you will enjoy the new features of opam 2.4!


Special thanks to the whole haematology department of the NHS Greater Glasgow for making this release – in the state that it is – possible. Fighting cancer is not easy but it is much more bearable with great people <3

Odoc 3.1.0

We're excited to announce the release of odoc 3.1.0! This release brings several new features, important improvements, and bug fixes to OCaml's documentation generator.

What's New

OCaml 5.4.0 Compatibility

Full support for OCaml 5.4.0 has been added, ensuring odoc stays current with the latest OCaml releases.

New Output Formats and Options

  • Enhanced LaTeX Generator: New command-line arguments --shorten-beyond-depth and --remove-functor-arg-link provide more control over LaTeX output formatting

Key Improvements

Modernized Dependencies

The cmdliner compatibility layer has been removed as it's no longer needed, simplifying the codebase and reducing maintenance overhead.

Updated System Requirements

Support for OCaml versions prior to 4.08 has been dropped, allowing the project to leverage more modern language features and reduce compatibility complexity.

Better Configuration Management

Libraries from packages can now be referenced when added in odoc-config.sexp, improving flexibility in documentation project setup.

Improved LaTeX Output

  • Heading labels now use full paths to improve navigation and reference accuracy
  • Page and anchor separation in LaTeX labels prevents naming collisions

Bug Fixes

This release addresses several important issues:

  • Fixed META file parsing when dependencies are absent
  • Resolved rendering problems on medium screen sizes without global sidebar
  • Corrected occurrence generation for documentation CI systems
  • Ensured hidden pages never receive links, preventing broken references

Getting Started

To install odoc 3.1.0:

opam install odoc

For existing users, upgrade with:

opam upgrade odoc

Contributors

Special thanks to all contributors who made this release possible: @jonludlam, @Octachron, @davesnx, @dbuenzli, @panglesd, and @lukemaurer.

What's Next

We continue to work on expanding odoc's capabilities and improving documentation generation. The development team remains committed to making OCaml documentation more accessible and comprehensive.

Happy documenting!

See full changelog

### Added

Changed

Fixed

We're happy to announce the release of Ppxlib 0.36.1!

See full changelog
  • Fix ppxlib driver's AST to source printer. Our copy of pprintast was not properly updated which resulted in incorrect printing of value bindings' constraints (#585, @NathanReb)

This is the first release candidate of opam 2.4.0.

Binaries and full archive are signed by the opam dev team (fingerprint 92C5 26AE 50DF 3947 0EB2 911B ED4C F1CA 67CB AA92).

Please see our blog post for a highlight on the major changes and upgrade instructions.

See full changelog

Changes

  • Fix opam switch create <version> when all compilers of that version are flagged with avoid-version [#6571 @rjbou - fix #6563]
  • Opam update performance: No longer copy VCS directories when adding or updating local non-VCS repositories [#6575 @kit-ty-kate - fix #6560]
  • Do not remove the generated patch file during updates when debug-mode is on [#6575 @kit-ty-kate]

Release script

  • Switch the host of qemu-base-images from gitlab to github [#6510 @kit-ty-kate]
  • Speedup the initial clone of qemu-base-images when missing [#6510 @kit-ty-kate]
  • Update some of the platforms the prebuilt binaries are built on to Alpine 2.21, FreeBSD 14.3, OpenBSD 7.7 and NetBSD 10.1 [#6510 @kit-ty-kate]

Build changes

  • Use coreutils' sha512sum instead of perl's shasum utility when using ./configure --with-cygwin-setup [#6566 @kit-ty-kate - fix #6557]
  • Upgrade the download-if-missing dependencies to dune 3.19.1, opam-file-format 2.2.0, spdx_licenses 1.4.0 and patch 3.0.0 [#6580 @kit-ty-kate]

Testing and documentation

API updates

opam-format

opam-core

We're pleased to announce the release of OCaml LSP Server 1.23.0!

See full changelog

Features

  • Make inlay-hint for function parameters configurable (#1515)
  • Add custom ocamllsp/jumpToTypedHole to navigate through typed holes (#1516)
  • Add a code-action for combining pattern cases (just relaying on regex) (#1514)
  • Allow (by configuration) shortening of diagnostics (just highlighting the first line) (#1513)
  • Fix yojson_of_t for Nullable_option: serialize None as Null instead of asserting false (#1525 fixes #1524)

Fixes

  • Support for class, class type, method and property for DocumentSymbol query (#1487 fixes #1449)
  • Fix inlay-hint for function parameters (#1515)
  • More precise diagnostics in the event of a failed identifier search (Definition_query) (#1518)
  • Remove ocamlformat application after destruct (that remove some useful parenthesis) (#1519)

Merlin 5.5-503 is now available! This release addresses several long-standing issues with jump-to-definition, occurrences reporting, and inlay hints while adding new utilities for working with typed holes.

Key changes include enhanced locate functionality that can now disambiguate between files with identical names and contents, fixes to occurrences that properly report stale files, and corrected inlay hints on function parameters. The outline feature has been expanded to handle class types and locally defined values, with a new selection field that provides the exact location of symbols. Several jump-to-definition issues have been resolved, and the destruct feature no longer hangs when processing patterns with the cons operator (::).

The merlin library now exposes utilities for manipulating typed holes through Merlin_analysis.Typed_hole, and ocaml-index has improved performance through better granularity in index reading via segmented marshalization. This release also includes fixes for typer assertion failures and cache backtracking issues that were causing crashes in certain scenarios.

See full changelog
  • merlin library
    • Expose utilities to manipulate typed-holes in Merlin_analysis.Typed_hole
      (#1888)
    • locate can now disambiguate between files with identical names and contents
      (#1882)
    • occurrences now reports stale files (#1885)
    • inlay-hints fix inlay hints on function parameters (#1923)
    • Fix issues with ident validation and Lid comparison for occurrences (#1924)
    • Handle class type in outline (#1932)
    • Handle locally defined value in outline (#1936)
    • Fix a typer issue triggering assertions in the short-paths graph (#1935,
      fixes #1913)
    • Downstreamed a typer fix from 5.3.X that would trigger assertions linked
      to scopes bit masks when backtracking the typer cache (#1935)
    • Add a new selection field to outline results that contains the location of
      the symbol itself. (#1942)
    • Fix destruct hanging when printing patterns with (::). (#1944, fixes
      ocaml/ocaml-lsp#1489)
    • Reproduce and fix a handful of jump-to-definition (locate) issues (#1930,
      fixes #1580 and #1588, workaround for #1934)
  • ocaml-index
    • Improve the granularity of index reading by segmenting the marshalization
      of the involved data-structures. (#1889)
  • test suite
    • Add a test case illustrating wrong open order proposed in issue #1900. (#1901)

We're pleased to announce the release of OCaml LSP Server 1.21.0-4.14!

See full changelog

Features

  • Make inlay-hint for function parameters configurable (#1515)

  • Add custom ocamllsp/jumpToTypedHole to navigate through typed holes (#1516)

  • Add a code-action for combining pattern cases (just relaying on regex) (#1514)

  • Allow (by configuration) shortening of diagnostics (just highlighting the first line) (#1513)

  • Fix yojson_of_t for Nullable_option: serialize None as Null instead of asserting false (#1525 fixes #1524)

Fixes

  • Support for class, class type, method and property for DocumentSymbol query (#1487 fixes #1449)

  • Fix inlay-hint for function parameters (#1515)

  • More precise diagnostics in the event of a failed identifier search (Definition_query) (#1518)

  • Remove ocamlformat application after destruct (that remove some useful parenthesis) (#1519)

  • Add a new server option standardHover, that can be used by clients to
    disable the default hover provider. When standardHover = false
    textDocument/hover requests always returns with empty result. (#1416)

We are pleased to announce the release of Merlin 4.19-414!

See full changelog
  • merlin library
    • Expose utilities to manipulate typed-holes in Merlin_analysis.Typed_hole
      (#1888)
    • inlay-hints fix inlay hints on function parameters (#1923)
    • Handle class type in outline (#1932)
    • Handle locally defined value in outline (#1936)
  • vim plugin
    • Added support for search-by-type (#1846)
      This is exposed through the existing :MerlinSearch command, that
      switches between search-by-type and polarity search depending on the
      first character of the query.

This is the first beta release of opam 2.4.0.

Binaries and full archive are signed by the opam dev team (fingerprint 92C5 26AE 50DF 3947 0EB2 911B ED4C F1CA 67CB AA92).

Please see our blog post for a highlight on the major changes and upgrade instructions.

See full changelog

New option/command/subcommand are prefixed with â—ˆ.

Changes

Install of dependencies --deps-only

Behaviour

  • â—ˆ Change the behaviour of --deps-only, where it no longer requires unicity of package version between the request and the installed packages. In other words, if you have pkg.1 installed, installing dependencies of pkg.2 no longer removes pkg.1. This also allows to install dependencies of conflicting packages when their dependencies are compliant. [#6520 @rjbou]

Fixes

Fixed some bugs in opam install --deps-only (and other commands simulating package pins, such as --depext-only) more visible in 2.4:

  • When a package pkg is already installed and opam install ./pkg --deps is called, if there is a conflict between the installed pkg dependencies and the definition of the local pkg, the conflict was not seen and the already installed pkg was kept [#6530 @rjbou - fix #6529]
  • No longer fetch and write the sources when simulating packages that were already pinned [#6533 @rjbou - fix #6532]
  • opam was triggering the reinstall of the package based on the already pinned packages instead of the expected newly simulated pinned packages [#6522 @rjbou - partial fix #6501]
  • opam was using the opam description of the wrong package in some cases [#6544 @kit-ty-kate - fix #6535]

Reinstall

  • Fix a regression where the internal sources directory was removed unexpectedly on reinstall actions, making opam re-fetch the package [#6550 @rjbou - fix #6551]

Update

Fixed a couple of regressions in opam update:

  • An unexpected stack overflow exception was raised when updating repositories with large files when opam is compiled with OCaml < 5.1 [#6527 @kit-ty-kate - fix #6513]
  • Updating a repository where a line was added at the end of a file without final newline character was making the update fail [#6527 @kit-ty-kate - fix hannesm/patch#28]

Windows

  • Improve the prebuilt Windows binaries by including Cygwin's setup-x86_64.exe in the binary itself as fallback, in case cygwin.com is inaccessible [#6538 @kit-ty-kate]

Build changes

  • Bump the downloaded-if-missing dune to 3.19.0, cppo to 1.8.0, ocamlgraph to 2.2.0, uutf to 1.0.4 and patch to 3.0.0~beta1 [#6527 @kit-ty-kate]
  • Allows ./configure --without-dune to build with OCaml 5.4 [#6527 @kit-ty-kate]
  • Add a --with-cygwin-setup option to the configure script, only available on Windows and disabled by default, which includes the optionally given setup-x86_64.exe binary inside the opam binary. If the option is given without a filename, the file with be fetched from cygwin.com [#6526 @kit-ty-kate @dra27 @rjbou - fix #6498]

Testing and documentation

API updates

opam-client

  • OpamAction.cleanup_artefacts: no longer removes the internal sources directory if the package is installed but not pinned [#6550 @rjbou]

Dune 3.19.1

The Dune Team is happy to announce the release of Dune 3.19.1.

This patch release contains a fix reverting some regressions on how dune exec handles processes. It restores the previous behaviour.

See full changelog

Fixed

  • Revert changes in dune exec behaviour introduced in 3.19.0. (#11879, fixes #11870, #11867 and #11881, @Alizter)

Dune 3.19.0

The Dune Team is happy to announce the release of Dune 3.19.0.

This release contains some important fixes along with some improvements for the foreign_library stanza. It introduces support for concurrent builds through the RPC server.

See full changelog

Fixed

  • Fixed a bug that was causing cram tests attached to multiple aliases to be run multiple times. (#11547, @Alizter)

  • Fix: pass pkg-config (extra) args in all pkgconfig invocations. A missing --personality flag would result in pkgconf not finding libraries in some contexts. (#11619, @MisterDA)

  • Fix: Evaluate enabled_if when computing the stubs for stanzas such as foreign_library (#11707, @Alizter, @rgrinberg)

  • Fix $ dune describe pp for libraries in the presence of (include_subdirs unqualified) (#11729, fixes #10999, @rgrinberg)

  • Fix $ dune subst in sub directories of a git repository (#11760, fixes #11045, @Richard-Degenne)

  • Fix a crash involving Path.drop_prefix when using Melange on Windows (#11767, @nojb)

Added

  • Added detection and warning for common typos in package dependency constraints (#11600, fixes #11575, @kemsguy7)

  • Added (extra_objects) field to (foreign_library) stanza with (:include) support. (#11683, @Alizter)

Changed

  • Allow build RPC messages to be handled by dune's RPC server in eager watch mode (#11622, @gridbugs)

  • Allow concurrent build with RPC server (#11712, @gridbugs)

Dune 3.19.0~alpha0 is now available. This alpha release includes several bug fixes and new features for OCaml developers.

Bug Fixes

This release addresses several issues that affected build reliability and functionality:

  • Cram tests: Fixed duplicate execution of cram tests attached to multiple aliases
  • pkg-config integration: Resolved missing --personality flag in pkgconfig invocations that prevented library detection in certain contexts
  • Foreign libraries: Fixed evaluation of enabled_if conditions when computing stubs for foreign_library stanzas
  • Preprocessing: Corrected dune describe pp behavior for libraries using (include_subdirs unqualified)
  • Git integration: Fixed dune subst functionality in subdirectories of git repositories
  • Windows compatibility: Resolved crash in Path.drop_prefix when using Melange on Windows

New Features

  • Dependency validation: Added automatic detection and warnings for common typos in package dependency constraints
  • Foreign library support: Added (extra_objects) field to (foreign_library) stanza with (:include) support

Improvements

  • RPC server: Enhanced RPC server to handle build messages in eager watch mode and support concurrent builds

Installation

Install via opam:

opam install dune.3.19.0~alpha0

As this is an alpha release, please test thoroughly before using in production environments. Bug reports and feedback are welcome on the Dune issue tracker.

For the complete list of changes with pull request references, see the release notes.

See full changelog

Fixed

  • Fixed a bug that was causing cram tests attached to multiple aliases to be run multiple
    times. (#11547, @Alizter)

  • Fix: pass pkg-config (extra) args in all pkgconfig invocations. A missing --personality
    flag would result in pkgconf not finding libraries in some contexts. (#11619, @MisterDA)

  • Fix: Evaluate enabled_if when computing the stubs for stanzas such as
    foreign_library (#11707, @Alizter, @rgrinberg)

  • Fix $ dune describe pp for libraries in the presence of (include_subdirs unqualified) (#11729, fixes #10999, @rgrinberg)

  • Fix $ dune subst in sub directories of a git repository (#11760, fixes
    #11045, @Richard-Degenne)

  • Fix a crash involving Path.drop_prefix when using Melange on Windows
    (#11767, @nojb)

Added

  • Added detection and warning for common typos in package dependency
    constraints (#11600, fixes #11575, @kemsguy7)

  • Added (extra_objects) field to (foreign_library) stanza with (:include) support.
    (#11683, @Alizter)

Changed

  • Allow build RPC messages to be handled by dune's RPC server in eager watch
    mode (#11622, @gridbugs)

  • Allow concurrent build with RPC server (#11712, @gridbugs)

This is the second alpha release of opam 2.4.0.

Binaries and full archive are signed by the opam dev team (fingerprint 92C5 26AE 50DF 3947 0EB2 911B ED4C F1CA 67CB AA92).

Please see our blog post for a highlight on the major changes and upgrade instructions.

See full changelog

Changes

  • Do not include compiler packages flagged with avoid-version/deprecated in the generated invariant when calling opam switch create [name] <version> [#6494 @kit-ty-kate]
  • Cygwin: Fallback to the existing setup-x86_64.exe if its upgrade failed to be fetched [#6482 @kit-ty-kate - fix #6495, partial fix #6474]
  • Fix a memory leak happening when running large numbers of commands or opening large number of opam files [#6485 @hannesm - fix #6484]
  • Remove handling of the OPAMSTATS environment variable [#6485 @hannesm]

Regression fixes from 2.4.0~alpha1

  • Fix a crash when updating a repository that is deleting or adding empty files [#6490 @kit-ty-kate]
  • Fix an extreme performance issue (takes several hours) when applying a large repository update [#6490 @kit-ty-kate]
  • Fix a crash when updating a git repository that moved a file to a new directory [#6490 @kit-ty-kate]

Build changes

Testing and documentation

API updates

opam-core

  • OpamArg.environment_variable: make STATS as removed from cli 2.3 [#6485 @rjbou]
  • OpamClientConfig: remove STATS variant and related print_stats field in config record [#6485 @hannesm]

opam-format

opam-core

  • OpamSystem: remove print_stats function [#6485 @hannesm]
  • OpamSystem: add the rmdir_cleanup function [#6490 @kit-ty-kate]
  • OpamSystem.dir_is_empty: Speedup and change its type to handle unreachable directories better [#6490 @kit-ty-kate]
  • OpamSystem.internal_patch: remove parent directories when all of their content has been moved somewhere else [#6490 @kit-ty-kate]
  • OpamSystem.internal_patch: fix moving files to new directories when receiving a git diff [#6490 @kit-ty-kate]

Dune 3.18.2

The Dune Team is happy to announce the release of Dune 3.18.2.

This release contains a bug fix to fix a compatibility issue with ocaml.5.4.0.

See full changelog

Fixed

  • fix compatibility with ocaml.5.4.0 by avoiding shadowing sigwinch (@nojb, #11639)

This is the first alpha release of opam 2.4.0.

Binaries and full archive are signed by the opam dev team (fingerprint 92C5 26AE 50DF 3947 0EB2 911B ED4C F1CA 67CB AA92).

Please see our blog post for a highlight on the major changes and upgrade instructions.

See full changelog

Possibly scripts breaking changes are prefixed with ✘.
New option/command/subcommand are prefixed with â—ˆ.

Major changes

Init

  • Remove ocaml-system from the list of default compilers chosen at opam init time [#6307 @kit-ty-kate - fix #3509]

Patch: update & install

  • Patches are now applied using the patch OCaml library instead of GNU Patch [#5892 @kit-ty-kate - fix #6019 #6052 #3782 ocaml/setup-ocaml#933]
    • Context diffs are not supported anymore, only Unified diffs are (including its git extensions)
    • Stop support of file permission changes via git extension to the unified diff specification
    • GNU patch and the diff command are no longer runtime dependencies

Depexts

Show

  • opam show now displays the version number of packages flagged with avoid-version/deprecated gray [#6358 @kit-ty-kate - fix #6354]

Install

  • Fix opam install <local_dir> not updating or storing pinned packages' metadata [#6209 @kit-ty-kate - fix #5567]
  • Fix opam install --deps-only/--show-action <local_dir> not updating (without storing) pinned packages' metadata [#6209 @kit-ty-kate - fix #5567]

Pin

  • ✘ Fail when trying to pin a package whose definition could not be found instead of forcing interactive edition (e.g. this could happen when making a typo in the package name of a pin-depends) [#6319 @kit-ty-kate - fix #6322]
  • â—ˆ opam pin/opam pin list now displays the current revision of a pinned repository in a new column [#6274 @desumn - fix #5533]

Admin

  • â—ˆ Add opam admin compare-versions to compare package versions for sanity checks [#6197 @mbarbin]
  • â—ˆ Add opam admin migrate-extrafiles which moves all extra-files of an existing opam repository into extra-sources [#5960 @hannesm @rjbou @kit-ty-kate]
  • ✘ The -i/--ignore-test-doc argument has been removed from opam admin check [#6335 @kit-ty-kate]
  • ✘ opam admin check now sets with-test and with-doc to false instead of true [#6335 @kit-ty-kate]

Miscellaneous changes

Global CLI

Install

  • Remove the build directories of pinned packages after successful builds [#6436 @kit-ty-kate]

UI

Switch

  • Fix opam switch remove <dir> failure when it is a linked switch [#6276 @btjorge - fix #6275]
  • Fix opam switch list-available when given several arguments [#6318 @kit-ty-kate]
  • Correctly handle pkg.version pattern in opam switch list-available [#6186 @arozovyk - fix #6152]

Upgrade

  • Do not show the not-up-to-date message with packages tagged with avoid-version/deprecated [#6273 @kit-ty-kate - fix #6271]
  • Fix a regression on opam upgrade <package> upgrading unrelated packages [#6373 @AltGr]
  • Fix a regression on opam upgrade --all <uninstalled-pkg> not upgrading the whole switch [#6373 @kit-ty-kate]

Source

  • â—ˆ Add options --require-checksums and --no-checksums to harmonise with opam install [#5563 @rjbou]

Lint

  • â—ˆ Add W74 to opam lint to detect pin-depends packages that are neither present in the depends no depopts field [#6317 @rjbou - fix #5795]
  • â—ˆ Add E63 to opam lint to check for availability guard in case an opam file contains a subpath field [#6438 @rjbou @kit-ty-kate]

Lock

  • Fix pin-depends for with-* dependencies when creating a lock file [#5471 @rjbou - fix #5428]
  • â—ˆ Add opam lock --keep-local to keep local pins url in pin-depends field [#6411 @rjbou - fix #4897]

Env

  • Add the OPAMSOLVERTOLERANCE environment variable to allow users to fix solver timeouts for good [#5510 @kit-ty-kate - fix #3230]
  • Don't write empty environment update segments to variables.sh (FOO += "" no longer adds FOO='':"$FOO"; export FOO;) [#6198 @dra27]

Sandbox

Software Heritage

  • Rework Software heritage fallback to have a more correct archive retrieval and more fine grained error handling [#6036 @rjbou - fix #5721]
  • Fix Software Heritage liveness check [#6036 @rjbou - fix #5721]
  • Update the Software Heritage API requests [#6036 @rjbou]
  • Remove wget support for Software Heritage fallback [#6036 @rjbou - fix #5721]

Repository

  • Fix curl download command selection when loaded from global config file [#6302 @rjbou]
  • Check that the repositories given to opam repository remove actually exist [#5014 @kit-ty-kate - fixes #5012]
  • ✘ Symlinks in repositories are no longer supported [#5892 @kit-ty-kate]
  • Fix subpath handling in opam files defining a local archive [#6439 @rjbou]

Init

External dependencies (depexts)

  • â—ˆ Add apt-rpm/ALTLinux family support for depexts [#6207 @RiderALT]
  • Fix the detection of installed external packages on OpenBSD to not just consider manually installed packages [#6362 @semarie]
  • Speedup the detection of available system packages with pacman and brew [#6324 @kit-ty-kate]
  • Change probing tool for SUSE-based distributions from zypper to rpm [#6464 @kit-ty-kate]
  • Disable the detection of available system packages on SUSE-based distributions [#6464 @kit-ty-kate]
  • Add support for stateless depexts systems, by keeping synchronised already installed systems dependencies with switch state [#5982 @RyanGibb @rjbou @kit-ty-kate]

Pin

Build changes

  • Simplify the making of stripped binaries by introducing the make opam-stripped target [#6208 @kit-ty-kate]
  • Fix compilation on macOS with OCaml 5.3 by bumping the downloaded-if-missing mccs to 1.1+19 [#6192 @kit-ty-kate]
  • Upgrade the downloaded-if-missing opam-file-format to 2.2.0~alpha1, spdx_licenses to 1.3.0 and dune to 3.16.1 [#6321 #6370 #6192 @kit-ty-kate - fix #6369]
  • menhir is now part of the transitive dependency of opam (via opam-file-format) [#6321 @kit-ty-kate]

Admin

Download

  • Add fetch on DragonFlyBSD and ftp on NetBSD to the list of download tools to use, if available [#6304 #6305 @kit-ty-kate]
  • Prefer curl over any other download tools on every systems, if available [#6305 @kit-ty-kate]
  • Avoid issues when using wget2 as download-tool where the requested url might return an HTML page instead of the expected content [#6303 @kit-ty-kate]

Internal

  • Allow running some opam commands on machines with limited amount of memory by running Gc.compact while the main process is waiting for the children processes [#5396 @kkeundotnet]
  • Use a C stub to call the uname function from the C standard library instead of calling the uname POSIX command [#6217 @kit-ty-kate]
  • Only download Cygwin's setup.exe when the command is actually going to be displayed or used [#6467 @kit-ty-kate]

Testing and documentation

API updates

opam-client

  • OpamAction.prepare_package_build: now returns exn option instead of exn option OpamProcess.job and no longer calls the system GNU Patch [#5892 @kit-ty-kate]
  • OpamArg.InvalidCLI: export exception [#6150 @rjbou]
  • OpamArg.hash_kinds: was added [#5960 @kit-ty-kate]
  • OpamArg: export require_checksums and no_checksums, that are shared with build_options [#5563 @rjbou]
  • OpamAuxCommands.{simulate_autopin,autopin ~simulate:true}: now updates the reinstall field of the returned switch_state if necessary [#6209 @kit-ty-kate]
  • OpamLockCommand.lock_opam: add ~keep_local argument to add local pins to pin-depends (and not resolve them) [#6411 @rjbou]
  • OpamLockCommand.lock_opam: make the ?only_direct argument non-optional [#6411 @kit-ty-kate]
  • OpamRepositoryCommand.switch_repos: expose the function [#5014 @kit-ty-kate]
  • OpamSolution.install_depexts: instead of the package set of new package to install, now takes 2 labelled arguments pkg_to_install and pkg_installed to be able to keep synchronised stateless depext systems [#5982 @rjbou @RyanGibb @kit-ty-kate]
  • OpamSolution.install_sys_packages: no longer takes set of package to install but OpamSysPkg.to_install [#5982 @rjbou @RyanGibb @kit-ty-kate]
  • OpamSolution.print_depext_msg: takes now an OpamSysPkg.status instead of sets [#5982 @kit-ty-kate @RyanGibb]

opam-repository

  • OpamDownload.download: more fine grained HTTP request error code detection for curl [#6036 @rjbou]
  • OpamDownload.get_output: fix wget option for POST requests [#6036 @rjbou]
  • OpamDownload.get_output: use long form for curl POST request option [#6036 @rjbou]
  • OpamLocal.pull_url: fix subpath handling when the url is a local archive [#6439 @rjbou]
  • OpamRepository.revision: now returns a string instead of a version [#6409 @kit-ty-kate]
  • OpamRepositoryBackend.S.revision: now returns a string instead of a version [#6409 @kit-ty-kate]
  • OpamRepositoryBackend.get_diff: now raises Stdlib.Failure if an unsupported file type or comparison is detected [#5892 @kit-ty-kate]
  • OpamRepositoryBackend.get_diff: now returns exn option instead of exn option OpamProcess.job and no longer calls the system diff utility [#5892 @kit-ty-kate]

opam-state

  • OpamStateConfig: Make the ?lock_kind parameters non-optional to avoid breaking the library users after they upgrade their opam root [#5488 @kit-ty-kate]
  • OpamSwitchState.load_selections: Make the ?lock_kind parameter non-optional to avoid breaking the library users after they upgrade their opam root [#5488 @kit-ty-kate]
  • OpamSysInteract.Cygwin.check_setup: unexpose the function [#6467 @kit-ty-kate]
  • OpamSysInteract.package_manager_name: no longer build the command, or run an action to retrieve system package manager name [#5982 @rjbou]
  • OpamSysInteract.package_status: SUSE-based distributions now uses rpm instead of zypper and no longer return an available set of system packages [#6464 @kit-ty-kate]
  • OpamSysInteract.packages_status: returns now a OpamSysPkg.status instead of sets [#5982 @kit-ty-kate @RyanGib]
  • OpamSysInteract.{install_packages_commands,install}: no longer takes set of package to install but OpamSysPkg.to_install` [#5982 @rjbou @RyanGibb @kit-ty-kate]
  • OpamSysInteract.{install_packages_commands,install}: takes a new argument, a switch stat option, for stateless systems that need to write on switch [#5982 @RyanGibb @rjbou]
  • OpamSysInteract: add stateless_install that return if system package manager is stateless one (per switch) [#5982 @rjbou]

opam-format

  • OpamFile.OPAM.{*read*,write*}: Stop modifying the available field when handling the builtin x-* fields [#6438 @kit-ty-kate]
  • OpamFile.Repos_config.t: change the type to not allow repositories without an URL [#6249 @kit-ty-kate]
  • OpamFormula.all_relop: a list of all operators [#6197 @mbarbin]
  • OpamFormula.string_of_relop: export function [#6197 @mbarbin]
  • OpamPath: add nix_env inner switch path for nix environment [#5982 @RyanGibb]
  • OpamSysPkg; add new type to_install to store system package to install information, newly requested ones and already installed required ones ; and its empty recode to_install_empty and display function string_of_to_install [#5982 @rjbou]

opam-core

  • OpamConsole.pause: Ensure the function always prints a newline character at the end [#6376 @kit-ty-kate]
  • OpamConsole: Replace black text style (unused and not very readable) by gray [#6358 @kit-ty-kate]
  • OpamFilename.patch: a named-parameter ~allow_unclean was added [#5892 @kit-ty-kate]
  • OpamFilename.patch: now returns exn option instead of exn option OpamProcess.job and no longer calls the system GNU Patch [#5892 @kit-ty-kate]
  • OpamHash.all_kinds: was added, which returns the list of all possible values of OpamHash.kind [#5960 @kit-ty-kate]
  • OpamParallel.*.{map,reduce,iter}: Run Gc.compact when the main process is waiting for the children processes for the first time [#5396 @kkeundotnet]
  • OpamStd.List.split: Improve performance [#6210 @kit-ty-kate]
  • OpamStd.Option.equal_some: was added, which tests equality of an option with a value [#6381 @kit-ty-kate]
  • OpamStd.Sys.get_freebsd_version: was added, which returns the output of the uname -U command [#6217 @kit-ty-kate]
  • OpamStd.Sys.get_long_bit: was added, which returns the output of the getconf LONG_BIT command [#6217 @kit-ty-kate]
  • OpamStd.Sys.getconf: was removed, replaced by get_long_bit [#6217 @kit-ty-kate]
  • OpamStd.Sys.uname: now returns the memoized result of the uname function from the C standard library [#6217 @kit-ty-kate]
  • OpamSystem.get_files: was exposed which returns the list of files (without prefix) inside the given directory [#5892 @kit-ty-kate]
  • OpamSystem.patch: a named-parameter ~allow_unclean was added [#5892 @kit-ty-kate]
  • OpamSystem.patch: do not remove the original patch file if called with ~preprocess:false [#5892 @kit-ty-kate]
  • OpamSystem.patch: now returns exn option instead of exn option OpamProcess.job and no longer calls the system GNU Patch [#5892 @kit-ty-kate]
  • OpamSystem.remove_dir: do not fail with an exception when directory is a symbolic link [#6276 @btjorge @rjbou - fix #6275]
  • OpamSystem, OpamFilename: add with_tmp_file and with_tmp_file_job function, that create a file name in temporary directory and removes it at the end of the call [#6036 @rjbou]

Dune 3.18.1

The Dune Team is happy to announce the release of Dune 3.18.1!

This release contains a bug fix for pkg-config that prevents it from finding some libraries in specific contexts.

See full changelog

Fixed

  • fix: pass pkg-config (extra) args in all pkgconfig invocations. A missing --personality flag would result in pkgconf not finding libraries in some contexts. (#11619, @MisterDA)

Dune 3.18.0

The Dune Team is happy to announce the release of Dune 3.18.0!

This release contains changes to support the new x-maintenance-intent field by default. It also contains some changes regarding the cache about how it handles file permissions. It introduces a new (format-dune-file ...) stanza with the intention to formalize the dune format-dune-file command as an inside rule. Finally, it includes various bug fixes for Dune.

See full changelog

Fixed

  • Support HaikuOS: don't call execve since it's not allowed if other pthreads have been created. The fact that Haiku can't call execve from other threads than the principal thread of a process (a team in haiku jargon), is a discrepancy to POSIX and hence there is a bug about it. (@Sylvain78, #10953)

  • Fix flag ordering in generated Merlin configurations (#11503, @voodoos, fixes ocaml/merlin#1900, reported by @vouillon)

Added

  • Add (format-dune-file <src> <dst>) action. It provides a replacement to dune format-dune-file command. (#11166, @nojb)

  • Allow the --prefix flag when configuring dune with ocaml configure.ml. This allows to set the prefix just like $ dune install --prefix. (#11172, @rgrinberg)

  • Allow arguments starting with + in preprocessing definitions (starting with (lang dune 3.18)). (@amonteiro, #11234)

  • Support for opam (maintenance_intent ...) in dune-project (#11274, @art-w)

  • Validate opam maintenance_intent (#11308, @art-w)

  • Support not in package dependencies constraints (#11404, @art-w, reported by @hannesm)

Changed

  • Warn when failing to discover root due to reads failing. The previous behavior was to abort. (@KoviRobi, #11173)

  • Use shorter path for inline-tests artifacts. (@hhugo, #11307)

  • Allow dash in dune init project name (#11402, @art-w, reported by @saroupille)

  • On Windows, under heavy load, file delete operations can sometimes fail due to AV programs, etc. Guard against it by retrying the operation up to 30x with a 1s waiting gap (#11437, fixes #11425, @MSoegtropIMC)

  • Cache: we now only store the executable permission bit for files (#11541, fixes #11533, @ElectreAAS)

  • Display negative error codes on Windows in hex which is the more customary way to display NTSTATUS codes (#11504, @MisterDA)

Odoc 3.0.0

We are delighted to announce the release of Odoc 3! This is a big release with loads of new features and bug fixes, and we encourage everyone to install it and try the new features!

This release has been cooking for a long time - it’s been more than a year since odoc 2.4 landed, and a huge amount of work has gone into this. Thanks to the many others who contributed, either by code or by comments: @juloo, @panglesd, @EmileTrotignon, @gpetiot, @trefis, @sabine, @dbuenzli, @yawaramin, and more.

Here is an overview of some major new features:

  • Search by type! Our detective sherlodoc will find your lost value given its type.
  • Odoc 3 features a global sidebar, allowing you to discover all documentation pages
  • The generated documentation include the source code. You can jump from any item in the documentation straight to its rendered source; no matter how much of OCaml’s complex module system you are using.
  • You can now add images to your documentation, as well as video and audio files Hierarchical documentation pages allow you to structure your documentation better
  • Reference items from other packages! With the ability to use cross-package links in your documentation, the generated documentation is now truly connected.
  • The build dependencies are friendlier with incremental build systems, allowing better shared build caches

With this release we’re including a driver that makes use of all the exciting new features of odoc. This driver has been used to create the docs site for the various odoc tools. However, Dune does not yet support odoc 3 since the Dune rules for running odoc via Dune need to be rewritten to reflect the odoc's new CLI and the new incremental build related capabilities odoc 3 brings.

Until Dune supports odoc 3, here is how to get started:

$ opam install odoc-driver # will install odoc 3
$ odoc_driver odoc odoc-parser odoc-driver odoc-md sherlodoc --remap

and point your browser at _html/index.html. This example shows odoc_driver creating the docs for exactly the 5 packages specified. While doing so, it will remap links to other packages to instead link to their documentation page hosted on ocaml.org (see "Remapping dependencies" in the odoc documentation).

If you try the above command, you'll note something interesting, and hopefully this will encourage you to run odoc_driver on your own packages before you release them, as then you'll be able to avoid slightly embarrassing post-release fixes like this one 😬

See full changelog

Added

  • Add png, pdf and jpeg image support to the latex backend by Octachron · Pull Request #1297 · ocaml/odoc · GitHub
  • Add header field to the json output by panglesd · Pull Request #1314 · ocaml/odoc · GitHub
  • Extract code blocks by name by panglesd · Pull Request #1326 · ocaml/odoc · GitHub

Changed

  • Fix suppress_warnings parameter by jonludlam · Pull Request #1304 · ocaml/odoc · GitHub
  • Fix suppress_warnings parameter by jonludlam · Pull Request #1304 · ocaml/odoc · GitHub
  • Disable warnings coming from linking implementations by jonludlam · Pull Request #1319 · ocaml/odoc · GitHub
  • Driver compile warnings by jonludlam · Pull Request #1323 · ocaml/odoc · GitHub
  • Fix "box model" for code blocks by panglesd · Pull Request #1317 · ocaml/odoc · GitHub
  • Store raw content of code blocks in parser's AST by panglesd · Pull Request #1325 · ocaml/odoc · GitHub

Fixed

  • Fix suppress_warnings parameter by jonludlam · Pull Request #1304 · ocaml/odoc · GitHub
  • Don't backtrace on invalid input in compile-deps by jonludlam · Pull Request #1313 · ocaml/odoc · GitHub
  • Fix indentation bug with verbatim in tags by jonludlam · Pull Request #1312 · ocaml/odoc · GitHub
  • Driver: Check for missing/unknown opam packages by jonludlam · Pull Request #1311 · ocaml/odoc · GitHub
  • Fix suppress_warnings parameter by jonludlam · Pull Request #1304 · ocaml/odoc · GitHub
  • Further fixes for virtual libraries by jonludlam · Pull Request #1309 · ocaml/odoc · GitHub
  • Fix issue #610 - odoc html-fragment not producing headings correctly by jonludlam · Pull Request #1306 · ocaml/odoc · GitHub
  • Fix classify when there are archives sharing modules by jonludlam · Pull Request #1310 · ocaml/odoc · GitHub

We are happy to announce the release of ppxlib.0.36.0!

With this release, the internal AST that ppxlib targets has been bumped to the AST of OCaml 5.2. Ppx authors can now use features from OCaml 5.2. Ppxlib still supports any OCaml compiler after and including 4.08.0.

Many ppxes will be broken by changes made to the representation of functions. Authors are encouraged to read the upgrade guide.

See full changelog
  • Change Location.none to match the compiler's Location.none as of OCaml 4.08. This fixes a bug in loc_of_attribute (#540, @ncik-roberts, @patricoferris)

  • Bump ppxlib's AST to 5.2.0 (#514, @patricoferris)

  • Add the [@@@expand_inline] transformation and support for floating attribute context free transformations. (#560, @jaymody)

  • Add a -raise-embedded-errors flag to the driver. Setting this flag raises the first ocaml.error embedded in the final AST.

  • Export Ast_pattern.fail. (#563, @ceastlund)

  • Make Ast_traverse.sexp_of more concise, and add a test. (#561, @ceastlund)

We are happy to announce the release of ppxlib.0.35.0!

The main feature of this release is improved support for OCaml 5.3, allowing ppx users to have ppx rewriters operate on files with the new effect syntax.

Note that ppx-es and the effect syntax can cohabit but it is possible that ppx rewriters will error out if they encounter effect syntax node in their extension's payload or in the items they generate code from.

This feature also comes with a new --use-compiler-pp driver flag. This flag is required to preserve the effect syntax when the ppxlib driver outputs source code instead of marshalled AST. Note that the vast majority of users won't need to use this flag but it can come in handy in some more advanced use cases.

See full changelog
  • Allow use of effect syntax in preprocessed files without causing migration failures. (#552, @hhugo, @NathanReb)

  • Remove support for compilers older than 4.08 (#556, @NathanReb)

  • Add a --use-compiler-pp flag to the standalone driver. This flag can be set when the driver outputs source code to make it use the compiler's Pprintast instead of ppxlib's. (#555, @NathanReb)

Dune-release 2.1.0 has been released!

With this update,

  • A new commanddune-release delegate-info version has been added, which shows the current version of the package, as inferred by dune-release.
  • The dev-repo field in the .opam file can now be overridden using the --dev-repo flag on the commands dune-release and dune-release publish.
  • A bug related to decoding GitHub URLs has been fixed (FIXME:explain context and what's working now that wasn't before)
  • dune-release no longer publishes docs to github pages. This choice has been made because, as a consequence of publishing to opam-repository, the package documentation is built and served by ocaml.org/packages.
  • dune-release now works with the experimental package management feature from Dune Developer Preview.
See full changelog

Added

  • Add dune-release delegate-info version to show the current version as infered by the tool (#495, @samoht)
  • Add --dev-repo to dune-release and dune-release publish to overwrite the dev-repo field specified in the opam file (#494, @samoht)

Changed

  • Use the 'user' option as the fork owner, only attempt to decode the remote URL if the user option is not set. (#480, @Julow)

Fixed

  • Make dune-release not fail in the presence of ~/.dune/bin/dune (which is present when using dune package management)

Removed

  • dune-release no longer publishes docs to github pages. Instead, we rely on the docs published under ocaml.org/packages (#499 #500, @v-gb @samoht)

You can comment on this post on discuss.ocaml.org!

On behalf of the odoc team, I’m thrilled the announce the release of odoc 3.0.0 beta 1!

This release has been cooking for a long time - it’s been more than a year since odoc 2.4 landed, and a huge amount of work has gone into this. Thanks to the many others who contributed, either by code or by comments: @juloo, @panglesd, @EmileTrotignon, @gpetiot, @trefis, @sabine, @dbuenzli, @yawaramin, and more.

With this release we’re including a driver that knows how to use all of the exciting new features of odoc. This driver has been used to create the docs site for the various odoc tools.

Here are a selected set of features:

  • Rendered source! Jump from any item in the documentation straight to its rendered source; no matter how much of OCaml’s complex module system you are using.
  • Search by type! Our detective sherlodoc will find your lost value given its type.
  • Convenient warnings! Warnings are now clearly visible and useful, no longer buried among your dependencies’ warnings.
  • Self host your documentation, but link to ocaml.org for your dependencies.
  • More sidebars! Odoc 3 features a global sidebar, allowing you to discover the most hidden corner of underground documentation.
  • Image support! This cutting-edge feature now allows you to add images to your documentation. Video and audio come for free.
  • Fully cross-package links! The OCaml docs are now a true spider web. Prepare to catch bugs, and eat them.
  • Hierarchical documentation pages! We use a modular language. We don’t want a flat namespace for pages.
  • The build dependencies are friendlier with incremental build systems, allowing better shared build caches.
  • Quality of life improvements! Many improvements have been piling up since we started odoc 3. For instance: Add clock emoji before @since tag (@yawaramin, #1089)!

More explanation of these features is available at the odoc site, where we have documentation for authors, for users of odoc_driver, a cheatsheet, and differences from ocamldoc.

How can you help?

We need your feedback, both as authors and as users of documentation! Try things out using the new driver:

$ opam install odoc-driver    # don't forget to `opam update`
$ odoc_driver <package list>  # For instance: `$ odoc_driver brr odoc`
$ $YOUR_BROWSER _html/index.html

Many of those features’ implementations are not set in stone, but first versions. Please leave comments, either in this thread or as issues in the repository.

So, navigate already written documentation, and update your own docs to use the new features!

See full changelog

Highlight

  • Hierarchical documentation (@jonludlam, @panglesd, @Julow)
    Pages can now be organized in a directory tree structure.
    Relative and absolute references are added:
    {!./other_page.label}, {!//other_page}.

  • Improved sidebar and breadcrumbs navigation (@panglesd, @gpetiot)
    The documentation pages and the libraries of the entire package are shown on
    the left sidebar.

  • Added support for images, videos, audio and other assets
    The syntax is {image!/reference/to/asset} or {image:URL} for images.
    The syntax for {video...} and {audio...} is the same.
    (@panglesd, @EmileTrotignon, #1170, #1171, #1184, #1185)

  • Search using Sherlodoc (@panglesd, @EmileTrotignon, @Julow)
    A new search bar that supports full-text and type-based search.

Added

  • Experimental driver (@jonludlam, @panglesd)
    The driver builds the documentation for a collection of Opam packages using
    the newer Odoc features. It supports linking external packages to ocaml.org
    and markdown files.
    This is experimental and will break in the future.

  • Cross-package references (@panglesd, @Julow)
    Pages and modules from other packages can be referenced:
    {!/otherpackage/page}, {!/otherpackage/Module.t}.

  • Option to remap links to other packages to ocaml.org or other site.
    See the --remap option of the driver or the --remap-file option of odoc html-generate.
    (@jonludlam, #1189, #1248)

  • Option to compute occurrences of use of each identifiers
    The commands aggregate-occurrences and count-occurrences are added.
    (@panglesd, #976, #1076, #1206)

  • Added the odoc classify command (@jonludlam, #1121)
    Helps driver detecting which modules belong to which libraries.

  • Added --suppress-warnings to the CLI to remove warnings from a unit, even
    if they end up being raised in another unit through expansion
    (@jonludlam, #1260)

  • Add clock emoji before @since tag (@yawaramin, #1089)

  • Navigation for the search bar : use '/' to enter search, up and down arrows to
    select a result, and enter to follow the selected link. (@EmileTrotignon, #1088)

  • Fix a big gap between the preamble and the content of a page (@EmileTrotignon, #1147)

  • Add a marshalled search index consumable by sherlodoc (@EmileTrotignon, @panglesd, #1084)

  • Allow referencing of polymorphic constructors in polymorphic variant type
    aliases (@panglesd, #1115)

  • Added a home icon in the breacrumbs (@panglesd, #1251)
    It can be disabled with a CLI option.

  • Add a frontmatter syntax for mld pages (@panglesd, #1187, #1193, #1243, #1246, #1251)
    Allows to specify the title of a page, the order of sub-pages and other
    behaviors in the sidebar.

  • Added odoc-md to process standalone Markdown pages (@jonludlam, #1234)

Changed

  • The command line interface changed to support the new features.

    • Packages and libraries: odoc link must now be aware of packages and
      libraries with the -L libname:path and -P pkgname:path options. The
      module search path should still be passed with the -I option.
      The current package should be specified with --current-package=pkgname.
    • Hierarchy: odoc compile now outputs .odoc in the directory tree
      specified with --output-dir=DIR and the parent identifier must be
      specified with --parent-id=PARENT.
      The option --source-parent-file is removed.
    • Source code: Implementations are compiled with compile-impl instead of
      with compile. The options --cmt=.. and --source-name=.. are removed.
      Source code pages are generated with html-generate-source.
    • Assets: The commands compile-asset, html-generate-asset are added.
      The option html-generate --asset is removed.
    • Sidebar: The index is built using compile-index. The sidebar data is
      extracted from the index with sidebar-generate and passed to
      html-generate --sidebar=...
  • The syntax for @tag is now delimited (@panglesd, #1239)
    A @tag can now be followed by a paragraph or other elements.

  • Updated colors for code fragments (@EmileTrotignon, #1023)

  • Fixed complexity of looking up .odoc files (@panglesd, #1075)

  • Normalize whitespaces in codespans (@gpetiot, #1085)
    A newline followed by any whitespaces is normalized as one space character.

  • Reduce size of Odoc_html_frontend when compiled to javascript
    (@EmileTrotignon, #1072)

  • Overhaul of module-type-of expansions and shadowing code (@jonludlam, #1081)

  • Output file paths and labels in the man and latex backends changed to avoid
    name clashes (@Julow, #1191)

Fixed

  • Fix variant constructors being hidden if they contain hidden types
    (@jonludlam, #1105)
  • Fix rare assertion failure due to optional parameters
    (@jonludlam, #1272, issue #1001)
  • Fix resolution of module synopses in {!modules} lists that require --open
    (@jonludlam, #1104}
  • Fix top comment not being taken from includes often enough (@panglesd, #1117)
  • Fixed 404 links from search results (@panglesd, #1108)
  • Fixed title content not being picked up across pages when rendering references
    (#1116, @panglesd)
  • Fix wrong links to standalone comments in search results (#1118, @panglesd)
  • Remove duplicated or unwanted comments with inline includes (@Julow, #1133)
  • Fix bug where source rendering would cause odoc to fail completely if it
    encounters invalid syntax (@jonludlam #1208)
  • Add missing parentheses in 'val (let*) : ...' (@Julow, #1268)
  • Fix syntax highlighting not working for very large files
    (@jonludlam, @Julow, #1277)

Dune 3.17.2

The Dune team is happy to announce the release of Dune 3.17.2!

This patch release includes some bug fixes. It brings some fixes for Melange and Wasm_of_ocaml. It also fixes a bug that prevents the experimental feature, package management, to build with ocaml.5.3.0.

See full changelog

Fixed

  • Fix a crash in the Melange rules that would prevent compiling public library implementations of virtual libraries. (@anmonteiro, #11248)
  • Pass melange.emit's compile_flags to the JS emission phase. (@anmonteiro, #11252)
  • Disallow private implementations of public virtual libs in melange mode. (@anmonteiro, #11253)
  • Wasm_of_ocaml: fix the execution of tests in a sandbox. (#11304, @vouillon)

We're happy to announce the release of Merlin 5.4.1-503!

See full changelog
  • ocaml-index
    • Bump magic number after index file format change (#1886)

We're pleased to announce the release of OCaml LSP Server 1.22.0, which enables experimental project-wide renaming of identifiers!

See full changelog

Features

  • Enable experimental project-wide renaming of identifiers (#1431)

Merlin 5.4-503 is now available with support for OCaml 5.3. This release leverages new features in OCaml 5.3 to improve locate behavior, resolving issues where Merlin previously confused unique identifiers from interfaces and implementations. The indexer has been optimized to perform fewer merges, and initial support for project-wide renaming has been added, allowing occurrences to return all usages of related definitions across a project.

The Vim plugin receives an enhancement with search-by-type functionality, accessible through the existing :MerlinSearch command. The command now automatically switches between search-by-type and polarity search based on the first character of the query.

See full changelog
  • merlin binary
    • Support for OCaml 5.3
    • Use new 5.3 features to improve locate behavior in some cases. Merlin no
      longer confuses uids from interfaces and implementations. (#1857)
    • Perform less merges in the indexer (#1881)
    • Add initial support for project-wide renaming: occurrences can now return
      all usages of all related definitions. (#1877)
  • vim plugin
    • Added support for search-by-type (#1846)
      This is exposed through the existing :MerlinSearch command, that
      switches between search-by-type and polarity search depending on the
      first character of the query.

OCaml LSP Server version 1.21.0 is now available. This release introduces a new server option called standardHover that allows clients to disable the default hover provider functionality.

See full changelog

Features

  • Add a new server option standardHover, that can be used by clients to
    disable the default hover provider. When standardHover = false
    textDocument/hover requests always returns with empty result. (#1416)

We’re happy to announce that we just released ppxlib.0.34.0.

The full patch notes are available on the release page over here.

The main features are OCaml 5.3 compatibility, new AST pretty-printing utilities and the ppxlib-tools package, support for [@@deriving ...] on class types and the addition of missing Pprintast entry points.

Changes summary

5.3 compatibility

ppxlib.0.34.0 is the first official ppxlib release that’s compatible with the new 5.3 compiler.

The ppxlib driver now also comes with a -keywords CLI option, similar to the compiler’s that allow you to compile and preprocess with the 5.3 compiler code that uses effect as an identifier. This is pretty niche but it’s there should you need it.

Please note that means you can use ppx-es with a 5.3 compiler but not that ppx-es can consume/produce 5.3 language features. We’re currently working on a fix allowing you to use the effect syntax in files that require preprocessing as it’s not possible with 0.34.0. The fix should be released in the next few days as 0.34.1.

AST pretty-printing

We added a new Pp_ast module that allows you to pretty print AST fragments.

The only way ppxlib would print ASTs before were as S-expressions. In practice we found that it was not always helpful and wanted a more readable and human friendly way of displaying the AST.

The default output of those printer is a simplified version of the AST to keep things clear and avoid cluttering the output with information that is not always useful. For example, if you run Ppxlib.Pp_ast.Default.expression on the AST for x + 2, you’ll get the following:

Pexp_apply
  ( Pexp_ident (Lident "+")
  , [ ( Nolabel, Pexp_ident (Lident "x"))
    ; ( Nolabel, Pexp_constant (Pconst_integer ( "2", None)))
    ]
  )

The alert reader will note that there are no locations or attributes and that the expression record layer is omitted here.

You can of course configure the printer to display more information if you need to.

We’ve been using these new printers internally to debug migration code and they have been a huge help so we hope they will make working with ppxlib easier for you too.

In addition to this new module, we also added a command line utility called ppxlib-pp-ast to pretty print ASTs from source files, source code fragments or even marshalled AST files. It is very similar to the old ppx_tools’s dumpast.

Note that it will print ppxlib’s internal AST after it’s been migrated from the installed compiler’s version. This is something that we could not simply achieve with OCaml’s own -dparsetree.

This should be a useful tool for debugging ppx related bugs or learning about the AST and we hope ppx authors and users will like it.

Other changes

As mentioned above, we also added some missing Pprintast* entries such as binding, longident and payload.

It is now possible to use [@@deriving ...] on class type declarations and therefore to write derivers for class types.

*: To the confused readers: Pprintast is entirely different from Pp_ast mentioned above as it prints the source code corresponding to a given AST.

Special thanks

We wanted to thank our external contributors for this release: @hhugo, @nojb and @dra27 for their help on the 5.3 compat and @mattiasdrp for bringing the Pprintast module up to speed.

Special thanks as well to @pedrobslisboa who started integrating their excellent ppx-by-example into ppxlib’s documentation.

Finally, I’d also like to thank the OCaml Software Foundation who’s been funding all my work on ppxlib and made this release possible!

Happy preprocessing to you all!

See full changelog
  • Add initial OCaml 5.3 support (#487, @NathanReb, @hhugo, @nojb)

  • Initialise OCaml 5.3's lexer with the keywords setting from OCAMLPARAM or the new -keywords driver's CLI option to allow the standalone ppx driver to process old packages using effect as an identifier (#535, @dra27, @NathanReb)

  • Add Pprintast.binding, longident and payload (#542, @mattiasdrp)

  • Fix deriving_inline round-trip check so that it works with 5.01 <-> 5.02 migrations (#519, @NathanReb)

  • Add ppxlib's AST pretty-printing utilities in Ppxlib.Pp_ast and a ppxlib-pp-ast executable in a new separate ppxlib-tools package (#517, #525, #537, @NathanReb)

  • Change -dparsetree from a sexp output to a pretty printed AST, closer to what the compiler's -dparsetree is. (#530, @NathanReb)

  • Add Parsetree documentation comments to Ast_builder functions (#518, @patricoferris)

  • Support class type declarations in derivers with the new, optional arguments {str,sig}_class_type_decl in Deriving.add (#538, @patricoferris)

We are excited to share the release of OCaml-LSP 1.20.1, which introduces powerful new features and vital bug fixes to improve your development workflow. The new typeSearch request allows you to find values by type signature or polarity, making it easier to locate the functionality you need. Configurable MerlinJump actions and the custom jump request give you more control over code navigation. On the bug fix side, we have tackled issues like file descriptor leaks, enhanced method completion, and cleaned up duplicate responses in selectionRange.

See full changelog

Features

  • Add custom ocamllsp/typeSearch request (#1369)
  • Make MerlinJump code action configurable (#1376)
  • Add custom ocamllsp/jump request (#1374)

Fixes

  • Deactivate the jump code actions by default. Clients can enable them with the merlinJumpCodeActions configuration option. Alternatively, a custom request is provided for ad hoc use of the feature. (#1411)
  • Fix FD leak in running external processes for preprocessing (#1349)
  • Fix prefix parsing for completion of object methods (#1363, fixes #1358)
  • Remove some duplicates in the selectionRange answers (#1368)

This release introduces Merlin 5.3-502, compatible with OCaml 5.2, and 4.18-414, compatible with OCaml 4.14. Key updates include EXCLUDE_QUERY_DIR for better file management, resolving exceptions in polarity search,

and stabilizing type-enclosing results. For users of 5.3-502, additional enhancements address path resolution issues, fixes jump to fun functionality, and ensure proper handling of occurrences from hidden source files.

See full changelog
  • merlin binary

    • Respect the EXCLUDE_QUERY_DIR configuration directive when looking for cmt files #1854
    • Fix exception in polarity search (#1858 fixes #1113)
    • Fix type-enclosing results instability. This reverts some overly aggressive deduplication that should be done on the client side. #1864
  • merlin binary (only in 5.3-502)

    • Fix occurrences bug in which relative paths in index files are resolved against the PWD rather than the SOURCE_ROOT #1855
    • Fix jump to fun targets not working (#1863, fixes #1862)
    • Fix occurrences not working when the definition comes from a hidden source file #1865

Dune 3.17.1

The Dune team is happy to announce the release of Dune 3.17.1!

This patch release includes some bug fixes. To reduce computing time, it does not build .cmxs files anymore when the (no_dynlink) stanza is used instead. This behavior also corrects the semantic of the (no_dynlink) stanza which was building but not installing .cmxs files. It does not try to build and install them anymore.

See full changelog

Fixed

  • When a library declares (no_dynlink), then the .cmxs file for it is no longer built. (#11176, @nojb)

  • Fix bug that could result in corrupted file copies by Dune, for example when using the copy_files# stanza or the copy# action. (@nojb, #11194, fixes #11193)

  • Remove useless error message when running $ dune subst in empty projects. (@rgrinberg, #11204, fixes #11200)

Odoc 2.4.4

We're happy to announce the release of Odoc 2.4.4 which brings compatibility with OCaml 5.3!

See full changelog

Added

After almost a year of work, OCamlformat 0.27.0 is finally available with support for 5.3 syntax!

This release includes the new function syntax from OCaml 5.2, the effect keyword from OCaml 5.3 and a large number of bug fixes and improvements.

An other notable change, is that comments are now formatted by default.

See full changelog

Highlight

  • * Support OCaml 5.2 syntax (#2519, #2544, #2590, #2596, #2621, #2628, @Julow, @EmileTrotignon, @hhugo) This includes local open in types, raw identifiers, and the new representation for functions. This might change the formatting of some functions due to the formatting code being completely rewritten.

  • Support OCaml 5.3 syntax (#2609, #2610, #2611, #2622, #2623, #2562, #2624, #2625, #2627, @Julow, @Zeta611) This adds support for effect patterns, short functor type arguments and utf8 identifiers. To format code using the new effect syntax, add this option to your .ocamlformat:

    ocaml-version = 5.3
    
  • Documentation comments are now formatted by default (#2390, @Julow) Use the option parse-docstrings = false to restore the previous behavior.

  • * Consistent indentation of polymorphic variant arguments (#2427, @Julow) Increases the indentation by one to make the formatting consistent with normal variants. For example:

      ...
      (* before *)
        (`Msg
          (foo bar))
      (* after *)
        (`Msg
           (foo bar))
    
  • Build on OCaml 5.3 (#2603, @adamchol, @Julow)

Added

  • Improve the emacs plugin (#2577, #2600, @gridbugs, @thibautbenjamin) Allow a custom command to be used to run ocamlformat and add compatibility with emacs ocaml tree-sitter modes.

  • Added option let-binding-deindent-fun (#2521, @henrytill) to control the indentation of the fun in:

    let f =
     fun foo ->
      bar
    
  • Added back the flag --disable-outside-detected-project (#2439, @gpetiot) It was removed in version 0.22.

  • Support newer Odoc syntax (#2631, #2632, #2633, @Julow)

Changed

  • * Consistent formatting of comments (#2371, #2550, @Julow) This is mostly an internal change but some comments might be formatted differently.

  • * Improve formatting of type constraints with type variables (#2437, @gpetiot) For example:

    let f : type a b c.
        a -> b -> c =
      ...
    
  • * Improve formatting of functor arguments (#2505, @Julow) This also reduce the indentation of functor arguments with long signatures.

  • Improvements to the Janestreet profile (#2445, #2314, #2460, #2593, #2612, @Julow, @tdelvecchio-jsc)

  • * Undo let-bindings and methods normalizations (#2523, #2529, @gpetiot) This remove the rewriting of some forms of let-bindings and methods:

    • let f x = (x : int) is no longer rewritten into let f x : int = x
    • let f (type a) (type b) ... is no longer rewritten into let f (type a b) ...
    • let f = fun x -> ... is no longer rewritten into let f x = ...
  • * The break-colon option is now taken into account for method type constraints (#2529, @gpetiot)

  • * Force a break around comments following an infix operator (fix non-stabilizing comments) (#2478, @gpetiot) This adds a line break:

      a
      ||
      (* this comment is now on its own line *)
      b
    

Fixed

  • Fix placement of comments in some cases (#2471, #2503, #2506, #2540, #2541, #2592, #2617, @gpetiot, @Julow) Some comments were being moved or causing OCamlformat to crash. OCamlformat refuses to format if a comment would be missing in its output, to avoid loosing code.
  • Fix attributes being dropped or moved (#2247, #2459, #2551, #2564, #2602, @EmileTrotignon, @tdelvecchio-jsc, @Julow) OCamlformat refuses to format if the formatted code has a different meaning than the original code, for example, if an attribute is removed. We also try to avoid moving attributes even if that doesn't change the original code, for example we no longer format open[@attr] M as open M [@@attr].
  • Remove trailing space inside a wrapping empty signature (#2443, @Julow)
  • Fix extension-point spacing in structures (#2450, @Julow)
  • * Consistent break after string constant argument (#2453, @Julow)
  • * Fix cinaps comment formatting to not change multiline string contents (#2463, @tdelvecchio-jsc)
  • * Fix the indentation of tuples in attributes and extensions (#2488, @Julow)
  • * Fix weird indentation and line breaks after comments (#2507, #2589, #2606, @Julow)
  • * Fix unwanted alignment in if-then-else (#2511, @Julow)
  • Fix missing parentheses around constraint expressions with attributes (#2513, @alanechang)
  • Fix formatting of type vars in GADT constructors (#2518, @Julow)
  • Fix [@ocamlformat "disable"] in some cases (#2242, #2525, @EmileTrotignon) This caused a bug inside class type constructs and when attached to a let ... in
  • Display a##b instead of a ## b and similarly for operators that start with # (#2580, @v-gb)
  • * Fix arrow type indentation with break-separators=before (#2598, @Julow)
  • Fix missing parentheses around a let in class expressions (#2599, @Julow)
  • Fix formatting of paragraphs in lists in documentation (#2607, @Julow)
  • Avoid unwanted space in references and links text in documentation (#2608, @Julow)
  • * Improve the indentation of attributes in patterns (#2613, @Julow)
  • * Avoid large indentation in patterns after let%ext (#2615, @Julow)

Dune 3.17.0

We're happy to announce the release of Dune 3.17.0.

Among the list of chances, this release enables the Dune cache by default for known-safe operations, adds support for Wasm_of_ocaml, adds support for the -H compiler flag introduced in OCaml 5.2 and allows specifying code hosting services like Codeberg or Gitlab organizations.

See full changelog

Fixed

  • Show the context name for errors happening in non-default contexts. (#10414, fixes #10378, @jchavarri)

  • Correctly declare dependencies of indexes so that they are rebuilt when needed. (#10623, @voodoos)

  • Don't depend on coq-stdlib being installed when expanding variables of the coq.version family (#10631, fixes #10629, @gares)

  • Error out if no files are found when using copy_files. (#10649, @jchavarri)

  • Re_export dune-section private library in the dune-site library stanza, in order to avoid failure when generating and building sites modules with implicit_transitive_deps = false. (#10650, fixes #9661, @MA0100)

  • Expect test fixes: support multiple modes and fix dependencies when there is a custom runner (#10671, @vouillon)

  • In a (library) stanza with (extra_objects) and (foreign_stubs), avoid double linking the extra object files in the final executable. (#10783, fixes #10785, @nojb)

  • Map (re_export) library dependencies to the exports field in META files, and vice-versa. This field was proposed in to https://discuss.ocaml.org/t/proposal-a-new-exports-field-in-findlib-meta-files/13947. The field is included in Dune-generated META files only when the Dune lang version is >= 3.17. (#10831, fixes #10830, @nojb)

  • Fix staged pps preprocessors on Windows (which were not working at all previously) (#10869, fixes #10867, @nojb)

  • Fix dune describe when an executable is disabled with enabled_if. (#10881, fixes #10779, @moyodiallo)

  • Fix an issue where C stubs would be rebuilt whenever the stderr of Dune was redirected. (#10883, fixes #10882, @nojb)

  • Fix the URL opened by the command dune ocaml doc. (#10897, @gridbugs)

  • Fix the file referred to in the error/warning message displayed due to the dune configuration version not supporting a particular configuration stanza in use. (#10923, @H-ANSEN)

  • Fix enabled_if when it uses env variable. (#10936, fixes #10905, @moyodiallo)

  • Fix exec -w for relative paths with --root argument (#10982, @gridbugs)

  • Do not ignore the (locks ..) field in the test and tests stanza (#11081, @rgrinberg)

  • Tolerate files without extension when generating merlin rules. (#11128, @anmonteiro)

Added

  • Make Merlin/OCaml-LSP aware of "hidden" dependencies used by (implicit_transitive_deps false) via the -H compiler flag. (#10535, @voodoos)

  • Add support for the -H flag (introduced in OCaml compiler 5.2) in dune (requires lang versions 3.17). This adaptation gives the correct semantics for (implicit_transitive_deps false). (#10644, fixes #9333, ocsigen/tyxml#274, #2733, #4963, @MA0100)

  • Add support for specifying Gitlab organization repositories in source stanzas (#10766, fixes #6723, @H-ANSEN)

  • New option to control jsoo sourcemap generation in env and executable stanza (#10777, fixes #10673, @hhugo)

  • One can now control jsoo compilation_mode inside an executable stanza (#10777, fixes #10673, @hhugo)

  • Add support for specifying default values of the authors, maintainers, and license stanzas of the dune-project file via the dune config file. Default values are set using the (project_defaults) stanza (#10835, @H-ANSEN)

  • Add names to source tree events in performance traces (#10884, @jchavarri)

  • Add codeberg as an option for defining project sources in dune-project files. For example, (source (codeberg user/repo)). (#10904, @nlordell)

  • dune runtest can now run individual tests with dune runtest mytest.t (#11041, @Alizter).

  • Wasm_of_ocaml support (#11093, @vouillon)

  • Add a coqdep_flags field to the coq field of the env stanza, and to the coq.theory stanza, allowing to configure coqdep flags. (#11094, @rlepigre)

Changed

  • Remove all remnants of the experimental patch-back-source-tree. (#10771, @rgrinberg)

  • Change the preset value for author and maintainer fields in the dune-project file to encourage including emails. (#10848, @punchagan)

  • Tweak the preset value for tags in the dune-project file to hint at topics not having a special meaning. (#10849, @punchagan)

  • Change some colors to improve readability in light-mode terminals (#10890, @gridbugs)

  • Forward the linkall flag to jsoo in whole program compilation as well (#10935, @hhugo)

  • Configurator uses pkgconf as pkg-config implementation when available and forwards it the target of ocamlc -config. (#10937, @pirbo)

  • Enable Dune cache by default. Add a new Dune cache setting enabled-except-user-rules, which enables the Dune cache, but excludes user-written rules from it. This is a conservative choice that can avoid breaking rules whose dependencies are not correctly specified. This is the current default. (#10944, #10710, @nojb, @ElectreAAS)

  • Do not add dune dependency in dune-project when creating projects with dune init proj. The Dune dependency is implicitely added when generating opam files (#11129, @Leonidas-from-XIV)

opam 2.3.0

Feedback on this post is welcomed on Discuss!

As mentioned in our talk at the OCaml Workshop 2024, we decided to switch to a time-based release cycle (every 6 months), starting with opam 2.3.

As promised, we are very pleased to announce the release of opam 2.3.0, and encourage all users to upgrade. Please read on for installation and upgrade instructions.

Try it!

In case you plan a possible rollback, you may want to first backup your ~/.opam or $env:LOCALAPPDATA\opam directory.

The upgrade instructions are unchanged:

  1. Either from binaries: run

For Unix systems

bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh)"

or from PowerShell for Windows systems

Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) }"

or download manually from the Github "Releases" page to your PATH.

  1. Or from source, manually: see the instructions in the README.

You should then run:

opam init --reinit -ni

Major breaking change: extra-files

When loading a repository, opam now ignores files in packages' files/ directories which aren't listed in the extra-files field of the opam file. This was done to simplify the opam specification where we hope the opam file to be the only thing that you have to look at when reading a package specification. It being optional to list all files in the extra-files: field went against that principle. This change also reduces the surface area for potential file corruption as all extra-files must have checksums.

This is a breaking change and means that if you are using the files/ directory without listing them in the extra-files: field, you need to make sure that all files in that directory are included in the extra-files field. The resulting opam file remains compatible with all previous opam 2.x releases.

If you have an opam repository, you should make sure all files are listed so every packages continues to work without any issue, which can be done automatically using the opam admin update-extrafiles command.

Major changes

  • Packages requiring an unsupported version of opam are now marked unavailable, instead of causing a repository error. This means an opam repository can now allow smoother upgrade in the future where some packages can require a newer version of opam without having to fork the repository to upgrade every package to that version as was done for the upgrade from opam 1.2 to 2.0

  • Add a new opam list --latests-only option to list only the latest versions of packages. Note that this option respects the order options were given on the command line. For example: --available --latests-only will first list all the available packages, then choose only the latest packages in that set; while --latests-only --available will first list all the latest packages, then only show the ones that are available in that set

  • Fix and improve opam install --check, which now checks if the whole dependency tree of the package is installed instead of only the root dependencies

  • Add a new --verbose-on option to enable verbose output for specified package names. Thanks to @desumn for this contribution

  • Add a new opam switch import --deps-only option to install only the dependencies of the root packages listed in the opam switch export file

  • opam switch list-available no longer displays compilers flagged with avoid-version/deprecated unless --all is given, meaning that pre-release or unreleased OCaml packages no longer appear to be the latest version

  • opam switch create --repositories now correctly infers --kind=git for URLs ending with .git rather than requiring the git+https:// protocol. This is consistant with other commands such as opam repository add. Thanks to @Keryan-dev for this contribution

  • opam switch set-invariant now displays the switch invariant using the same syntax as the --formula flag

  • The builtin-0install solver was improved and should now be capable of being your default solver instead of builtin-mccs+glpk. It was previously mostly only suited for automated tasks such as Continuous Integration. If you wish to give it a try, simply calling opam option solver=builtin-0install (call opam option solver= restores the default)

  • Most of the unhelpful conflict messages were fixed. (#4373)

  • Fix an opam 2.1 regression where the initial pin of a local VCS directory would store untracked and ignored files. Those files would usually be cleaned before building the package, however git submodules would not be cleaned and would cause issues when paired with the new behaviour added in 2.3.0~alpha1 which makes opam error when git submodules fail to update (it was previously a warning). (#5809)

  • Fix the value of the arch variable when the current OS is 32bit on a 64bit machine (e.g. Raspberry Pi OS). (#5949)

  • opam now fails when git submodules fail to update instead of ignoring the error and just showing a warning

  • opam's libraries now compile with OCaml >= 5.0 on Windows

  • Fix the installed packages internal cache, which was storing the wrong version of the opam file after a build failure. This could be triggered easily for users with custom repositories with non-populated extra-files. (#6213)

  • Several improvements to the pre-built release binaries were made:

    • The Linux binaries are now built on Alpine 3.20
    • The FreeBSD binary is now built on FreeBSD 14.1
    • The OpenBSD binary is now built on OpenBSD 7.6 and loses support for OpenBSD 7.5 and earlier
    • Linux/riscv64 and NetBSD/x86_64 binaries are now available

And many other general, performance and UI improvements were made and bugs were fixed. You can take a look to previous blog posts. API changes and a more detailed description of the changes are listed in:

This release also includes PRs improving the documentation and improving and extending the tests.

Please report any issues to the bug-tracker.

We hope you will enjoy the new features of opam 2.3!

Feedback on this post is welcomed on Discuss!

We're happy to announce the first and hopefully only release candidate of opam 2.3.0.

This version does not have any significant change compared to the previous 2.3.0~beta2 release and we hope the final release to also have no significant change. Regardless, we invite users to test this version to make sure there isn't any regressions.

Unless a regression is spotted or another problem arises, we hope to have the final release of 2.3.0 out on the 12th of November.

Try it!

The upgrade instructions are unchanged:

  1. Either from binaries: run

For Unix systems

bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.3.0~rc1"

or from PowerShell for Windows systems

Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) } -Version 2.3.0~rc1"

or download manually from the Github "Releases" page to your PATH.

  1. Or from source, manually: see the instructions in the README.

You should then run:

opam init --reinit -ni

Please report any issues to the bug-tracker.

Happy hacking!

Dune 3.16.1

We're happy to announce the release of Dune 3.16.1.

This is a patch release that fixes an issue with OCaml.5.3.0 and C++ flags.

See full changelog

Fixed

  • Call the C++ compiler with -std=gnu++11 when using OCaml >= 5.0 (#10962, @kit-ty-kate)

    Added

Feedback on this post is welcomed on Discuss!

We're happy to announce the second beta release of opam 2.3.0.

As this version is a beta, we invite users to test it to spot previously unnoticed bugs as we head towards the stable release.

Changes

Compared to the previous 2.3.0~beta1 release, the main change is:

  • Fix a regression in the detection of the current terminal size that leads to opam output that tries to fit itself into 80 columns regardless of the current terminal size (#6243).

  • A NetBSD/x86_64 pre-built release binary is now available

You can view the full list of changes, including API changes, in the release note.

Try it!

The upgrade instructions are unchanged:

  1. Either from binaries: run

For Unix systems

bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.3.0~beta2"

or from PowerShell for Windows systems

Invoke-Expression "& { $(Invoke-RestMethod https://opam.ocaml.org/install.ps1) } -Version 2.3.0~beta2"

or download manually from the Github "Releases" page to your PATH.

  1. Or from source, manually: see the instructions in the README.

You should then run:

opam init --reinit -ni

Please report any issues to the bug-tracker.

Happy hacking!

If you want to contribute to a new release announcement, check out the Contributing Guide on GitHub.