OCaml Changelog

RSS

Official stable release announcements and updates from the OCaml compiler, OCaml infrastructure and the OCaml Platform Tools.

Feedback on this post is welcomed on Discuss!

We are happy to announce the release of opam-publish 2.7.0 which brings the ability to more easily publish your releases automatically, thanks to @filipeom:

  • SSH keys aren't used to push the branch to the user's fork anymore. Instead the token we already require is used.
  • If undefined, the git config variables user.name and user.email are automatically filled with the github username and username@opam-publish as a backup

An example of the new automated setup can be found in this CI job.

Other minor changes include:

  • The switch from lwt_ssl to tls-lwt which avoid one dependency and avoid depending on the system libssl

Happy publishing! <> <> The opam team <> <> :camel:

Merlin 5.6 is now available with support for OCaml 5.4, a new type navigation command, and several bug fixes!

Key Changes

New locate-types command

The new locate-types command returns all locatable type identifiers in an expression as a tree structure. Unlike locate-type, which only handles simple type constructors and ignores type arguments, locate-types works on complex types like (int, Foo.t) result. You can now navigate to int, Foo.t, or result individually. This enables better "Go to Type Definition" functionality in editors that support it.

OCaml 5.4 support

This release supports OCaml 5.4.

Improved error recovery

Type checking now handles mutually recursive definitions better when they contain errors, providing more useful feedback during development.

OpenBSD support

Fixed merlin_reader to work correctly on OpenBSD.

Vim plugin fix

:MerlinOccurrencesProjectWide no longer errors when it can't gather code previews.

See the GitHub repository and the related announcement on the Discuss forums for more details.

See full changelog

CHANGES:

  • merlin binary
    • Add locate-types command (#1951)
  • merlin library
    • Fix merlin_reader for OpenBSD (#1956)
    • Improve recovery of mutually recursive definitions (#1962, #1963, fixes #1953)
    • Support for OCaml 5.4 (#1974)
  • vim plugin
    • Fix error when :MerlinOccurrencesProjectWide fails to gather code previews (#1970)
    • Add more short-paths tests cases (#1904)

We're happy to announce the release of ocaml-lsp-server 1.23.1!

This maintenance release fixes three key issues:

  • Method hover now works: Hovering over object method calls now correctly displays type information instead of showing "No information available"
  • OCamllex files open without errors: Fixed an error that occurred when opening .mll (OCamllex lexer) files in editors like NeoVim
  • Yojson compatibility: Ensures the language server works with both yojson 2.0 and 3.0

Update via opam: opam update && opam upgrade ocaml-lsp-server

For more details, see the related announcement on the Discuss forums!

See full changelog

Fixes

  • Fix hover on method calls not showing the type. (#1553, fixes #1552)
  • Fix error on opening .mll files (#1557)
  • Ensure compatibility with both yojson 2.0 and 3.0. (#1534)

We're pleased to announce ppxlib 0.36.2, a maintenance release with two bug fixes related to OCaml 5.2 AST changes for type constraints in let bindings.

What's Fixed

Ast_builder compatibility: The value_binding constructor now automatically handles the AST migration from OCaml 4.14 to 5.2, correctly generating pvb_constraint fields when type constraints are present. This means PPX authors don't need to manually update their code for the new AST representation.

PPrintast output: Fixed pretty-printing of legacy Ppat_constraint nodes with Ptyp_poly to produce valid OCaml syntax, ensuring generated code remains compilable during the transition period.

Both fixes improve compatibility across OCaml compiler versions.

See full changelog

CHANGES:

  • Make Ast_builder's default value_binding constructor generate the proper
    pvb_constraint from the pattern and expression arguments.
    (#589, @NathanReb)
  • Fix pprintast to output correct syntax from Ppat_constraint (pat, Ptyp_poly ...)
    nodes until they are completely dropped. (#588, @NathanReb)

You can comment on this announcement on the OCaml discuss forums.

Here at OCamlPro we’re happy to announce the (long awaited) release of ocp-indent.1.9.0.

The full release notes are available here if you want the detailed version.

1.9.0 contains mostly bug fixes, better and more consistent indentation of fun _ -> and |>, compatibility with cmdliner.1.3.0 and above (it works with 2.0.0) and a new utility tool: ocp-indent-gen-rules for those of you who would like to try ocp-indent in a dune fmt like workflow.

This last bit is documented here. This is a feature that some of us wanted internally at OCamlPro so we decided to ship it with the tool as an experiment. We’d really like to hear if this fits your ocp-indent usage so please don’t hesitate to try it out and give us some feedback.

We’re also interested in hearing how you use ocp-indent in general and what you expect from it. Reach out if you have any request!

We’ve also updated the repo to fit the more recent development standards. We migrated the test suite to dune cram tests and re-enabled them in opam. Hopefully this should make contributing to ocp-indent a smoother experience!

Also be aware that we’ll do our best to maintain ocp-indent more actively from now on.

We’d like to thank our external contributors for this release: @dbuenzli, @nojb, @bcc32 and @Julow.

Happy indenting!

See full changelog

CHANGES:

  • Fix detection of let vs letin after a struct (#324, @Julow)
  • Treat |> as a monadic operator (#322, @nberth)
  • Prevent Args out of range error in ocp-indent-buffer (#327, @bcc32)
  • Fix "Missing ‘lexical-binding’ cookie" warning in Emacs (#329, @nojb)
  • Fix a bug where ocp-indent translate LF to CRLF when run on Windows instead
    of preserving the input's newlines. (#334, @nojb)
  • Add ocp-indent-gen-rules to support dune fmt like workflow with ocp-indent
    (#333, @NathanReb)

We are happy to announce the release of opam-publish 2.6.0, which brings opam-publish closer to the ability to more easily publish your releases automatically. This release brings:

  • A new OPAM_PUBLISH_GH_TOKEN environment variable and --token argument are now available to pass the GitHub token, thanks to @filipeom
  • The addition of a message after the PR is open, to notify users that they can re-run opam-publish to update the PR, thanks to @punchagan

Happy publishing! <> <> The opam team <> <> :camel:

Dune 3.20.2

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

This release introduces some minor fixes and restores the build on Cygwin.

See full changelog

Fixed

  • Fix jsoo separate compilation with modules_without_implementation. Regression introduced in #10767. (#12320, fixes #12306 @hhugo)

  • Fix runtest-js mistakenly using wrong dependencies (#12324, @vouillon)

  • Remove empty .cram.test.t directory during the running of a cram test. (#12329, fixes #12321, @Alizter)

  • Fix Cygwin bootstrap (#12325, fixes #12316, @Alizter)

TL;DR

ocaml-eglot provides full OCaml language support in Emacs through the Language Server Protocol (LSP) instead of direct Merlin integration. It offers the same features as merlin.el with simplified setup and enhanced capabilities like project-wide search. If you're starting fresh or want a more standardized approach, try ocaml-eglot, which is actively maintained. If your current merlin.el setup works well, you can continue using it.

Quick start: Install ocaml-lsp-server, add ocaml-eglot to your Emacs config, and get the same OCaml development experience with less configuration.

What is ocaml-eglot?

ocaml-eglot connects Emacs to ocaml-lsp-server using the Language Server Protocol, providing a standardized way to get OCaml language support.

Since the recent versions of Emacs (29), eglot, an LSP client, has been shipped with Emacs. However, merlin.el provides more features than LSP (which is designed to be generic), so relying solely on the features of LSP and eglot would limit functionality. Thus, we extended the LSP server to support more features, and ocaml-eglot allows you to benefit from these features in Emacs.

ocaml-eglot is a minor mode. It therefore works in conjunction with a major mode to edit Caml code. Examples of major modes include tuareg, caml-mode and the recent neocaml.

Who Should Use ocaml-eglot?

Use ocaml-eglot if you:

  • Are starting fresh with OCaml
  • If you use or want to use Emacs
  • Want simplified configuration with automatic setup
  • Use multiple editors and want consistent OCaml support
  • Want access to project-wide search and rename features
  • Want to rely on an actively maintained project that evolves over time

If your current setup is working perfectly and is heavily customised, merlin.el will still keep working, so there's no immediate need to migrate. However, for the moment, we don't plan to actively maintain merlin.el -- unless we receive a lot of requests.

Getting Started

Follow the installation instructions in the ocaml-eglot README.

When migrating from merlin.el to ocaml-eglot, your existing keybindings should work immediately!

Features

Error Navigation: Quick jump to next/previous errors

Type Information: Display types under cursor with adjustable verbosity, navigate enclosing expressions

Code Generation: Pattern matching construction, case completion, wildcard refinement via "destruct" feature

Navigation: Jump between language constructs (let, module, function, match), navigate phrases and pattern cases

Search: Find definitions, declarations, and references

For a detailed list of features, see the ocaml-eglot README.

Next Steps

  1. Try the basic setup with an existing OCaml project
  2. Explore all the features of ocaml-eglot
  3. Provide feedback at ocaml-eglot's GitHub Issues

Documentation

Related Releases

On January 17, 2025, ocaml-eglot version 1.0.0 was released, providing a new minor emacs mode to enable the editor features provided by ocaml-lsp-server. Subsequent releases 1.1.0 and 1.2.0 enable support for flycheck as a configurable alternative to flymake (1.0.0 release), Emacs 30.1 support, better user experience and error handling, as well as support for new features.

Dune 3.20.1

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

This release introduces some minor fixes and reverts the dune file formatter change.

See full changelog

Fixed

  • Fix runtest-js mistakenly depending on byte (fixes #12243, #12242, @vouillon and @Alizter)

  • Fix the interpretation of paths in dune runtest when running from within a subdirectory. (#12251, fixes #12250, @Alizter)

Changed

  • Revert formatting change introduced in 3.20.0 making long lists in s-expressions fill the line instead of formatting them in a vertical way (#12245, reverts #10892, @nojb)

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)

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)

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.

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.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)

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)

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!

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

We are happy to announce the joint release of Merlin 5.2.1-502 and 4.17.1. This release adds many new features to Merlin including the ability to add hints to a source tree, serch for values using a type signature and expanding PPX annotations to preview their source code. There are also bug fixes for both the Merlin binary and editor modes.

More information can be found in the Discuss announcement.

Contributions are always welcome at Merlin | Issues

See full changelog
  • merlin binary
    • A new WRAPPING_PREFIX configuration directive that can be used to tell Merlin what to append to the current unit name in the presence of wrapping (ocaml/merlin#1788)
    • Add -unboxed-types and -no-unboxed-types as OCaml ignored flags (ocaml/merlin#1795, fixes ocaml/merlin#1794)
    • Destruct: Refinement in the presence of optional arguments (ocaml/merlin#1800 ocaml/merlin#1807, fixes ocaml/merlin#1770)
    • Implement new expand-node command for expanding PPX annotations (ocaml/merlin#1745)
    • Implement new inlay-hints command for adding hints on a source tree (ocaml/merlin#1812)
    • Implement new search-by-type command for searching values by types (ocaml/merlin#1828)
    • Canonicalise paths in occurrences. This helps deduplicate the results and
    • Show more user-friendly paths. (ocaml/merlin#1840)
    • Fix dot-merlin-reader ignoring SOURCE_ROOT and STDLIB directives (ocaml/merlin#1839, ocaml/merlin#1803)
  • editor modes
    • Vim:
      • Fix Python-3.12 syntax warnings in merlin.py (ocaml/merlin#1798)
      • Dead code / doc removal for previously deleted MerlinPhrase command (ocaml/merlin#1804)
    • Emacs:
      • Improve the way that result of polarity search is displayed (#1814)
      • Add merlin-search-by-type, merlin-search-by-polarity and change the behaviour of merlin-search to switch between by-type or by-polarity depending on the query (ocaml/merlin#1828)
If you want to contribute to a new release announcement, check out the Contributing Guide on GitHub.