OCaml Changelog

RSS

Read the latest releases and updates from the OCaml ecosystem.

After giving space for feedback and objections by the community, we have deprecated ocaml-migrate-parsetree (aka OMP). It is superseded by Ppxlib.

There are four major differences between OMP and Ppxlib, which all go hand in hand.

The first major difference is in the library and therefore impacts how to write PPXs. With OMP, each PPX author had to choose a parsetree version to define their PPX against. There was no version agreement between different PPXs. With Ppxlib, each PPX author uses the same parsetree version.

The second major difference is about compatibility with new compiler syntax. While with OMP, each PPX was on its own parsetree version, Ppxlib keeps them all on the version of the latest stably released compiler. That makes using any PPX compatible with using the latest compiler syntax features!

The third major difference is in the philosophy of PPXs. With OMP, all PPX transformations were global transformations, i.e., transformations of the whole parsetree. Ppxlib has introduced the concept of "context-free" transformations, i.e., transformations that transform only one parsetree node. By restricting their scope of action, context-free PPXs are a lot more predictable and less dangerous! Also, Ppxlib merges all context-free PPXs into one parsetree pass, defining clear semantics of PPX composition.

The fourth major difference is in the driver, i.e., the binary that drives the application of all used PPXs in a project. The Ppxlib driver is significantly more performant than the OMP driver used to be. That's partly because it does a lot fewer parsetree migrations and partly thanks to merging all context-free PPXs into one parsetree pass.

As a consequence of the deprecation, OMP will be incompatible with any new compiler version. The first incompatible compiler version is OCaml 5.1.

Thanks a lot to everyone involved in OCaml's transition from OMP to Ppxlib, for example by porting their PPX!

Dune 3.11.1

Following the release of Dune 3.11.0 a few days ago, we've just released version 3.11.1 with a couple of bug fixes:

  • Fix the dune rpc status command that was incorrectly showing that there were no RPC servers running on Windows.
  • Fix a bogus error when no inline test was declared in a library using (inline_tests).
See full changelog

Fixed

  • Fix dune rpc commands on Windows (#8806, fixes #8799, @nojb)

  • Fix inline_tests when the partition list is empty (#8849, fixes #8848, @hhugo)

We're happy to announce the release of Ppxlib 0.31.0. Shortly after OCaml 5.1.0 has been released, this Ppxlib release fixes a bug in the support of OCaml 5.1.0. Before that bug fix, the warnings about a generative/applicative mismatch between a functor creation and its application introduced by OCaml 5.1.0 were also triggered when that mismatch didn't exist.

Furthermore, the release contains a couple of bug fixes in the context of attributes.

We're also excited about two main enhancements. One allows authors of extension node rewriters to add a path argument to the extension node. That's excellent for hygiene since it allows the PPX to be explicit about modules rather than depending on its scope.

The other main enhancement allows an opt-in for compiler warnings about unused code generated by derivers (warnings w32 and w60). That opting in needs to happen on both sides of the deriver, the writer side and the user side. Opting in to those code warnings will help to clean up unused code, leading to performance improvements in compilation and editor support.

See full changelog
  • Fix support for OCaml 5.1: migrated code preserves generative functor warnings, without creating more. Locations are better preserved. (#432, @pitag-ha, @panglesd)

  • Driver: Add -unused-code-warnings command-line flag. (#444, @ceastlund)

  • Add ?warning flag to Deriving.Generator.make. (#440, @jacksonzou123 via @ceastlund)

  • Restore the path_arg functionality in the V3 API. (#431, @ELLIOTTCABLE)

  • Expose migration/copying/etc. functions for all AST types needed by Pprintast. (#454, @antalsz)

  • Preserve quoted attributes on antiquotes in metaquot. (#441, @ncik-roberts)

  • Attribute namespaces: Fix semantics of reserving multi-component namespaces. (#443, @ncik-roberts)

Dune 3.11.0

We're pleased to announce the release of Dune 3.11!

Here are some highlights from this release.

Dune Terminal User Interface (TUI)

The biggest highlight in this release is the introduction of the new Terminal User Interface (TUI) display mode.

You can now run dune build --display tui to open a TUI. We recommend using it in conjunction with Dune watch mode (dune build -w --display tui).

From the TUI, you will be able to navigate messages from Dune build, scroll through them, or click to minimize them. Press ? to show the help screen.

Installing Source Directories

Another exciting feature in this release is the new (source_trees ..) field added to the (install ..) stanzas to add every files in a directory to the installation. For instance, to add your manual to the installation, you can use:

(install
 (section doc)
 (source_trees manual))

Let us know what you think about these features, and don't hesistate to open issues on Dune's bug tracker if you encounter any issue.

See full changelog

Added

  • enabled_if now supports arch_sixtyfour variable (#8023, fixes #7997, @Alizter)

  • Experimental: Added a $ dune monitor command that can connect to a running dune build in watch mode and display the errors and progress. (#8152, @Alizter)

  • The progress RPC procedure now has an extra field for the In_progress constructor for the number of failed jobs. (#8212, @Alizter)

  • Add a --preview flag to dune fmt which causes it to print out the changes it would make without applying them (#8289, @gridbugs)

  • Introduce (source_trees ..) to the install stanza to allow installing entire source trees. (#8349, @rgrinberg)

  • Add --stop-on-first-error option to dune build which will terminate the build when the first error is encountered. (#8400, @pmwhite and @Alizter)

  • Dune now displays the number of errors when waiting for changes in watch mode. (#8408, fixes #6889, @Alizter)

  • Add with_prefix keyword for changing the prefix of the destination of installed files matched by globs. (#8416, @gridbugs)

  • Added experimental --display tui option for Dune that opens an interactive Terminal User Interface (TUI) when Dune is running. Press '?' to open up a help screen when running for more information. (#8429, @Alizter and @rgrinberg)

  • Add a warnings field to dune-project files as a unified mechanism to enable or disable dune warnings (@rgrinberg, 8448)

  • dune exec: support syntax like %{bin:program}. This can appear anywhere in the command line, so things like dune exec time %{bin:program} now work. (#6035, #8474, fixes #2691, @emillon, @Leonidas-from-XIV)

  • Add a new alias @doc-json to build odoc documentation in JSON format. This output can be consumed by external tools. (#8178, @emillon)

Changed and Fixed

  • Use posix_spawn instead of fork on MacOS. This gives us a performance boost and allows us to re-enable thread. (#8090, @rgrinberg)

  • Modules that were declared in (modules_without_implementation), (private_modules) or (virtual_modules) but not declared in (modules) will raise an error. (#7674, @Alizter)

  • No longer emit linkopts(javascript) in META files (#8168, @hhugo)

  • RPC message styles are now serialised meaning that RPC diagnostics keep their ANSI styling. (#8516, fixes #6921, @Alizter)

  • Truncate output from actions that produce too much output (@tov, #8351)

  • Allow libraries to shadow OCaml built-in libraries. Previously, built-in libraries would always take precedence. (@rgrinberg, #8558)

  • dune utop no longer links utop in "custom" mode, which should make this command considerably faster. (#8631, fixes #6894, @nojb)

  • Ensure that package names in dune-project are valid opam package names. (#8331, @emillon)

  • init: check that module names are valid (#8644, fixes #8252, @emillon)

  • dune init: parse --public as a public name (#8603, fixes #7108, @emillon)

  • Stop signing source files with substitutions. Sign only binaries instead (#8361, fixes #8360, @anmonteiro)

  • Make copy sandbox support directory targets. (#8705, fixes #7724, @emillon)

Deprecated and Removed

  • Deprecate install destination paths beginning with ".." to prevent packages escaping their designated installation directories. (#8350, @gridbugs)

  • Remove warning against .dune files generated by pre Dune 2.0 (#8611, @rgrinberg)

  • Remove versions 0.1 and 0.2 of the experimental ctypes extension. (#8293, @emillon)

Odoc 2.3.0

We are thrilled to announce the release of odoc 2.3.0! 🎉 This release is the result of almost a year of diligent work from the odoc team since the last major release of odoc 2.2.0, it comes packed with significant new features and improvements!

🌟 Spotlight Features of Odoc 2.3.0

Here are a couple of the new features introduced in Odoc 2.3.0 that we'd like to highlight.

Table Support

Table support is the last addition to the odoc language, and comes with two syntax flavours: a light one, and a heavy one. The light markup is similar to markdown's markup for table, producing tables that are readable in the source file as well.

However, this markup has some limitation, since it only allows inline content in cells. It can also be difficult to read and mantain for big tables, without a proper editor support. For this reason, Odoc also provides a "heavy" markup, closer to the html one, with fewer limitations!

Here is a table in heavy, light, and rendered form:

{t
Table | support
------|--------
is    | cool!
}
{table
{tr {th Table} {th support}}
{tr {td is} {td cool!}}
}

Table | support ------|-------- is | cool!

Source Code Rendering

Source code rendering is an extremely exciting new feature. Not only odoc is now able to generate a rendering of the source files (and source hierarchy) of a project, but it is also able to create direct links from the documentation to the implementation!

This puts the documentation browsing to a new level, by helping to quickly answer any implementation-related question!

The source code rendering is also tailored to OCaml, for instance with links from variables to their definition, something missing from traditional html-based source viewing such as github!

Using this features in odoc’s driver will require some work, but you can already have a preview of the feature by going to the odoc API website, which was built with the feature enabled. For instance, the Odoc_html 19 module is now populated with many Source links, jumping right into the implementation file 5! Directory pages to browser the implementation are also included 8 :smiley:

🗺️ Background & Roadmap

Some background on our roadmap and what comes next.

The lack of access to comprehensive documentation for OCaml libraries is one of the biggest pain points reported by the OCaml community, as highlighted in the 2022 OCaml survey (c.f. Q50).

This motivated the odoc and OCaml.org teams to jointly work on a centralised package documentation, that went live in April 2022, as part of the new version of OCaml.org.

With documentation for OCaml libraries readily available on OCaml.org, we now turn our focus on making sure that library authors have the tooling they need to create high-quality documentation.

Our roadmap highlights some features we believe will make the generated documentation significantly better for readers, and documentation-writing much more pleasant and rewarding.

This release is a significant milestone in implementing the features on our roadmap and is the precursor to a series of upcoming releases. Odoc 2.4.0 will follow shortly and will bring support for search. Stay tuned and follow our progress through the OCaml Platform newsletter!

🤝 Join Our Mission

While we are dedicated to developing the best tooling to generate and serve documentation on OCaml.org, creating a well-documented library ecosystem can only be a collective effort. Package authors: we're working hard to give you great tools, but we'll need all your help to create an ecosystem of well-documented libraries for OCaml!

If you find that writing documentation for your library isn't as straightforward as you would like, please do share your feedback with us.

See full changelog

Additions

  • Source code rendering (@Julow, @panglesd, @jonludlam #909, #996, #993, #982)
  • Handle tables markup (@panglesd, @gpetiot, #893)
  • Initial support for assets (@trefis, #975)
  • odoc-parser remerged (@jonludlam, #973) This includes table support (@gpetiot, @panglesd, ocaml-doc/odoc-parser#11 ocaml-doc/odoc-parser#14) and delimited code blocks with optional output (@jonludlam, ocaml-doc/odoc-parser#17)
  • Add a tooltip to references with text (@Julow, #945)
  • Add emoji to alerts in CSS (@yawaramin, #928)
  • Add common language in shipped highlightjs (@Julow, #953)

Bugfixes

  • Fix --hidden not always taken into account (@panglesd, #940)
  • Syntax highlight labels in function arguments (@panglesd, #990)
  • Ensure generated html ends with a newline (@3Rafal, #954)
  • Warn against tags in pages (@Julow, #948)
  • Remove unhelpful 'Unresolved_apply' errors (@gpetiot, #946)
  • Allow links and references in headings (@EmileTrotignon, @panglesd, #942)
  • Fix rendering of method types (@zoggy, #935)
  • Fix section labelling with submodules (@EmileTrotignon, @panglesd, #931)
  • LaTeX backend fixes (@Octachron, #921 #920)
  • html: Remove extra space in class declarations (@Julow, #936)
  • Fix rendering of unresolved references (@Julow, #957)

MDX 2.3.1

We are happy to announce the release of MDX 2.3.1! This is the first release of MDX to be compatible with OCaml 5.1.

We've also vendored the odoc-parser library, eliminating the need to have it as a dependency. MDX can now be installed independently of the odoc version you're using.

See full changelog

Added

  • Add os_type label to enable/disable based on Sys.os_type (#433, @polytypic)

  • Make MDX compatible with OCaml 5.1 (#435, @polytypic and @kit-ty-kate)

Changed

  • Vendored the odoc-parser library, removing the need to have it as a dependency. (#430, @jonludlam)

Merlin 4.12 is a small patch release fixing regressions introduced in previous versions.

See full changelog
  • merlin binary
    • Fix issue with let operators and tuples (ocaml/merlin#1684, fixes ocaml/merlin#1683, fixes ocaml/ocaml-lsp#1182)
    • Fix an issue causing Merlin locate queries to hang (ocaml/merlin#1686, fixes ocaml/ocaml-lsp#1192)

We are pleased to announce the release of Merlin 4.11 for OCaml 4.14.1, 5.0, and 5.1.

This release brings official support for OCaml 5.1 and introduces some changes to Emacs' default bindings proposed by the community:

  • Unbind C-c C-r (to avoid shadowing tuareg-eval-region) and bind C-c C-v instead to merlin-error-check;
  • Rebind C-c C-d to merlin-document and bind C-c M-d and C-c | instead to merlin-destruct;
  • Bind C-u C-c C-t to merlin-type-expr.

Thanks to everyone involved!

See full changelog
  • Merlin binary
    • Improve error messages for missing configuration reader (ocaml/merlin#1669)
    • Fix regression causing crash when using PPXs under Windows (ocaml/merlin#1673)
    • Fix confusion between aliased modules and module types (ocaml/merlin#1676, fixes ocaml/merlin#1667)
    • Ignore hidden branches when listing occurrences (ocaml/merlin#1677, fixes ocaml/merlin#1671)
  • Editor modes
    • Emacs: fix/improve keybindings (ocaml/merlin#1668, fixes ocaml/merlin#1386): Unbind C-c C-r (to avoid shadowing tuareg-eval-region) and bind C-c C-v instead to merlin-error-check; rebind C-c C-d to merlin-document and bind C-c M-d and C-c | instead to merlin-destruct; bind C-u C-c C-t to merlin-type-expr.
    • Emacs: remove use of obsolete defadvice macro (ocaml/merlin#1675)

We are pleased to announce the release of OCamlFormat 0.26.1!

This is the first OCamlFormat release to be compatible with OCaml 5.1.

We highlight notable formatting improvements below:

  1. Removal of extra breaks in constructor declarations
 type t =                               
   | Foo
   | (* Redirect (None, lib) looks up lib in the same database *)
-    Redirect of
-      db option * (Loc.t * Lib_name.t)
+    Redirect of db option * (Loc.t * Lib_name.t)
+    
  1. Consistent formatting for arrow class types, and consistent indentation of the object keyword
module type S = sig                    
-  class tttttttttttt : aaaaaaaaaaaaaaaaaa:int -> bbbbbbbbbbbbbbbbbbbbb:float ->
+  class tttttttttttt :
+    aaaaaaaaaaaaaaaaaa:int ->
+    bbbbbbbbbbbbbbbbbbbbb:float ->
    cccccccccccccccccccc
end

class type ct =
  let open M in
-  object
+object
  val x : t
end

We've also fixed a few bugs. Attributes that were previously skipped are not preserved, and we fixed a crash that occured in the presence of nested modules.

Have a look at the full changelog to see the list of improvements, and don’t hesitate to share your feedback on this release on OCaml Discuss.

See full changelog

Changed

  • Compatible with OCaml 5.1.0 (#2412, @Julow) The syntax of let-bindings changed sligthly in this version.
  • Improved ocp-indent compatibility (#2428, @Julow)
  • * Removed extra break in constructor declaration with comment (#2429, @Julow)
  • * De-indent the object keyword in class types (#2425, @Julow)
  • * Consistent formatting of arrows in class types (#2422, @Julow)

Fixed

  • Fix dropped attributes on a begin-end in a match case (#2421, @Julow)
  • Fix dropped attributes on begin-end in an if-then-else branch (#2436, @gpetiot)
  • Fix non-stabilizing comments before a functor type argument (#2420, @Julow)
  • Fix crash caused by module types with nested with module (#2419, @Julow)
  • Fix ';;' formatting between doc-comments and toplevel directives (#2432, @gpetiot)

We're thrilled to announce the release of Merlin 4.10, which comes with many bug fixes and improvements.

One of the standout features of this release is the significantly enhanced support for binding operators like let+ and and+. You'll find that the results from type-enclosing on expressions that contain let bindings are now more precise.

See full changelog
  • merlin binary
    • Constrain socket path buffer size to avoid build warnings (#1631)
    • Handle concurrent server start (#1622)
    • Omit module prefixes for constructors and record fields in the construct command (#1618). Prefixes are still produced when warning 42 (disambiguated name) is active.
    • Correctly invalidate PPX cache when pipeline ran partially (#1650, fixes #1647)
    • Prevent short-path from looping in some cases related to recursive type definitions (#1645)
    • Support parsing negative numbers in sexps (#1655)
    • Fix construct not working with inline records (#1658)
    • Improve behavior of type-enclosing on let/and operators (#1653)
    • Fix occurrences of extension constructors (#1662)
    • Improve node selection when ghosts are present (#1664, fixes #1660)
  • editor modes
    • emacs: call merlin-client-logger with "interrupted" if the merlin binary itself is interrupted, not just the parsing of the result (#1626).
    • emacs: merlin-construct, with a prefix argument, now includes local values in the completion options. Alternatively, this behavior can be enabled permanently by customizing merlin-construct-with-local-values (#1644)
    • emacs: add support for opam-switch-mode (#1654, fixes #1591). See https://github.com/ProofGeneral/opam-switch-mode

Odoc 2.2.1

As OCaml 5.1 is on the horizon, we're excited to announce the release of odoc 2.2.1. This latest version brings compatibility with the upcoming OCaml 5.1 release.

See full changelog

Additions

  • OCaml 5.1.0 compatibility (@Octachron, #956)

Dune 3.9.3

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

See full changelog

Fixes

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

Dune 3.10.0

We're happy to announce the release of Dune 3.10.0. It comes with some internal fixes as well as some interesting features:

  • some changes in dune describe that will allow a better implementation of opam-dune-lint to check the consistency between library and package dependencies
  • more commands made available under dune show for a more consistent command line interface
See full changelog

Added

  • Add dune show rules as alias of the dune rules command. (#8000, @Alizter)

  • Add dune show installed-libraries as an alias of the dune installed-libraries command. (#8135, @Alizter)

  • Add dune build --dump-gc-stats FILE argument to dump garbage collection stats to a named file. (#8072, @Alizter)

  • Add dune describe package-entries to print all package entries (#7480, @moyodiallo)

Fixed

  • Fix %{deps} to expand properly in (cat ...) when containing 2 or more items. (#8196, @Alizter)

  • Fix the severity of error messages sent over RPC which was missing. (#8193, @Alizter)

  • Fix bug with ppx and Reason syntax due to missing dependency in sandboxed action (#7932, fixes #7930, @Alizter)

Changed

  • Improve dune describe external-lib-deps by adding the internal dependencies for more information. (#7478, @moyodiallo)

  • Re-enable background file digests on Windows. The files are now open in a way that prevents race condition around deletion. (#8262, fixes #8268, @emillon)

Feedback on this post is welcomed on Discuss!

We are happy to announce the second alpha release of opam 2.2.0. It contains some fixes and a new feature for Windows. You can view the full list in the release note.

This version is an alpha. so we invite users to test it for previously unnoticed bugs to head towards the stable release.

Windows Support

The first alpha came with native Windows compatibility. This second alpha comes with a simpler initialisation for Windows: we no longer rely on an already present Cygwin UNIX-like environment for Windows as a compatibility layer. During initialisation, opam now proposes to embed its own fully managed Cygwin install.

The main opam-repository Windows compliance is still a work in progress. We recommend using an existing, compatible repository (originally from @fdopen) and 32/64 bit mingw-w64 packages (by @dra27).

How to Test opam on Windows

This alpha requires a preexisting Cygwin installation for compiling opam.

  1. Check that you have all dependencies installed:
  • autoconf, make, patch, curl
  • MinGW compilers: mingw64-x86_64-gcc-g++, mingw64-i686-gcc-g++
  • If you want to use the MSVC port of OCaml, you'll need to install Visual Studio or Visual Studio Build Tools
  1. Download & extract the opam archive
  2. In the directory launch make cold
  3. A coffee later, you now have an opam executable!
  4. Start your preferred Windows terminal (cmd or PowerShell), and initialise opam with the Windows sunset repository:
  • opam init https://github.com/ocaml-opam/opam-repository-mingw

From here, you can try to install the sunset repository packages. If you find any bugs, please submit an issue. It will help opam-repository maintainers to add Windows repository packages into the main repository.

Hint: if you use the MinGW compiler, don't forget to add to your PATH the path to libc dlls (usually C:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\bin). You can also compile opam with make cold CONFIGURE_ARGS=--with-private-runtime, and if you change opam's location, don't forget to copy Opam.Runtime.amd64 (or Opam.Runtime.i386) with it.

Updates & Fixes

  • opam var now has a more informative error message in case of package variable
  • opam lint: update Error 29 on package variables on filters to check also conflicts: field
  • opam admin lint cleans output when called not from a terminal
  • configure throws an error if no complementary compiler is found on Windows

Try It!

In case you plan a possible rollback, you may want to first backup your ~/.opam directory.

The upgrade instructions are unchanged:

  1. Either from binaries, run

    bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) --version 2.2.0~alpha2"
    

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

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

Dune 3.9.2

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

See full changelog

Fixes

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

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

We are thrilled to announce the release of OCamlFormat 0.26.0!

After almost 5 months of intense development, this release comes with a ton of consistency improvements and bug fixes. In particular, the handling of comments should be largely superior!

Have a look at the full changelog to see the list of improvements, and don't hesitate to share your feedback on this release on OCaml Discuss.

See full changelog

Items marked with an asterisk (*) are changes that are likely to format existing code differently from the previous release when using the default profile.

New features

  • Handle short syntax for generative functor types (#2348, @gpetiot)
  • Improved error reporting for unstable or dropped comments (#2292, @gpetiot)

Removed

  • Remove --numeric feature (#2333, #2357, @gpetiot)

Bug fixes

  • Fix crash caused by let f (type a) :> a M.u = .. (#2399, @Julow)
  • Fix crash caused by module T = (val (x : (module S))) (#2370, @Julow)
  • Fix invalid formatting of then begin end (#2369, @Julow)
  • Protect match after fun _ : _ -> (#2352, @Julow)
  • Fix invalid formatting of (::) (#2347, @Julow)
  • Fix indentation of module-expr extensions (#2323, @gpetiot)
  • * Remove double parentheses around tuples in a match (#2308, @Julow)
  • * Remove extra parentheses around module packs (#2305, @Julow, @gpetiot)
  • Fix indentation of trailing double-semicolons (#2295, @gpetiot)
  • Fix formatting of comments in "disable" chunks (#2279, @gpetiot)
  • Fix non-stabilizing comments attached to private/virtual/mutable keywords (#2272, #2307, @gpetiot, @Julow)

Changes

  • Improve formatting of doc-comments (#2338, #2349, #2376, #2377, #2379, #2378, @Julow) Remove unnecessary escaping and preserve empty lines.
  • * Indent as-patterns that have parentheses (#2359, @Julow)
  • Don't print warnings related to odoc code-blocks when '--quiet' is set (#2336, #2373, @gpetiot, @Julow)
  • * Improve formatting of module arguments (#2322, @Julow)
  • * Don't indent attributes after a let/val/external (#2317, @Julow)
  • Consistent indentation of @@ let+ x = ... (#2315, #2396, @Julow) It was formatted differently than @@ let x = ....
  • * Improve formatting of class expressions and signatures (#2301, #2328, #2387, @gpetiot, @Julow)
  • * Consistent indentation of fun (type a) -> following fun x -> (#2294, @Julow)
  • * Restore short-form formatting of record field aliases (#2282, #2388, @gpetiot, @Julow)
  • * Restore short-form for first-class modules: ((module M) : (module S)) is formatted as (module M : S)) (#2280, #2300, @gpetiot, @Julow)
  • * Improve indentation of ~label:(fun ... (#2271, #2291, #2293, #2298, #2398, @Julow) The fun keyword is docked where possible and the arguments are indented to avoid confusion with the body.
  • JaneStreet profile: treat comments as doc-comments (#2261, #2344, #2354, #2365, #2392, @gpetiot, @Julow)
  • Tweaks the JaneStreet profile to be more consistent with ocp-indent (#2214, #2281, #2284, #2289, #2299, #2302, #2309, #2310, #2311, #2313, #2316, #2362, #2363, @gpetiot, @Julow)

Utop 2.13.1

The release of UTop 2.13.0 introduced a regression on Windows. We're releasing UTop 2.13.1 with a patch, and made UTop 2.13.0 unavailable on Windows.

See full changelog
  • Fix unavailable expunge on Windows (#447, @jonahbeckford)

Dune 3.9.1

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

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

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

See full changelog

Fixes

  • Disable background operations and threaded console on macOS and other Unixes where we rely on fork. (#8100, #8121, fixes #8083, @rgrinberg, @emillon)

  • Initialize async I/O thread lazily. (#8122, @emillon)

Utop 2.13.0

We're releasing version 2.13.0 of UTop! This version comes with a couple of bug fixes.

It also bumps the minimal required version of OCaml to 4.11.0 and removes deprecated values from the API.

See full changelog
  • Fix behavior of utop -stdin (#434, fixes #433, @tuohy)

  • Handle bounds with Zed.next_error (#442, @tmattio)

  • Load files from XDG directories (the legacy paths still work). (#431, @Skyb0rg007)

  • Remove deprecated values prompt_continue, prompt_comment, smart_accept, new_prompt_hooks, at_new_prompt (#427, @emillon)

  • Require OCaml 4.11.0 or newer. (#444, @emillon)

Feedback on this post is welcomed on Discuss!

We are happy to announce the alpha release of opam 2.2.0. It contains numerous fixes, enhancements, and updates; including much-improved Windows support, addressing one of the most important pain points identified by the OCaml community. You can view the full list of changes in the release note.

This alpha release is a significant milestone, brought together by Raja Boujbel after years of work from the opam dev team (Raja Boujbel, David Allsopp, Kate Deplaix, Louis Gesbert, in a united OCamlPro/Tarides collaboration) with the help of many community contributors. We also thank Jane Street for their continued sponsorship.

This version is an alpha, so we invite users to test it to spot previously unnoticed bugs and work towards a stable release.

Windows Support

Opam 2.2 comes with native Windows compatibility. You can now use opam from your preferred Windows terminal! We rely on the Cygwin UNIX-like environment for Windows as a compatibility layer, but it is possible for a package to generate native executables.

The main opam repository is not Windows compatible at the moment, but existing work on a compatible repository (originally from @fdopen) and 32/64 bit mingw-w64 packages (by @dra27) is in the process of being merged. Before the final release, we expect it to be possible to run opam init and use the main opam-repository for Windows.

How to Test opam on Windows

This alpha requires a preexisting Cygwin installation. Support for full management of a local Cygwin environment inside of opam (so that it's as transparent as possible) is queued already and should be available in 2.2.0~alpha2 as the default option.

  1. Check that you have all dependencies installed:
  • autoconf, make, patch, curl
  • MinGW compilers: mingw64-x86_64-gcc-g++, mingw64-i686-gcc-g++
  • Or if you want to use the MSVC port of OCaml, you'll need to install Visual Studio or Visual Studio Build Tools
  1. Download & extract the opam archive
  2. In the directory launch make cold
  3. A coffee later, you now have an opam executable!
  4. Start your preferred Windows terminal (cmd or PowerShell), and initialise opam with the Windows sunset repository:
  • opam init https://github.com/ocaml-opam/opam-repository-mingw

From here, you can try to install sunset repository packages. If any bug is found, please submit an issue. It will help opam repository maintainers to add Windows repository packages into the main repository.

Hint: if you use the MinGW compiler, don't forget to add to your PATH the path to libc dlls (usually C:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\bin). Or compile opam with make cold CONFIGURE_ARGS=--with-private-runtime, and if you change opam location, don't forget to copy Opam.Runtime.amd64 (or Opam.Runtime.i386) with it.

Recursive Pin

When installing or pinning a package using opam install or opam pin, opam normally only looks for opam files at the root of the installed package. With recursive pinning, you can now instruct opam to also look for .opam files in subdirectories, while maintaining the correct relationship between the .opam files and the package root for versioning and build purposes.

Recursive pinning is used with the following options to opam pin and opam install:

  • With --recursive, opam will look for .opam files recursively in all subdirectories.
  • With --subpath <path>, opam will only look for .opam files in the subdirectory <path>.

The two options can be combined: for instance, if your opam packages are stored as a deep hierarchy in the mylib subdirectory of your project, give opam pin . --recursive --subpath mylib a try!

You can use these options with opam pin, opam install, and opam remove.

$ tree .
.
├── ba
│   └── z
│       └── z.opam
├── bar
│   └── bar.opam
└── foo.opam

$ opam pin . --subpath ba/z --no-action
Package z does not exist, create as a NEW package? [y/n] y
z is now subpath-pinned to directory /ba/z in git+file:///tmp/recpin#master (version 0.1)

$ opam pin --recursive . --no-action
This will pin the following packages: foo, z, bar. Continue? [y/n] y
foo is now pinned to git+file:///tmp/recpin#master (version 0.1)
Package z does not exist, create as a NEW package? [y/n] y
z is now subpath-pinned to directory /ba/z in git+file:///tmp/recpin#master (version 0.1)
Package bar does not exist, create as a NEW package? [y/n] y
bar is now subpath-pinned to directory /bar in file:///tmp/recpin (version 0.1)

$ opam pin
bar.0.1  (uninstalled)  rsync  directory /bar in file:///tmp/recpin
foo.0.1  (uninstalled)  git    git+file:///tmp/recpin#master
z.0.1    (uninstalled)  git    directory /ba/z in git+file:///tmp/recpin#master

$ opam pin . --recursive --subpath ba/ --no-action
Package z does not exist, create as a NEW package? [y/n] y
z is now subpath-pinned to directory /ba/z in git+file:///tmp/recpin#master (version 0.1)

Tree View

opam tree shows packages and their dependencies with a tree view. It is very helpful to determine which packages bring which dependencies in your installed switch.

$ opam tree cppo
cppo.1.6.9
├── base-unix.base
├── dune.3.8.2 (>= 1.10)
│   ├── base-threads.base
│   ├── base-unix.base [*]
│   └── ocaml.4.14.1 (>= 4.08)
│       ├── ocaml-base-compiler.4.14.1 (>= 4.14.1~ & < 4.14.2~)
│       └── ocaml-config.2 (>= 2)
│           └── ocaml-base-compiler.4.14.1 (>= 4.12.0~) [*]
└── ocaml.4.14.1 (>= 4.02.3) [*]

It can also display a reverse-dependency tree (through opam why, which is an alias to opam tree --rev-deps). This is useful to examine how dependency versions get constrained.

$ opam why cmdliner
cmdliner.1.2.0
├── (>= 1.1.0) b0.0.0.5
│   └── (= 0.0.5) odig.0.0.9
├── (>= 1.1.0) ocp-browser.1.3.4
├── (>= 1.0.0) ocp-indent.1.8.1
│   └── (>= 1.4.2) ocp-index.1.3.4
│       └── (= version) ocp-browser.1.3.4 [*]
├── (>= 1.1.0) ocp-index.1.3.4 [*]
├── (>= 1.1.0) odig.0.0.9 [*]
├── (>= 1.0.0) odoc.2.2.0
│   └── (>= 2.0.0) odig.0.0.9 [*]
├── (>= 1.1.0) opam-client.2.2.0~alpha
│   ├── (= version) opam.2.2.0~alpha
│   └── (= version) opam-devel.2.2.0~alpha
├── (>= 1.1.0) opam-devel.2.2.0~alpha [*]
├── (>= 0.9.8) opam-installer.2.2.0~alpha
└── user-setup.0.7

Special thanks to @cannorin for contributing this feature.

Recommended Development Tools

There is now a way for a project maintainer to share their project development tools: the with-dev-setup dependency flag. It is used in the same way as with-doc and with-test: by adding a {with-dev-setup} filter after a dependency. It will be ignored when installing normally, but it's pulled in when the package is explicitely installed with the --with-dev-setup flag specified on the command line. The variable is also resolved in the post-messages: field to allow maintainers to share more informations about that setup.

This is typically useful for tools that are required for bootstrapping or regenerating artifacts.

For example

opam-version: "2.0"
depends: [
  "ocaml"
  "dune"
  "ocp-indent" {with-dev-setup}
]
build: [make]
install: [make "install"]
post-messages:
[ "Thanks for installing the package"
  "and its tool dependencies too, it will help for your futur PRs" {with-dev-setup} ]

Software Heritage Binding

Software Heritage is a project that aims to archive all software source code in existence. This is done by collecting source code with a loader that uploads software source code to the Software Heritage distributed infrastructure. From there, any project/version is available via the search webpage and via a unique identifier called the SWHID. Some OCaml source code is already archived, and the main opam and Coq repository packages are continuously uploaded.

Opam now integrates a fallback to Software Heritage archive retrieval, based on SWHID. If an SWHID URL is present in an opam file, the fallback can be activated.

To keep backwards compatibility of opam files, we added a specific Software Heritage URL syntax to the url.mirrors: field, which is used to specify mirrors of the main URL. Opam 2.2.+ understands this specific syntax as a Software Heritage fallback URL: https://swhid.opam.ocaml.org/<SWHID>.

url {
  src: "https://faili.ng/url.tar.gz"
  checksum: "sha512=e2146c1d7f53679fd22df66c9061b5ae4f8505b749513eedc67f3c304f297d92e54f5028f40fb5412d32c7d7db92592eacb183128d2b6b81d10ea716b7496eba"
  mirrors: [
    "https//failli.ng/mirror.tar.gz"
    "https://swhid.opam.ocaml.org/swh:1:dir:9f2be900491e1dabfc027848204ae01aa88fc71d"
  ]
}

To add a Software Heritage fallback URL to your package, use the swhid library. Specifically the Compute.directory_identifier_deep function:

  1. Download opam package archive
  2. Extract the archive
  3. Compute SWHID with Compute.directory_identifier_deep. You can use this oneliner in the directory:
ocaml -e '#use "topfind";; #require "digestif.ocaml";; #require "swhid";; Swhid_core.Object.pp Format.std_formatter (Result.get_ok (Swhid.Compute.directory_identifier_deep "."))'

Special thanks to @zapashcanon for collaborating on this feature.

Formula (Experimental)

It is now possible to leverage the full expressivity of package dependency formulas from the command line during switch creation and package operations.

It is possible to create a switch using a formula. For example, with ocaml-variant or ocaml-system, excluding ocaml-base-compiler:

opam switch create ocaml --formula '"ocaml-variants" {>= "4.14.1"} | "ocaml-system"'

This syntax is brought to install commands. For example, while installing a package, let's say genet, you can specify that you want to install either conf-mariadb & mariadb or conf-postgresql:

opam install genet --formula '["mysql" ("conf-mariadb" & "mariadb" | "conf-postgresql")]'

New Options

Here are several of new options (possibly scripts breaking changes are marked with ✘):

  • opam pin --current to fix a package to its current state (disabling pending reinstallations or removals from the repository). The installed package will be pinned with the opam file that is stored in opam internal state, the one that is currently installed.

  • opam pin remove --all to remove all the pinned packages from a switch.

  • opam pin remove pkg.version now removes the pins on pinned pkg.version.

  • opam exec --no-switch to remove opam environment from launched command.

$ export FOOVAR=env
$ opam show foo --field setenv
FOOVAR = "package"
$ opam exec  -- env | grep "OPAM_SWITCH\|FOO"
FOOVAR=package
OPAM_SWITCH_PREFIX=~/.opam/env
$ opam exec --no-switch -- env | grep "OPAM_SWITCH\|FOO"
FOOVAR=env
  • opam source --no-switch to allow downloading package sources without having an installed switch (instead of failing).

  • opam clean --untracked to remove untracked files interactively remaining from previous packages removal.

  • opam switch -, inspired from git switch -, that goes back to the previously selected global switch.

  • opam admin add-constraint <cst> --packages pkg1,pkg2,pkg3 to select a subset of packages to apply constraints.

  • ✘ Change --base into --invariant. opam switch compiler column now contains installed packages that verifies invariant formula, and empty synopsis shows switch invariant.

$ opam switch create inv --formula '["ocaml" {>= "4.14.1"} "dune"]'
$ opam switch invariant
["ocaml" {>= "4.14.1"} "dune"]
$ opam list --invariant
# Packages matching: invariant
# Name # Installed # Synopsis
dune   3.8.2       Fast, portable, and opinionated build system
ocaml  5.0.0       The OCaml compiler (virtual package)
$ opam switch list
#  switch   compiler                                            description
→  inv      ocaml-base-compiler.5.0.0,ocaml-options-vanilla.1   ocaml >= 4.14.1 & dune

Try It!

In case you plan a possible rollback, you may want to first backup your ~/.opam directory.

The upgrade instructions are unchanged:

  1. From binaries: run
bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) --version 2.2.0~alpha"

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

  1. From source, manually: see the instructions in the README.

Then run:

opam init --reinit -ni

Please report any issues to the bug-tracker.

Thanks for trying this new release out, and we're hoping you will enjoy the new features!

Dune 3.9.0

The Dune team is thrilled to announce the release of Dune 3.9.0. This version ships with a host of new features and improvements, including:

  • New dune show Command: This command enables you to display various pieces of information. For instance, you can use dune show pp to display the preprocessed output of a file or dune show aliases [DIR] to list the aliases available in DIR. Read more about the command on its manpage using dune show --help.
  • Improved Dialect Support: We have rolled out several fixes related to dialect support. These changes make it easier to work with Dream's .eml files.
  • Introduction of (build_if) Toggle in (test) Stanza: This new field facilitates the packaging of non-portable tests and benchmarks. If you have tests that don't build on a specific platform, you can now tell Dune not to build them on other Platforms with the build_if field.

Enjoy the new features and improvements incorporated into this version!

See full changelog

Added

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

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

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

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

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

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

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

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

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

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

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

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

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

Changed

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

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

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

Fixed

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

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

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

Removed

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

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

Dune 3.8.3

This point release fixes two important issues on Windows and Linux.

See full changelog
  • Fix deadlock on Windows (dune#8044, @nojb)
  • When using sendfile to copy files on Linux, fall back to the portable version if it fails at runtime for some reason (NFS, etc). (dune#8049, fixes dune#8041, @emillon)

We're excited to announce the release of Dune-release 2.0.0!

This release brings support for putting your .opam files in a opam/ directory. If your project contains dozens of packages, you'll be able to generate them into the opam/ folder starting with Dune 3.8 using (opam_file_location inside_opam_directory) in your dune-project.

Another notable change is the removal of delegates. Users of dune-release who want to publish their packages to another platform than GitHub can now use the dune-release delegate-info and use the output to build their own publication workflows.

See full changelog

Added

  • Adopt the OCaml Code of Conduct (#473, @rikusilvola)
  • Added support for projects that have their OPAM files in the opam/ subdirectory. (#466, @Leonidas-from-XIV)

Changed

  • Running dune-release check now attempts to discover and parse the change log, and a new flag --skip-change-log disables this behaviour. (#458, @gridbugs)
  • List the main package and amount of subpackages when creating the PR to avoid very long package lists in PRs (#465, @emillon)

Fixed

  • Avoid collision between branch and tag name. Tag detection got confused when branch was named the same as tag. Now it searches only for tag refs, instead of all refs. (#452, @3Rafal)
  • Fix project name detection from dune-project. The parser could get confused when opam file generation is used. Now it only considers the first (name X) in the file. (#445, @emillon)

Removed

  • Remove support for delegates. Previous users of this feature should now use dune-release delegate-info and wrap dune-release calls in a script. See #188 for details. (#428, @NathanReb)
  • Removed support for the OPAM 1.2.2 client. This means dune-release expects the opam binary to be version 2.0 at least. (#406, #411, @Leonidas-from-XIV)

We've released OCaml LSP 1.16.2 with a fix that was introduced in 1.16.1 that prevented users from using preprocessor such as CPPO.

See full changelog

Fixes

  • Fix file permissions used when specifying output files of pp and ppx. (ocaml-lsp#1153)

We're thrilled to announce the release of OCaml LSP 1.16.1! 🎉

This release comes with new "Extract local" and "Extract function" code actions to easily refactor your code.

We've also disabled code lenses by default following user feedback. You can follow the discussion on GitHub.

This release is also the first OCaml LSP release to use upstream Merlin. Among other things, this means that it is compatible with all the OCaml versions supported by Merlin: currently OCaml 4.14 and 5.0.0.

We're also releasing numerous bug fixes, including:

  • A fix to the integration with Dune RPC on Windows, which, alongside Dune 3.9.0, makes OCaml LSP report Dune errors to the editors with Dune watch mode enabled.
  • Minor improvements to the Odoc <-> Markdown conversion to return better function documentation on the editor.

And much more! Read the full changelog for a complete list of improvements and bug fixes.

See full changelog

Features

  • Add "Remove type annotation" code action. (#1039)
  • Support settings through didChangeConfiguration notification (#1103)
  • Add "Extract local" and "Extract function" code actions. (#870)
  • Depend directly on merlin-lib 4.9 (#1070)

Fixes

  • Support building with OCaml 5.0 and 5.1 (#1150)

  • Disable code lens by default. The support can be re-enabled by explicitly setting it in the configuration. (#1134)

  • Fix initilization of ocamlformat-rpc in some edge cases when ocamlformat is initialized concurrently (#1132)

  • Kill unnecessary $ dune ocaml-merlin with SIGTERM rather than SIGKILL (#1124)

  • Refactor comment parsing to use odoc-parser and cmarkit instead of octavius and omd (#1088)

    This allows users who migrated to omd 2.X to install ocaml-lsp-server in the same opam switch.

    We also slightly improved markdown generation support and fixed a couple in the generation of inline heading and module types.

  • Allow opening documents that were already open. This is a workaround for neovim's lsp client (#1067)

  • Disable type annotation for functions (#1054)

  • Respect codeActionLiteralSupport capability (#1046)

  • Fix a document syncing issue when utf-16 is the position encoding (#1004)

  • Disable "Type-annotate" action for code that is already annotated. (#1037, fixes #1036)

  • Fix semantic highlighting of long identifiers when using preprocessors (#1049, fixes #1034)

  • Fix the type of DocumentSelector in cram document registration (#1068)

  • Accept the --clientProcessId command line argument. (#1074)

  • Accept --port as a synonym for --socket. (#1075)

  • Fix connecting to dune rpc on Windows. (#1080)

Dune 3.8.2

We've released Dune 3.8.2 with a few bug fixes.

See full changelog
  • Switch back to threaded console for all systems; fix unresponsive console on Windows (dune#7906, @nojb)
  • Respect -p / --only-packages for melange.emit artifacts (dune#7849, @anmonteiro)
  • Fix scanning of Coq installed files (@ejgallego, reported by @palmskog, dune#7895 , fixes dune#7893)
  • Fix RPC buffer corruption issues due to multi threading. This issue was only reproducible with large RPC payloads (dune#7418)
  • Fix printing errors from excerpts whenever character offsets span multiple lines (dune#7950, fixes dune#7905, @rgrinberg)

Dune 3.8.1

We've just released a patch version of Dune to fix regressions introduced in Dune 3.8.0.

In particular, we've reverted some cross-compilation improvements that caused build failures when using ppx_runtime_libraries and we'll revisit them in a future version of Dune.

See full changelog
  • Fix a crash when using a version of Coq < 8.13 due to the native compiler config variable being missing. We now explicitly default to (mode vo) for these older versions of Coq. (dune#7847, fixes dune#7846, @Alizter)
  • Duplicate installed Coq theories are now allowed with the first appearing in COQPATH being preferred. This is inline with Coq's loadpath semantics. This fixes an issue with install layouts based on COQPATH such as those found in nixpkgs. (dune#7790, @Alizter)
  • Revert dune#7415 and dune#7450 (Resolve ppx_runtime_libraries in the target context when cross compiling) (dune#7887, fixes dune#7875, @emillon)

opam 2.1.5

Feedback on this post is welcomed on Discuss!

We are pleased to announce the patch release of opam 2.1.5.

This opam release consists of backported bug & security fixes:

  • Security issue: fix opam installing packages without checking their checksum when the local cache is corrupted in some case (#5538), you can find more information there.
  • Variables are now expanded in build-env (as for setenv) (#5352)
  • Correctly handle empty environment variable additions (#5350)
  • Skip empty environment variable additions (#5350)
  • Fix passing archive-mirrors field from init config file to config (#5315)
  • git, hg: Use the full SHA1 revision instead of just the 8 first characters (#5342)

Opam installation instructions (unchanged):

  1. From binaries: run

    bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) --version 2.1.5"
    

    or download manually from the Github "Releases" page to your PATH. In this case, don't forget to run opam init --reinit -ni to enable sandboxing if you had version 2.0.0~rc manually installed or to update you sandbox script.

  2. From source, using opam:

    opam update; opam install opam-devel
    

    (then copy the opam binary to your PATH as explained, and don't forget to run opam init --reinit -ni to enable sandboxing if you had version 2.0.0~rc manually installed or to update your sandbox script)

  3. From source, manually: see the instructions in the README.

We hope you enjoy this new minor version, and remain open to bug reports and suggestions.

See full changelog
  • [BUG] Variables are now expanded in build-env (as for setenv) [#5352 @dra27]
  • Correctly handle empty environment variable additions [#5350 @dra27]
  • Skip empty environment variable additions [#5350 @dra27]
  • [BUG] Fix passing archive-mirrors field from init config file to config [#5315 @hannesm]
  • git, hg: Use the full SHA1 revision instead of just the 8 first characters [#5342 @reynir]
  • [BUG] Fix opam installing packages without checking their checksum when the local cache is corrupted in some case [#5538 @kit-ty-kate]

Merlin 4.9

We are pleased to announce the release of Merlin 4.9 for OCaml 4.14.1 and 5.0.

This maintenance release brings multiple bug fixes and improvements. In particular we identified and patched an important memory consumption issue that could greatly affect Merlin’s performance in heavily functorized projects.

See full changelog
  • merlin binary
    • Allow monadic IO in dot protocol (#1581)
    • Add a scope option to the occurrences command in preparation for the upcoming project-wide-occurrences feature (#1596)
    • Construct bool-typed holes as false instead of true in the construct command, for consistency (#1599).
    • Add a hook to configure system command for spawning ppxes when Merlin is used as a library. (#1585)
    • Implement an all-or-nothing cache for the PPX phase (#1584)
    • Cleanup functors caches when backtracking, to avoid memory leaks (#1609, fixes #1529 and ocaml-lsp#1032)
    • Fix construct results ordering for sum types sand poly variants (#1603)
    • Fix object method completion not working (#1606, fixes #1575)
    • Improve context detection for package types (#1608, fixes #1607)
    • Fix incorrect locations for string literals (#1574)
    • Fixed an issue that caused errors to erroneously alert about missing cmi files (#1577)
    • Prevent destruct from crashing on closed variant types (#1602, fixes #1601)
    • Improve longident parsing (#1612, fixes #945)
  • editor modes
    • emacs: call the user's configured completion UI in merlin-construct (#1598)
  • test suite
    • Add missing dependency to a test using ppxlib (#1583)
    • Add tests for the new PPX phase cache (#1584)
    • Add and update tests for construct ordering (#1603)

Dune 3.8.0

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

It is now available in opam-repository. As usual, it should always be safe to upgrade your dune package: new features and deprecations are only available if you upgrade the language version in your dune-project files.

🌟 Spotlight Features

  1. Dune concurrent action

Dune 3.8.0 introduced the new concurrent action. You can now use it instead of the progn action to execute actions concurrently.

For instance:

(rule
(action
  (concurrent
  (write-file A "I am file A.\n")
  (write-file B "I am certainly file B.\n")
  (write-file C "I am most certainly file C.\n"))))

will write to files A, B and C concurrently.

  1. Support for .mld files

In Dune 3.7.0, we introduced version 0.3 of the mdx stanza, which came with support for .mld files.

In Dune 3.8.0, .mld files are now supported by default with version 0.4 of the mdx stanza!

Have a look at this diff to see how to migrate your code to the new stanza version.

See full changelog

Added

  • Introduce mdx stanza 0.4 requiring mdx >= 2.3.0 which updates the default list of files to include *.mld files (#7582, @Leonidas-from-XIV)

  • Allow (stdlib ...) to be used with (wrapped false) in library stanzas (#7139, @anmonteiro).

  • Allow the main module of a library with (stdlib ...) to depend on other libraries (#7154, @anmonteiro).

  • Support (link_flags ...) in (cinaps ...) stanza. (#7423, fixes #7416, @nojb)

  • Allow (package ...) in any position within (rule ...) stanza (#7445, @Leonidas-from-XIV)

  • Added a new user action (concurrent ) which is like (progn ) but runs the actions concurrently. (#6933, @Alizter)

  • Accept the Ordered Set Language for the modes field in library stanzas (#6611, @anmonteiro).

  • Allow parallel execution of inline tests partitions (#7012, @hhugo)

  • Add the --display-separate-messages flag to separate the error messages produced by commands with a blank line. (#6823, fixes #6158, @esope)

  • Add --watch-exclusions to Dune build options (#7216, @jonahbeckford)

  • Adds support for loading plugins in toplevels (#6082, fixes #6081, @ivg, @richardlford)

  • Introduce a public_headers field on libraries. This field is like install_c_headers, but it allows to choose the extension and choose the paths for the installed headers. (#7512, @rgrinberg)

  • Dune can now detect Coq theories from outside the workspace. This allows for composition with installed theories (not necessarily installed with Dune). (#7047, @Alizter, @ejgallego)

  • Added a --no-build option to dune coq top for avoiding rebuilds (#7380, fixes #7355, @Alizter)

  • Add a coqdoc_flags field to the coq.theory stanza allowing the user to pass extra arguments to coqdoc. (#7676, fixes #7954 @Alizter)

  • Preliminary support for Coq compiled intefaces (.vos files) enabled via (mode vos) in coq.theory stanzas. This can be used in combination with dune coq top to obtain fast re-building of dependencies (with no checking of proofs) prior to stepping into a file. (#7406, @rlepigre)

  • Read pkg-config arguments from the PKG_CONFIG_ARGN environment variable (#1492, #7734, @anmonteiro)

  • Use $PKG_CONFIG, when set, to find the pkg-config binary (#7469, fixes #2572, @anmonteiro)

Changed

  • Bootstrap: remove reliance on shell. Previously, we'd use the shell to get the number of processors. (#7274, @rgrinberg)

  • Non-user proccesses such as version control or config checking are now run silently. (#6994, fixes #4066, @Alizter)

  • Bytecode executables built for JSOO are linked with -noautolink and no longer depend on the shared stubs of their dependent libraries (#7156, @nojb)

  • Always include opam files in the generated .install file. Previously, it would not be included whenever (generate_opam_files true) was set and the .install file wasn't yet generated. (#7547, @rgrinberg)

Deprecated

  • Modules that were declared in (modules_without_implementation), (private_modules) or (virtual_modules) but not declared in (modules) will cause Dune to emit a warning which will become an error in 3.9. (#7608, fixes #7026, @Alizter)

  • Coq language versions less 0.8 are deprecated, and will be removed in an upcoming Dune version. All users are required to migrate to (coq lang 0.8) which provides the right semantics for theories that have been globally installed, such as those coming from opam (@ejgallego, @Alizter)

Fixed

  • Find pps dependencies in the host context when cross-compiling, (#7415, fixes #4156, @anmonteiro)

  • Fix plugin loading with findlib. The functionality was broken in 3.7.0. (#7556, @anmonteiro)

  • Load the host context findlib.conf when cross-compiling (#7428, fixes #1701, @rgrinberg, @anmonteiro)

  • Allow overriding the ocaml binary with findlib configuration (#7648, @rgrinberg)

  • Resolve ppx_runtime_libraries in the target context when cross compiling (#7450, fixes #2794, @anmonteiro)

  • Fix dune install when cross compiling (#7410, fixes #6191, @anmonteiro, @rizo)

  • Fix string quoting in the json file written by --trace-file (#7773, @rleshchinskiy)

  • Correctly set MANPATH in dune exec. Previously, we would use the bin/ directory of the context. (#7655, @rgrinberg)

  • merlin: ignore instrumentation settings for preprocessing. (#7606, fixes #7465, @Alizter)

  • When a rule's action is interrupted, delete any leftover directory targets. This is consistent with how we treat file targets. (#7564, @rgrinberg)

  • Fix dune crashing on MacOS in watch mode whenever $PATH contains $PWD (#7441, fixes #6907, @rgrinberg)

  • Dune in watch mode no longer builds concurrent rules in serial (#7395 @rgrinberg, @jchavarri)

  • dune coq top now correctly respects the project root when called from a subdirectory. However, absolute filenames passed to dune coq top are no longer supported (due to being buggy) (#7357, fixes #7344, @rlepigre and @Alizter)

  • RPC: Ignore SIGPIPE when clients suddenly disconnect (#7299, #7319, fixes #6879, @rgrinberg)

  • Always clean up the UI on exit. (#7271, fixes #7142 @rgrinberg)

  • Bootstrap: correctly detect the number of processors by allowing nproc to be looked up in $PATH (#7272, @Alizter)

  • Speed up file copying on macos by using clonefile when available (@rgrinberg, #7210)

  • Support commands that output 8-bit and 24-bit colors in the terminal (#7188, @Alizter)

  • Speed up rule generation for libraries and executables with many modules (#7187, @jchavarri)

  • Do not re-render UI on every frame if the UI doesn't change (#7186, fix #7184, @rgrinberg)

  • Make coq_db creation in scope lazy (@ejgallego, #7133)

  • dune install now respects --display quiet mode (#7116, fixes #4573, fixes #7106, @Alizter)

  • Stub shared libraries (dllXXX_stubs.so) in Dune-installed libraries could not be used as dependencies of libraries in the workspace (eg when compiling to bytecode and/or Javascript). This is now fixed. (#7151, @nojb)

  • Fix regression where Merlin was unable to handle filenames with uppercase letters under Windows. (#7577, @nojb)

  • On nix+macos, pass -f to the codesign hook to avoid errors when the binary is already signed (#7183, fixes #6265, @greedy)

  • Fix bug where RPC clients built with dune-rpc-lwt would crash when closing their connection to the server (#7581, @gridbugs)

  • Fix RPC server on Windows (used for OCaml-LSP). (#7666, @nojb)

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