OCaml Changelog

RSS

Read the latest releases and updates from the OCaml ecosystem.

Utop 2.12.0

UTop 2.12.0 is out with support for the upcoming release of OCaml 5.1!

This release also fixes an issue that prevented users to redefine the () constructor. You can now safely run type t = () of unit and continue using your top-level session.

See full changelog
  • Add support for OCaml 5.1 (#421, @emillon)

  • Mark prompt_continue, prompt_comment, smart_accept, new_prompt_hooks, at_new_prompt as deprecated (they have been documented as such since 2012 and most of them are ignored) (#415, @emillon)

  • Qualify () constructor in generated expressions. (#418, fixes #417, @emillon)

Mdx 2.3.0

We're pleased to announce the release of Mdx 2.3.0!

This release comes with support for mld files and changes the parser used by the toplevel, which allows Camlp5's parser to be used with MDX.

🌟 Spotlight Feature

Starting in MDX 2.3.0, you can now execute code blocks in your .mld files! 🎉

As a reminder, .mld files are text files similar to Markdown, but instead of using the Markdown markup language, they use the Ocamldoc markdown language - as is used in .mli files. .mld are typically used to write manuals with odoc.

To run mdx on .mld files, start by enabling mdx in your dune-project:

(using mdx 0.3)

Then list your .mld files in the mdx stanza in your dune:

(mdx
 (files index.mld))

Now if you put a code block in index.mld, it will be executed when running dune test and if dune will suggest to promote the output. For instance, if you run dune test with this index.mld:

Here's an example code block in a [.mld] file:

{[
  # List.map (fun x -> x * x) [(1 + 9); 2; 3; 4];;
]}

dune test will return:

diff --git a/_build/default/index.mld b/_build/default/.mdx/index.mld.corrected
index 337b042..c29bb63 100644
--- a/_build/default/index.mld
+++ b/_build/default/.mdx/index.mld.corrected
@@ -2,5 +2,6 @@ Here's an example code block in a [.mld] file:
 
 {[
   # List.map (fun x -> x * x) [(1 + 9); 2; 3; 4];;
+  - : int list = [100; 4; 9; 16]
 ]}

You can run dune promote to accept the change.

You can see a complete demo of this here.

Now you can keep the code blocks in your manual up-to-date even when your API changes!

See full changelog

Added

  • Added support for mld files (#423, @jonludlam)

Changed

  • Switch to using the parser that toplevel uses (found in a mutable ref, instead of always the official OCaml parser). This allows Camlp5's parser to be used with MDX. (#417, @chetmurthy)

Four months after the release of OCaml 5.0.0, the set of new features for the future version 5.1.0 of OCaml has been frozen. We are thus happy to announce the first alpha release for OCaml 5.1.0.

This alpha version is here to help fellow hackers join us early in our bug hunting and opam ecosystem fixing fun (see below for the installation instructions). The progresses on stabilising the ecosystem are tracked on the opam readiness for 5.1.0 meta-issue.

If you find any bugs, please report them on OCaml's issue tracker.

Note that this early alpha version is missing two important fixes for the garbage collector and Windows support. Those fixes will be available before the beta. The full release is expected in July.

If you are interested in the ongoing list of new features and bug fixes, the updated change log for OCaml 5.1.0 is available on GitHub.


Installation Instructions

The base compiler can be installed as an opam switch with the following commands on opam 2.1:

opam update
opam switch create 5.1.0~alpha1

For previous version of opam, the switch creation command line is slightly more verbose:

opam update
opam switch create 5.1.0~alpha1 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

The source code for the alpha is also available at these addresses:

Fine-Tuned Compiler Configuration

If you want to tweak the configuration of the compiler, you can switch to the option variant with:

opam update
opam switch create <switch_name> ocaml-variants.5.1.0~alpha1+options <option_list>

where option_list is a space separated list of ocaml-option-* packages. For instance, for a flambda and no-flat-float-array switch:

opam switch create 5.1.0~alpha1+flambda+nffa ocaml-variants.5.1.0~alpha1+options ocaml-option-flambda ocaml-option-no-flat-float-array

The command line above is slightly more complicated for opam version anterior to 2.1:

opam update
opam switch create <switch_name> --packages=ocaml-variants.5.1.0~alpha1+options,<option_list> --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

In both cases, all available options can be listed with opam search ocaml-option.

Due to maintenance operations on Tuesday 11th April between 7:30am and 11:00am (UTC+1), the build system will be running at approximately 50% capacity. You may experience some build delays in Opam Repo CI and OCaml CI.

Thank you for your patience and understanding during this time.

Dune 3.7.1

We are excited to announce the release of Dune 3.7.1, which brings a few bug fixes from the recent 3.7.0 release:

  • Resolved watch mode issue for executables on macOS: We have addressed a problem with the recently introduced watch mode for executables that was causing segmentation faults on macOS. Users can now enjoy a stable watch mode without unexpected crashes on macOS.
  • Fixed "Too many links" error on Windows: We have fixed an issue that caused Dune build failures with a "Too many links" error on Windows when using Dune cache.

... and a few more, you can consult the changelog for a full list of bug fixes.

See full changelog
  • Fix segfault on MacOS when dune was being shutdown while in watch mode. (#7312, fixes #6151, @gridbugs, @emillon)

  • Fix preludes not being recorded as dependencies in the (mdx) stanza (#7109, fixes #7077, @emillon).

  • Pass correct flags when compiling stdlib.ml. (#7241, @emillon)

  • Handle "Too many links" errors when using Dune cache on Windows. The fix in 3.7.0 for this same issue was not effective due to a typo. (#7472, @nojb)

The intention is to retire the ocamllabs.io domain. Therefore any services using the domain will be redirected. From today, the Web UI for Opam Repo CI is available on both opam-ci.ci3.ocamllabs.io and opam.ci.ocaml.org with the service available at both opam-repo-ci.ci3.ocamllabs.io and opam-repo.ci.ocaml.org. In time, the ocamllabs.io sites will issue HTTP 301 permanent redirect messages.

Previously, opam.ci.ocaml.org targetted a web server which issued an HTTP 302 redirect to opam.ci3.ocamllabs.io. This redirection has been removed. opam.ci.ocaml.org points to the actual site.

As previously announced, "opam-repository-mingw" is no longer receiving updates.

We're actively working on getting the Windows compiler packages into ocaml/opam-repository. There are two issues which are taking (me) a little while to finish solving, but more on that further below.

In the gap - of hopefully only a month or so - for this being ready, there's is an issue that new releases are of course not available when opam-repository-mingw is being used with ocaml/setup-ocaml@v2 GitHub actions workflows. I'm hoping here to set out what's happening, and what steps you may need to take to keep your GitHub Actions Windows workflows running smoothly over the next few months.

What's happening right now?

We've updated setup-ocaml to use ocaml-opam/opam-repository-mingw instead of fdopen/opam-repository-mingw (see ocaml/setup-ocaml#651). This clone has been augmented with:

  • OCaml 4.14.1 packages, in the same style as the 4.14.0 forked packages (the "pre-compiled" package variants exist, but they're not pre-compiled)
  • Changes to the constraints for existing packages only

If you're using setup-ocaml in its default configuration, you should notice no change except that 4.14.x builds should now use 4.14.1 and the initial build will be a little slower as it builds from sources (GitHub Actions caching will then take over for subsequent runs).

For new releases of packages, it's necessary to add opam-repository to the repositories selections for the switches. It's important that opam-repository is at a lower priority than opam-repository-mingw for existing packages, so it's better to use these lines in your ocaml/setup-ocaml@v2 step than to issue opam repo add --rank=1000 later:

uses: ocaml/setup-ocaml@v2
with:
  opam-repositories: |
    opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
    default: https://github.com/ocaml/opam-repository.git

What do I do when things are broken?

There's an issue tracker on ocaml-opam/opam-repository-mingw, and this is a very good place to start.

If a version of a package isn't building, there are three possible remedies:

  • Previous versions of the package may have carried non-upstreamed patches in opam-repository-mingw. opam-repository's policy is not to carry such patches. In this case, the package actually doesn't work on Windows.
    • opam-repository should be updated to have os != "win32" added to the available field for the package
    • An issue on the package's upstream repo should be opened highlighting the need to upstream patches (or even a pull request with them!)
    • The patches in opam-repository-mingw make changes which may not necessarily be accepted/acceptable upstream in their current form, so the issue may be a better starting point than simply taking a patch and opening a pull request for it (for example, the utop package contains patches which may require further work and review)
  • The package relies on environment changes in "OCaml for Windows". For example, the Zarith package works in "OCaml for Windows" because the compiler packages unconditionally set the CC environment variable. This change is both not particularly desirable change to upstream (it is very confusing, for example, when working on the compiler itself) and also extremely difficult to upstream, so the fix here is instead to change the package's availability with (os != "win32" | os-distribution = "cygwinports") and constrain away OCaml 5 on Windows ("ocaml" {< "5.0" | os != "win32"})
  • Package constraints on existing packages need updating in ocaml-opam/opam-repository-mingw. For example, the release of ppxlib 0.29 required some existing packages to have upperbounds added.

What about OCaml 5.0.0?

OCaml 5.0.0 was released with support for the mingw-w64 port only, however, there's a quite major bug which wasn't caught by OCaml's testsuite, but is relatively easily triggered by opam packages. I've previously announced how to add OCaml 5 to a workflow. For the time being, the packages for OCaml 5 aren't automatically made available.

What's next?

The ultimate goal is to be using an upstream build of opam.exe with ocaml/opam-repository, just as on Unix. Once opam 2.2 is generally available (we're aiming for an alpha release at the end of March) and the compiler packages in opam-repository support the Windows builds, we will recommend stopping use of opam-repository-mingw completely. The default in setup-ocaml won't change straight away, since that risks breaking existing workflows.

With upstream compiler support, we'll be able to extend some of the existing bulk build support already being done for Linux to Windows and start to close the gap of patches in opam-repository-mingw.

Windows compiler packages

I mentioned earlier the problems with moving the compiler packages into opam-repository, and just for general interest this elaborates on them.

The first issue affects the use of the Visual Studio port ("MSVC") and is a consequence of the somewhat strange way that the C compiler is added to the environment when using the Visual Studio C compiler. "OCaml for Windows" (as well as Diskuv) use a wrapper command (it's ocaml-env in "OCaml for Windows" and with-dkml in Diskuv). Those commands are Windows-specific, which is an issue for upstream opam. There's an alternate way which sets the environment variables in a more opam-like way. Doing it that way, though, requires an improvement to opam's environment handling which is in opam 2.2, otherwise there's an easy risk of "blowing" the environment.

The second issue is selecting the C compiler. On Unix, this is easy with ocaml-base-compiler because there is only one "system" C compiler. Windows has two ports of OCaml, and the configuration requires it to be explicitly selected. That requires input from the user on switch creation for a Windows switch.

"OCaml for Windows" solves this by packaging the Windows compilers with the variant name appended, just as opam-repository used to, so ocaml-variants.4.14.1+mingw64 selects the the mingw-w64 port and ocaml-variants.4.14.1+msvc64 selects the MSVC64 port. The problem, as we already had in opam-repository, is that this adds 4 packages for each release of OCaml in ocaml-variants, and leads to a combinatorial explosion when we start considering flambda and other relevant compiler options.

opam-repository switched to using the ocaml-option- packages to solve the combinatorial explosion which was already present in opam-repository. The demonstration repo for OCaml 5 on Windows is already using an adapted version of this so that ocaml-option-mingw selects the mingw-w64 port (by default 64-bit, with ocaml-option-32bit then selecting the 32-bit port).

This work is all in progress and being tested alongside changes in opam 2.2 to support the depext experience on Windows. The only reason that's not being upstreamed piecemeal is that changes to the compiler packages in opam-repository trigger switch rebuilds all over the world, so we don't want to that until we're sure that the packages are correct. The intention is to do this around the time of the alpha release of opam 2.2, once the work in opam itself has settled down.

Thanks for getting to the end, and happy Windows CI testing!

Discuss this post further on the forums.

Following @avsm post on discuss.ocaml.org, we are pleased to announce that DNS names have now been switched over.

We are moving the opam.ocaml.org 2 servers between hosting providers, and wanted to give everyone clear notice that this happening. Over the next 24-48 hours, if you notice any unexpected changes in the way your opam archives work (for example, in your CI or packaging systems), then please do let us know immediately, either here or in ocaml/infrastructure#19 2.

The reason for the move is to take advantage of Scaleway’s generous sponsorship of ocaml.org, and to use their energy efficient renewable infrastructure 4 for our machines.

This also marks a move to building the opam website via the ocurrent 1 infrastructure, which leads to faster and more reliable updates to the hosted package archives (see here for the service graph and build logs 4). There are also now multiple machines behind the opam.ocaml.org 2 DNS (via round-robin DNS), and this makes it easier for us to publish the archives to a global CDN in the future.

But in the very short term, if something explodes unexpectedly, please do let us know.

We are pleased to announce the release of OCamlFormat 0.25.1! This release contains several bug fixes, changes, and new features.

The library is also available through the ocamlformat-lib package on opam. The ocamlformat package only contains the binary.


We would like to thank all contributors for their valuable contributions to this release. Please see the complete changelog for more details.

We hope you enjoy this release and continue to find OCamlFormat a valuable tool for your OCaml projects. You can download ocamlformat.0.25.1 from the opam repository or GitHub.

Thank you for your support and feedback, and please don't hesitate to reach out if you have any questions or issues.

The OCamlFormat team

🌟 Spotlight Feature

  1. New if-then-else and break-cases options

Starting in OCamlFormat 0.25.1, we've also added new values to the if-then-else and break-cases options. Now you can use the vertical value to format these expressions in a more readable and consistent way.

These options are not set by default but you can try them out by customizing your .ocamlformat file as usual.

Here are a few examples:

  • if-then-else = vertical
-  let epi = if Option.is_some next then fmt "@\n" else fmt_opt epi in
+  let epi =
+    if Option.is_some next then
+      fmt "@\n"
+    else
+      fmt_opt epi
+  in
-    if tree_depth tree > depth then node_depth_truncate_ depth node
-    else (* already short enough; don't bother truncating *)
+    if tree_depth tree > depth then
+      node_depth_truncate_ depth node
+    else
+      (* already short enough; don't bother truncating *)
      node
  • break-cases = vertical
-| Ok (`Version | `Help) -> Stdlib.exit 0
-| Error _ -> Stdlib.exit 1
+| Ok (`Version | `Help) ->
+    Stdlib.exit 0
+| Error _ ->
+    Stdlib.exit 1
-    ~f:(function `Int _ | `Float _ -> true | _ -> false)
+    ~f:(function
+      | `Int _
+      | `Float _ ->
+          true
+      | _ ->
+          false)
  1. Formatting .mld files

Formatting .mld files as odoc documentation files is now possible! This will make it much easier to maintain high-quality documentation alongside your OCaml code.

This feature is only available in ocamlformat for now, but keep an eye on the future dune releases to know when dune fmt will be able to format your .mld files!

  1. Various improvements and bugfixes

We fixed various issues related to indentation, alignment, and comments positioning.

Here are a few examples:

  • More consistent indentation inside a parenthesized expression:
        | [ node ] ->
            ( (if List.mem node ~set:integer_graph.(node)
-              then Has_loop [ numbering.forth.(node) ]
-              else No_loop numbering.forth.(node))
+               then Has_loop [ numbering.forth.(node) ]
+               else No_loop numbering.forth.(node))
            , component_edges.(component) )
    (let open Memo.O in
-    let+ w = Dune_rules.Workspace.workspace () in
-    Dune_engine.Execution_parameters.builtin_default
-    |> Dune_rules.Workspace.update_execution_parameters w);
+     let+ w = Dune_rules.Workspace.workspace () in
+     Dune_engine.Execution_parameters.builtin_default
+     |> Dune_rules.Workspace.update_execution_parameters w);
  • More consistent formatting of module expressions:
-  module Sel = (val if is_osx () then (module Mac)
-                    else if Sys.unix then (module Unix)
-                    else (module Fail) : Unix_socket)
+  module Sel =
+    (val if is_osx () then (module Mac)
+         else if Sys.unix then (module Unix)
+         else (module Fail)
+        : Unix_socket)
See full changelog

Library

  • The declaration of options is a regular module instead of a functor. (#2193, @EmileTrotignon)

Bug fixes

  • Fix indentation when ocamlformat is disabled on an expression (#2129, @gpetiot)
  • Reset max-indent when the max-indent option is not set (#2131, @hhugo, @gpetiot)
  • Add missing parentheses around immediate objects having attributes attached in 4.14 (#2144, @gpetiot)
  • Fix dropped comment attached to the identifier of an open-expression (#2155, @gpetiot)
  • Correctly format chunks of file in presence of enable/disable floating attributes (#2156, @gpetiot)
  • Remove abusive normalization in docstrings references (#2159, #2162, @EmileTrotignon)
  • Fix parentheses around symbols in if-then-else branches (#2169, @gpetiot)
  • Preserve position of comments around variant identifiers (#2179, @gpetiot)
  • Fix parentheses around symbol identifiers (#2185, @gpetiot)
  • Fix alignment inconsistency between let-binding and let-open (#2187, @gpetiot)
  • Fix reporting of operational settings origin in presence of profiles (#2188, @EmileTrotignon)
  • Fix alignment inconsistency of if-then-else in apply (#2203, @gpetiot)
  • Fix automated Windows build (#2205, @nojb)
  • Fix spacing between recursive module bindings and recursive module declarations (#2217, @gpetiot)
  • ocamlformat-rpc: use binary mode for stdin/stdout (#2218, @rgrinberg)
  • Fix interpretation of glob pattern in .ocamlformat-ignore under Windows (#2206, @nojb)
  • Remove conf mutability, and correctly display the conventional profile when using print-config (#2233, @EmileTrotignon)
  • Preserve position of comments around type alias (#2239, @EmileTrotignon)
  • Preserve position of comments around constructor record (#2237, @EmileTrotignon)
  • Preserve position of comments around external declaration strings (#2238, @EmileTrotignon, @gpetiot)
  • Preserve position of comments around module pack expressions (#2234, @EmileTrotignon, @gpetiot)
  • Correctly parenthesize array literals with attributes in argument positions (#2250, @ccasin)
  • Janestreet: Fix indentation of functions passed as labelled argument (#2259, @Julow)

Changes

  • Indent 2 columns after initializer keyword (#2145, @gpetiot)
  • Preserve syntax of generative modules ((struct end) vs ()) (#2135, #2146, @trefis, @gpetiot)
  • Preserve syntax of module unpack with type constraint (((module X) : (module Y)) vs (module X : Y)) (#2136, @trefis, @gpetiot)
  • Normalize location format for warning and error messages (#2139, @gpetiot)
  • Preserve syntax and improve readability of indexop-access expressions (#2150, @trefis, @gpetiot)
    • Break sequences containing indexop-access assignments
    • Remove unnecessary parentheses around indices
  • Mute warnings for odoc code blocks whose syntax is not specified (#2151, @gpetiot)
  • Improve formatting of odoc links (#2152, @gpetiot)
  • Preserve sugared extension node attached to an if carrying attributes (#2167, @trefis, @gpetiot)
  • Remove unnecessary parentheses around partially applied infix operators with attributes (#2198, @gpetiot)
  • JaneStreet profile: doesn't align infix ops with open paren (#2204, @gpetiot)
  • Re-use the type let_binding from the parser instead of value_binding, improve the spacing of let-bindings regarding of having extension or comments (#2219, @gpetiot)
  • The ocamlformat package now only contains the binary, the library is available through the ocamlformat-lib package (#2230, @gpetiot)

New features

  • Add a break-colon option to decide whether to break before or after the : symbol in value binding declarations and type constraints. This behavior is no longer ensured by ocp-indent-compat. (#2149, @gpetiot)
  • Format .mld files as odoc documentation files (#2008, @gpetiot)
  • New value vertical for option if-then-else (#2174, @gpetiot)
  • New value vertical for option break-cases (#2176, @gpetiot)
  • New value wrap-or-vertical for option break-infix that only wraps high precedence infix ops (#1865, @gpetiot)

watch.ocaml.org has been updated to run as a Docker service stack rather than via docker-compose. This change allowed an OCurrent pipeline to monitor the Docker repository and update the image via docker service update when a new version is available.

We have several other services updated via OCurrent: deploy.ci.ocaml.org

In OCurrent, we can create a schedule node that triggers every seven days and invokes a docker pull, yielding the current image SHA. If this has changed, run docker service update with the new image.

  let peertube =
     let weekly = Current_cache.Schedule.v ~valid_for:(Duration.of_day 7) () in
     let image = Cluster.Watch_docker.pull ~schedule:weekly "chocobozzz/peertube:production-bullseye" in
     Cluster.Watch_docker.service ~name:"infra_peertube" ~image ()

The deployment is achieved through an Ansible Playbook. Further details are available here.

The second part of the update was to improve the visibility of the backups for watch.ocaml.org. As noted previously, these use Tarsnap running monthly via CRON.

For this, a new plugin was added to OCurrent called ocurrent_ssh. This plugin allows arbitrary SSH commands to be executed as part of an OCurrent pipeline.

Again using a schedule node, the Current_ssh.run node will be triggered on a 30-day schedule, and the logs for each run will be available on deploy.ci.ocaml.org.

  let monthly = Current_cache.Schedule.v ~valid_for:(Duration.of_day 30) () in
   let tarsnap = Current_ssh.run ~schedule:monthly "watch.ocaml.org" ~key:"tarsnap" (Current.return ["./tarsnap-backup.sh"])

Merlin 4.8

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

This maintenance release brings multiple bug fixes and improvements to document fetching, jump-to-definition and type-on-hover for records' labels.

See full changelog
  • merlin binary
    • Update internal typer to match OCaml 4.14.1 release (#1557)
    • Improve type-enclosing behaviour when used on records' labels (#1565, fixes #1564)
    • Restore compatibility with some OCaml compiler's debug flags that were incorrectly rejected by Merlin (#1556)
    • Traverse aliases when jumping to declaration. This matches jump-to-definition's behavior (#1563)
    • Improve locate's behavior in various ill-typed expressions (#1546, fixes #1567 and partially #1543)
    • Correctly traverse patterns when looking for docs in the typedtree (#1572)
    • Get documentation when the declaration or definition is selected (#1542, fixes #1540)
    • On Windows, change to a harmless directory when launching server to avoid locking down current directory (#1569, fixes #1474)
  • test suite
    • Add multiple tests for locate over ill-typed expressions (#1546)
    • Add non-regression tests for other fixes in this release

Dune 3.7.0

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

As in the previous announce, here is a changelog split in several parts: changes to the dune executable itself (new commands or options, etc) and changes to the dune language. Most of the changes to the latter are only enabled when you opt-in to the new version by specifying (lang dune 3.7) in the corresponding dune-project file. In other words, it should always be safe to upgrade the dune package.

🌟 Spotlight Features

  1. Watch mode for executables

Dune 3.7 now supports watch mode for executables! 🎉

It works just as you'd expect, if you define an executable, you can run it with

dune exec -w my-executable

It will interrupt the process when a file change and re-start the application.

For a practical example of the workflows enabled by watch-mode, check this demo of a live reload for web development:

  1. Native Windows Polling

Starting from Dune 3.7, Dune watch mode is now available on Windows!

@yams-yams and @nojb from Lexifi have been working on integrating Windows native polling API with Dune to supplement the support for fswatch, which is unavailable on Windows.

Windows users can now run dune build -w out of the box!

  1. Qualified Subdirs

It's quite common to organise your code into subdirectories to separate components. Until now, you could do this by including (include_subdirs unqualified) in your dune files, but this wasn't completely satisfying since all of your modules were available in the top-level. If you wanted to expose modules in subdirectories under another module, you had to create a separate library, which was.. quite the overhead.

Dune 3.7 brings support for the highly-anticipated qualified sub-directories. You can now write (include_subdirs qualified) in your dune file, and modules in your subdirectories will be exposed under a module with the name of the directory.

See full changelog

dune executable

Added

  • Allow running $ dune exec in watch mode (with the -w flag). In watch mode, $ dune exec the executed binary whenever it is recompiled. (#6966, @gridbugs)

  • Add a dune cache size command for displaying the size of the cache (#6638, @Alizter)

  • Allow $ dune ocaml dump-dot-merlin to run in watch mode. Also this command shouldn't print "Entering Directory" mesages. (#6497, @rgrinberg)

  • Add native support for polling mode on Windows (#7010, @yams-yams, @nojb, review by @Rucikir and @jbeckford)

  • Auto-detect dune-workspace files as dune files in Emacs (#7061, @ilankri)

  • Allow $ dune utop to load libraries defined in data only directories defined using (subdir ..) (#6631, @rgrinberg)

Changed

  • Make dune describe workspace return consistent dependencies for executables and for libraries. By default, compile-time dependencies towards PPX-rewriters are from now not taken into account (but runtime dependencies always are). Compile-time dependencies towards PPX-rewriters can be taken into account by providing the --with-pps flag. (#6727, fixes #6486, @esope)

  • Use colored output with MDX when Dune colors are enabled. (#6462, @MisterDA)

  • Use colored output with GCC and Clang when compiling C stubs. The flag -fdiagnostics-color=always is added to the :standard set of flags. (#4083, @MisterDA)

  • Move $ dune ocaml-merlin -dump-config=$dir to $ dune ocaml merlin dump-config $dir. (#6547, @rgrinberg)

Fixed

  • Fix parsing of OCaml errors that contain code excerpts with ... in them. (#7008, @rgrinberg)

  • Fix --trace-file output. Dune now emits a single complete event for every executed process. Unterminated async events are no longer written. (#6892, @rgrinberg)

  • Print missing newline after $ dune exec. (#6821, fixes #6700, @rgrinberg, @Alizter)

  • Fix binary corruption when installing or promoting in parallel (#6669, fixes #6668, @edwintorok)

  • Report an error if dune init ... would create a "dune" file in a location which already contains a "dune" directory (#6705, @gridbugs)

  • Fix the parsing of alerts. They will now show up in diagnostics correctly. (#6678, @rginberg)

  • Print "Leaving Directory" whenever "Entering Directory" is printed. (#6419, fixes #138, @cpitclaudel, @rgrinberg)

  • Remove "Entering Directory" messages for $ dune install. (#6513, @rgrinberg)

  • dune clean should no longer fail under Windows due to the inability to remove the .lock file. Also, bring the implementation of the global lock under Windows closer to that of Unix. (#6523, @nojb)

  • Fix missing dependencies when detecting the kind of C compiler we're using (#6610, fixes #6415, @emillon)

  • Remove spurious build dir created when running dune init proj ... (#6707, fixes #5429, @gridbugs)

  • Validate the command line arguments for $ dune ocaml top-module. This command requires one positional argument (#6796, fixes #6793, @rgrinberg)

  • Fix dependency cycle when installing files to the bin section with glob_files (#6764, fixes #6708, @gridbugs)

  • Handle "Too many links" errors when using Dune cache on Windows (#6993, @nojb)

  • Pre-emptively clear screen in watch mode (#6987, fixes #6884, @rgrinberg)

  • Allow --sandbox to affect ocamldep invocations. Previously, they were wrongly marked as incompatible (#6749, @rgrinberg)

dune language

Added

  • Allow (include_subdirs qualified) for OCaml projects. (#6594, fixes #1084, @rgrinberg)

  • Format dune files when they are named dune-file. This occurs when we enable the alternative file names project option. (#6566, @rgrinberg)

  • Add map_workspace_root dune-project stanza to allow disabling of mapping of workspace root to /workspace_root. (#6988, fixes #6929, @richardlford)

  • Allow the cinaps stanza to set a custom alias. By default, if the alias is not set then the cinaps actions will be attached to both @cinaps and @runtest (#6991, @rgrinberg)

  • Add (using ctypes 0.3). When used, paths in (ctypes) are interpreted relative to where the stanza is defined. (#6883, fixes #5325, @emillon)

Changed

  • Stop passing -q flag in dune coq top, which allows for .coqrc to be loaded. (#6848, fixes #6847, @Alizter)

  • Coq native mode is now automatically detected by Dune starting with Coq lang 0.7. (mode native) has been deprecated in favour of detection from the configuration of Coq. (#6409, @Alizter)

  • Accurately determine merlin configuration for all sources selected with copy# and copy_files#. The old heuristic of looking for a module in parent directories is removed (#6594, @rgrinberg)

Fixed

  • Fix parsing of the <= operator in blang expressions of dune files. Previously, the operator would be interpreted as <. (#6928, @tatchi)

  • Fix preprocessing with staged_pps (#6748, fixes #6644, @rgrinberg)

  • Fix the parsing of decimal and hexadecimal escape literals in dune, dune-package, and other dune s-expression based files (#6710, @shym)

  • Fix cross compilation configuration when a context with targets is itself a host of another context (#6958, fixes #6843, @rgrinberg)

  • Allow compilation rules to be impacted by (env ..) stanzas that modify the environment or set binaries. (#6527, @rgrinberg)

  • Fix handling of support files generated by odoc. (#6913, @jonludlam)

  • Fix the compilation of modules generated at link time when implicit_transitive_deps is enabled (#6642, @rgrinberg)

  • Fix inline tests with js_of_ocaml and whole program compilation mode enabled (#6645, @hhugo)

  • Fix js_of_ocaml separate compilation rules when --enable=effects ,--enable=use-js-string or --toplevel is used. (#6714, #6828, #6920, @hhugo)

  • Fix js_of_ocaml separate compilation in presence of linkall (#6832, #6916, @hhugo)

  • coqdep is now called once per theory, instead of one time per Coq file. This should significantly speed up some builds, as coqdep startup time is often heavy (#7048, @Alizter, @ejgallego)

Ppxlib 0.29.1

See full changelog
  • Allow users to vendor ppxlib as-is, as well as ppx_sexp_conv in the same project (#386, @kit-ty-kate)

Ppxlib 0.29.0

See full changelog
  • Remove File_path exports. (#381, @ceastlund)
  • Add Ppxlib.Expansion_helpers with name mangling utilities from ppx_deriving (#370, @sim642)

Dune 3.6.2

See full changelog
  • Fix configurator when using the MSVC compiler (#6538, fixes #6537, @nojb)

  • Fix running the RPC server on windows (#6721 fixes #6720, @rgrinberg)

Mdx 2.2.1

See full changelog

Fixed

  • Undid the change to the pipe code to restore compatibility with Windows (#403, @MisterDA)

Mdx 2.2.0

See full changelog

Added

  • Report all parsing errors in Markdown files (#389, @NathanReb)

Changed

  • Preserve indentation in multiline OCaml blocks in .mli files (#395, @panglesd)
  • Rename the Normal syntax to Markdown to better explain what the syntax is and moved it to Mdx.Syntax (#412, @Leonidas-from-XIV)

Fixed

  • Fixed compatibility with Cmdliner 1.1.0 (#371, @Leonidas-from-XIV)
  • Report errors and exit codes of toplevel directives (#382, @talex5, @Leonidas-from-XIV)
  • Fix block locations in error reporting (#389, @NathanReb)
  • Include the content of the line that features the part-end MDX directive in the output, before that line would've been dropped (#374, #387, @Leonidas-from-XIV)
  • Handle EINTR signal on waitpid call by restarting the syscall. (#409, @tmcgilchrist)
  • Fix parsing of multiline toplevel phrases in .mli files (#394, #397, @Leonidas-from-XIV)

Removed

  • Removed warning about missing semicolons added in MDX 1.11.0 and the automatic insertion of semicolons in the corrected files introduced in MDX 2.0.0. (#398, @Leonidas-from-XIV)

On behalf of the ocaml-lsp team, I’m pleased to announce ocaml-lsp-server versions 1.15.0-4.14 and 1.15.0-5.0 for OCaml 4.14 and 5.0, respectively. This is the first time we release ocaml-lsp supporting two compiler versions. We look forward to your feedback.

See full changelog

Features

  • Enable semantic highlighting support by default (#933)

  • Support connecting over pipes and socket. Pipes on Windows aren't yet supported (#946)

    More about communication channels in LSP specification.

  • Re-enable ocamlformat-rpc for formatting code snippets (but not files and not on Windows) (#920, #939)

    One needs to have installed either ocamlformat package version > 0.21.0 or, otherwise, ocamlformat-rpc package. Note that previously ocamlformat-rpc came in a standalone OPAM package, but since ocamlformat version > 0.21.0, it comes within ocamlformat package.

  • Add custom ocamllsp/hoverExtended request (#561)

  • Support utf-8 position encoding clients (#919)

    More about position encoding in LSP specification.

  • Show unwrapped module alias types on hovering over module names. This is due to upgrading to merlin 4.7 and using merlin's verbosity=smart by default (#942)

Fixes

  • Respect the client's completion item resolve and preSelect capabilities (#925, #936)

  • Disable polling for dune's watch mode on Windows and OCaml 4.14.0 (#935)

  • Fix semantic highlighting of "long identifiers," e.g., Foo.Bar.x (#932)

  • Fix syncing of document contents:

    • For ranges that span an entire line (#927)
    • Previously, whole line edits would incorrectly eat the newline characters (#971)

Utop 2.11.0

See full changelog
  • Bump the compatibility to 4.08+ (#393 @emillon)
  • Load @toplevel_printer annotated printers for functors (#378 @metavinek)
  • Do not display a backtrace when exiting normally (#399 #398 @emillon)

We have the pleasure of celebrating the birthday of Oronce Finé by announcing the release of OCaml version 4.14.1.

This release is a collection of safe bug fixes, cherry-picked from the OCaml 5.0.0 release. If you were using OCaml 4.14.0 and cannot yet upgrade to OCaml 5, this release is for you.

The 4.14 branch is expected to receive more backported fixes during the maturation of OCaml 5. Thus don't hesitate to report any bugs on the OCaml issue tracker.

See the list of changes below for more details.


Installation Instructions

The base compiler can be installed as an opam switch with the following commands:

opam update
opam switch create 4.14.1

The source code for the release candidate is also directly available on:

See full changelog

Changes in OCaml 4.14.1 (20 December 2022)

Compiler User-Interface and Warnings:

  • #11184, #11670: Stop calling ranlib on created / installed libraries (Sébastien Hinderer and Xavier Leroy, review by the same)

Build System:

  • #11370, #11373: Don't pass CFLAGS to flexlink during configure. (David Allsopp, report by William Hu, review by Xavier Leroy and Sébastien Hinderer)

  • #11487: Thwart FMA test optimisation during configure (William Hu, review by David Allsopp and Sébastien Hinderer)

Bug Fixes:

  • #10768, #11340: Fix typechecking regression when combining first class modules and GADTs. (Jacques Garrigue, report by François Thiré, review by Matthew Ryan)

  • #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when calling virtual methods introduced by constraining the self type from within the class definition. (Nicolás Ojeda Bär, review by Leo White)

  • #11263, #11267: caml/{memory,misc}.h: Check whether _MSC_VER is defined before using it to ensure that the headers can always be used in code which turns on -Wundef (or equivalent). (David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and Sébastien Hinderer)

  • #11314, #11416: Fix non-informative error message for module inclusion (Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer)

  • #11358, #11379: Refactor the initialisation of bytecode threading, This avoids a "dangling pointer" warning of GCC 12.1. (Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer)

  • #11387: Module type with constraints no longer crash the compiler in presence of both shadowing warnings and the -bin-annot compiler flag. (Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer)

  • #11392, #11392: Assertion failure with -rectypes and external definitions (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)

  • #11417: Fix a regression which allowed virtual methods in non-virtual classes. (Leo White, review by Florian Angeletti)

  • #11468: Fix regression from #10186 (OCaml 4.13) detecting IPv6 on Windows for Mingw-w64 i686 port. (David Allsopp, review by Xavier Leroy and Sébastien Hinderer)

  • #11489, #11496: More prudent deallocation of alternate signal stack (Xavier Leroy, report by @rajdakin, review by Florian Angeletti)

  • #11516, #11524: Fix the deprecated_mutable attribute. (Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti)

  • #11194, #11609: Fix inconsistent type variable names in "unbound type var" messages (Ulysse Gérard and Florian Angeletti, review Florian Angeletti and Gabriel Scherer)

  • #11622: Prevent stack overflow when printing a constructor or record mismatch error involving recursive types. (Florian Angeletti, review by Gabriel Scherer)

  • #11732: Ensure that types from packed modules are always generalised (Stephen Dolan and Leo White, review by Jacques Garrigue)

  • #11737: Fix segfault condition in Unix.stat under Windows in the presence of multiple threads. (Marc Lasson, Nicolás Ojeda Bär, review by Gabriel Scherer and David Allsopp)

  • #11776: Extend environment with functor parameters in strengthen_lazy. (Chris Casinghino and Luke Maurer, review by Gabriel Scherer)

  • #11533, #11534: Follow synonyms again in #show_module_type (this had stopped working in 4.14.0) (Gabriel Scherer, review by Jacques Garrigue, report by Yaron Minsky)

  • #11768, #11788: Fix crash at start-up of bytecode programs in no-naked-pointers mode caused by wrong initialisation of caml_global_data (Xavier Leroy, report by Etienne Millon, review by Gabriel Scherer)

  • #11803, #11808: On x86, the destination of an integer comparison must be a register; it cannot be a stack slot. (Vincent Laviron, review by Xavier Leroy, report by Emilio Jesús Gallego Arias)

We have the pleasure of celebrating the birthdays of Jane Austen and Arthur C. Clarke by announcing the release of OCaml version 5.0.0.

The highlight of this new major version of OCaml is the long-awaited runtime support for shared memory parallelism and effect handlers.

This multicore support is the culmination of more than 8 years of effort, and required a full rewrite of the OCaml runtime environment. Consequently, OCaml 5.0.0 is expected to be a more experimental version of OCaml than the usual OCaml releases.

In this release, the native compiler only supports the x86-64 and arm64 architectures. In terms of operating systems, Linux, the BSDs, macOS and mingw64 on Windows are supported.

We are planning to restore the support for most previously supported architectures and operating systems, and address remaining known issues over the course of the next year.

Don't let those words of caution hinder your experimentation with OCaml 5: OCaml 5 as a language is fully compatible with OCaml 4 down to the performance characteristics of your programs. In other words, any code that works with OCaml 4 should work the same with OCaml 5.

The currently known exceptions to this rule are:

  • the removal of many long-deprecated functions and modules
  • changes to the internal runtime API
  • the performance of ephemerons is currently (and temporarily) strongly degraded.

Please report any unexpected behaviours on the OCaml issue tracker and post any questions or comments you might have on our discussion forums.

During the maturing period for OCaml 5, the OCaml 4.14 branch will be maintained by backporting bug fixes from the OCaml 5 branch at regular intervals. The next release on the OCaml 4.14 branch, OCaml 4.14.1, should soon follow this release.

The full list of changes can be found in the changelog below.


Installation Instructions

The base compiler can be installed as an opam switch with the following commands:

opam update
opam switch create 5.0.0

It might be also interesting to check the new support for parallelism by installing the domainslib library with

opam install domainslib

The source code for the release candidate is also directly available on:

Fine-Tuned Compiler Configuration

If you want to tweak the configuration of the compiler, you can switch to the option variant with:

opam update
opam switch create <switch_name> ocaml-variants.5.0.0+options <option_list>

where <option_list> is a comma-separated list of ocaml-option-* packages. For instance, for a flambda and no-flat-float-array switch:

opam switch create 5.0.0+flambda+nffa ocaml-variants.5.0.0+options ocaml-option-flambda ocaml-option-no-flat-float-array

The command line above is slightly more complicated for opam versions before 2.1:

opam update
opam switch create <switch_name> --packages=ocaml-variants.5.0.0+options,<option_list>

In both cases, all available options can be listed with opam search ocaml-option.

See full changelog

OCaml 5.0.0 (16 December 2022)

  • #10831: Multicore OCaml (Enguerrand Decorne, Stephen Dolan, Tom Kelly, Sadiq Jaffer, Anil Madhavapeddy, Sudha Parimala, KC Sivaramakrishnan, Leo White, the Tarides multicore team, review by Florian Angeletti, Damien Doligez, Xavier Leroy, Guillaume Munch-Maccagnoni, Olivier Nicole, Nicolás Ojeda Bär, Gabriel Scherer, the OCaml core development team, and many other valued reviewers.)

Runtime system:

  • #11400: Runtime events counters fixes Fixes mismatch between OCaml and C APIs, removes events from 4.x that are not present in the 5.0 GC and adds some missing probes. (Sadiq Jaffer, review by Gabriel Scherer, Florian Angeletti)

  • #11368: Runtime events buffer size OCAMLRUNPARAMS fix The runtime events buffer size can now be set via the 'e' OCAMLRUNPARAM. This is previously mistakenly enabled/disabled tracing instead. (Sadiq Jaffer, review by KC Sivaramakrishnan, David Allsopp, Damien Doligez)

  • #11308: Add environment variable to preserve runtime_events after exit If the environment variable OCAML_RUNTIME_EVENTS_PRESERVE exists then the runtime will not remove the runtime events ring buffers at exit. This makes tracing very short running programs more reliable. (Sadiq Jaffer, review by KC Sivaramakrishnan)

  • #10964: Ring-buffer based runtime tracing (runtime_events) Runtime_events is a very low overhead runtime tracing system designed for continuous monitoring of OCaml applications. (Sadiq Jaffer, review by Anil Madhavapeddy, Enguerrand Decorne, Richard Warburton, Gabriel Scherer, Sabine Schmaltz, Florian Angeletti, Patrick Ferris, Tom Kelly)

  • (breaking change) #10723: do not use -flat-namespace linking for macOS. (Carlo Cabrera, review by Damien Doligez)

  • (breaking change) #10863, #10933: Remove support for old, unprefixed C runtime function names such as alloc. The new names prefixed with caml_ must be used instead, such as caml_alloc. Consequently, it is no longer needed to define CAML_NAME_SPACE to avoid bringing unprefixed names into scope: this is now the default behavior. (Nicolás Ojeda Bär, review by Xavier Leroy)

  • #10902: Do not register empty code fragments in natdynlink. (David Allsopp, review by Xavier Leroy and Damien Doligez)

  • #10965: caml_fatal_error_hook, GC timing hooks, and caml_scan_roots_hook are now atomic variables. Restore GC timing hooks in multicore. (Guillaume Munch-Maccagnoni, review by Enguerrand Decorne, Xavier Leroy, Gabriel Scherer, and KC Sivaramakrishnan)

  • #11209: Add a public and thread-safe timing hook running at domain termination, after this domain has stopped running any OCaml code: caml_domain_terminated_hook. This can be useful for implementing domain-local state in C. (Guillaume Munch-Maccagnoni, review by Xavier Leroy and Gabriel Scherer)

  • #10875, #11731: Add option to allocate fiber stacks and sigaltstacks with mmap(MAP_STACK) instead of malloc. This is exposed via a configure --enable-mmap-map-stack option, and is enabled by default on OpenBSD where it is mandatory. (Anil Madhavapeddy, review by Gabriel Scherer, Tom Kelly, Michael Hendricks and KC Sivaramakrishnan).

  • #10950: Do not use mmap to allocate Caml_state. In order to reduce virtual memory usage, we dynamically allocate the domain_state structure. (Enguerrand Decorne, KC Sivaramakrishnan and Tom Kelly, review by Anil Madhavapeddy and Gabriel Scherer)

  • #11010: Use strerror_r for reentrant error string conversion. (Anil Madhavapeddy and Xavier Leroy, review by same and Edwin Török)

  • #11002, #11066, #11086: Do not use Begin_roots/End_roots macros in the runtime system. Also fix a missing root registration in the implementation of Unix.write on Windows. (Nicolás Ojeda Bär, Daniel Bünzli and Antonin Décimo, review by Xavier Leroy and David Allsopp)

  • #11022: Track GC work for all managed bigarray allocations (Stephen Dolan, report by Andrew Hunter, review by Damien Doligez)

  • #10802: Use 4.12 value macros and helpers in C code (Antonin Décimo, review by Gabriel Scherer)

  • #11105: Fix handling of fiber stack cache with multiple domains (Jon Ludlam, KC Sivaramakrishnan and Tom Kelly)

  • #11054: Respect user provided maximum stack space Make sure the stack we initially request is sized accordingly to the user provided settings. tmc/stack_space is also updated by this PR in order to account for this change. (Enguerrand Decorne, report by Jon Ludlam, review by Tom Kelly, KC Sivaramakrishnan and Gabriel Scherer)

  • #11238: Increase the default limit for the stack size to 128 Mi words, i.e. 1 Gib for 64-bit platforms and 512 Mib for 32-bit platforms. (Xavier Leroy, review by Sébastien Hinderer)

  • (breaking change) #11295: An ISO C 2011 compliant compiler, including full support for atomic types, is now required to build the OCaml runtime system. (Xavier Leroy, review by David Allsopp and Sébastien Hinderer)
  • #10915, #11039, #11057, #11095, #11190: Implement quality treatment for asynchronous actions in multicore. Reimplement the old behaviour of caml_process_pending* for multicore. (Guillaume Munch-Maccagnoni, review by Sadiq Jaffer and Gabriel Scherer)

  • #11303: Ensure that GC is not invoked from bounds check failures (Stephen Dolan, review by Sadiq Jaffer and Xavier Leroy)

  • #11304: Fix data race on Windows file descriptors (Olivier Nicole and Xavier Leroy, review by Xavier Leroy, David Allsopp, and Sadiq Jaffer)

  • (breaking change) #11337: pass 'flags' metadata to root scanners, to optimize stack scanning in the bytecode interpreter. Changes the interface of user-provided root-scanning hooks. (Gabriel Scherer, review by Xavier Leroy, Guillaume Munch-Maccagnoni, Sadiq Jaffer and Tom Kelly)
  • #11144: Restore frame-pointers support for amd64 (Fabrice Buoro, review by Frederic Bour and KC Sivaramakrishnan)
  • (breaking change) #11255: in the C interface, &Field(v, i) now has type volatile value * instead of value * in OCaml 4. This makes the memory model for mixed OCaml/C code better defined, but can cause warnings or type errors in user C code. (KC Sivaramakrishnan, review by Xavier Leroy, Gabriel Scherer and Guillaume Munch-Maccagnoni, additional discussions with Stephen Dolan and Luc Maranget)
  • #5299, #4787, #11138, #11272, #11506: To help debugging, Caml_state now dynamically checks that the domain lock is held, and fails otherwise (with a fatal error at most entry points of the C API, or systematically in debug mode). A new variable Caml_state_opt is introduced, and is NULL when the domain lock is not held. This allows to test from C code if the current thread holds the lock of its domain. (Guillaume Munch-Maccagnoni, review by Florian Angeletti, Damien Doligez, Sadiq Jaffer, Xavier Leroy, and Gabriel Scherer)

  • #11223: The serialization format of custom blocks changed in 4.08, but the deserializer would still support the pre-4.08 format. OCaml 5.x removed support for this old format; provide a clear error message in this case. (Hugo Heuzard, review by Gabriel Scherer)

  • #11504, #11522: Use static allocation in caml_make_float_vect in no-flat-float-array mode, it's more efficient and avoids a a race condition (Xavier Leroy, report by Guillaume Munch-Maccagnoni, review by David Allsopp)

  • #11652: Fix benign off-by-one error in Windows implementation of caml_mem_map. (David Allsopp, review by Gabriel Scherer)

  • #11669, #11704: Fix construction of Effect.Unhandled exceptions in the bytecode interpreter. (David Allsopp and Xavier Leroy, report by Samuel Hym, review by Xavier Leroy and Gabriel Scherer)

Code generation and optimizations:

  • #10972: ARM64 multicore support: OCaml & C stack separation; dynamic stack size checks; fiber and effects support. (Tom Kelly and Xavier Leroy, review by KC Sivaramakrishnan, Xavier Leroy Guillaume Munch-Maccagnoni, Eduardo Rafael, Stephen Dolan and Gabriel Scherer)
  • (breaking change) #10845 Emit frametable size on amd64 BSD (OpenBSD, FreeBSD, NetBSD) systems (emitted for Linux in #8805) (Hannes Mehnert, review by Nicolás Ojeda Bär)

Standard library:

  • #10742: Use LXM as the pseudo-random number generator for module Random. Add Random.State.split and Random.split to "split" a PRNG off another PRNG. (Xavier Leroy, review by Gabriel Scherer and Hugo Heuzard)
  • (breaking change) #10867, #11345: Remove deprecated values: Array.create, Array.make_float, Array.create_matrix, Bytes.uppercase, Bytes.lowercase, Bytes.capitalize, Bytes.uncapitalize, Char.lowercase, Char.uppercase, Filename.temp_dir_name, Int32.format, Int64.format, Nativeint.format, Format.bprintf, Format.kprintf, Format.set_all_formatter_output_functions, Format.get_all_formatter_output_functions, Format.pp_set_all_formatter_output_functions, Format.pp_get_all_formatter_output_functions, Format.pp_open_tag, Format.pp_close_tag, Format.open_tag, Format.close_tag, Format.formatter_tag_functions, Format.pp_set_formatter_tag_functions, Format.pp_get_formatter_tag_functions, Format.set_formatter_tag_functions, Format.get_formatter_tag_functions, Gc (mutability of the fields of type Gc.control), Lazy.lazy_from_fun, Lazy.lazy_from_val, Lazy.lazy_is_val, Obj.set_tag, Obj.truncate, Obj.final_tag, Obj.extension_constructor, Obj.extension_name, Obj.extension_id, Scanf.stdib, Scanf.fscanf, Scanf.kfscanf, Stdlib.( & ), Stdlib.( or ), String.set, String.copy, String.fill, String.unsafe_set, String.unsafe_fill, String.uppercase, String.lowercase, String.capitalize, String.uncapitalize, Thread.kill, Thread.wait_write, Thread.wait_read, the whole ThreadUnix module, the infix operator (.[]<-). (Nicolás Ojeda Bär, review by Damien Doligez)

  • (breaking change) #10896: Remove Stream, Genlex and Pervasives. Also remove legacy standalone bigarray library (the Bigarray module is now part of the standard library). (Nicolás Ojeda Bär, review by Kate Deplaix and Anil Madhavapeddy)

  • #10921: Use getentropy, when available, to seed the generator during Random.self_init (Michael Hendricks, review by Gabriel Scherer, Xavier Leroy, and Anil Madhavapeddy)
  • (breaking change) #10924: Add deprecated attribute to Printexc.catch, Printf.kprintf and Unix.SO_ERROR. (Nicolás Ojeda Bär, review by Damien Doligez)
  • #10986: Add Scanf.sscanf_opt, Scanf.bscanf_opt and Scanf.scanf_opt. (Nicolás Ojeda Bär, review by Florian Angeletti and Gabriel Scherer)
  • (breaking change) #11157: Rename "hash" in the "Hashtbl.SeededHashedType" signature to "seeded_hash". This allows defining both seeded and unseeded hash functions in the same module. (Nicolás Ojeda Bär, review by Gabriel Scherer and Xavier Leroy)
  • #8878: Add String.hash and String.seeded_hash. (Tom Kelly, review by Alain Frisch and Nicolás Ojeda Bär)

Other libraries:

  • (breaking change) #9071, #9100, #10935: Reimplement Thread.exit() as raising the exception Thread.Exit, and mark Thread.exit as deprecated. The new implementation changes the behavior compared with the OCaml 4 implementation. For example, the new implementation causes Fun.finally finalizers to be run and catch-all exception handlers to prevent termination. (Jacques-Henri Jourdan and Xavier Leroy, review by Damien Doligez, Guillaume Munch-Maccagnoni, Gabriel Scherer, and Enguerrand Decorne)
  • #11034: Dynlink library, add a global lock to make dynlinking thread-safe. (Florian Angeletti, review by Gabriel Scherer)

  • #11087: deprecate Thread.wait_timed_read, Thread.wait_timed_write, Thread.select, Thread.wait_pid. The same functionality is available in the Unix module. (Nicolás Ojeda Bär, review by Anil Madhavapeddy)

  • #11309, #11424, #11427, #11545: Add Domain.recommended_domain_count. (Christiano Haesbaert, Konstantin Belousov, review by David Allsopp, KC Sivaramakrishnan, Gabriel Scherer, Nicolas Ojeda Bar)

  • #11461, #11466: Fix gethostbyaddr for IPv6 arguments and make it domain-safe (Olivier Nicole, Nicolás Ojeda Bär, David Allsopp and Xavier Leroy, review by the same)

  • #11479: Make Unix.symlink domain-safe on Windows (Olivier Nicole, review by Xavier Leroy and David Allsopp)

Tools:

  • (breaking change) #11004: Litmus tests for checking the implementation of the memory model. (Luc Maranget, review by Gabriel Scherer and Xavier Leroy)
  • #11024: Handle alerts in ocamldoc. The alert [@@alert deprecated] is handled specifically and it's no longer needed to duplicate the deprecated annotation (the alert for the compiler and the tag for the documentation). Every other alerts also appear in the documentation. (Jules Aguillon, review by Florian Angeletti)

  • #11065: Port the bytecode debugger to 5.0, adding support for effect handlers. (Damien Doligez and @fabbing, review by @fabbing and Xavier Leroy)

  • #11079: Add the -nobanners option to dumpobj. (Sébastien Hinderer, review by Gabriel Scherer and Vincent Laviron)

  • #11100: Fix ocamltest to make sure failed tests are not counted as "unexpected error". (Damien Doligez, review by Sébastien Hinderer)

  • #11245: Merge the common code of ocamlcp and ocamloptp into a single module. (David Allsopp, review by Sébastien Hinderer)

  • #11382: OCamlmktop use a new initialization module "OCamlmktop_init" to preserve backward-compatibility with user-module provided modules that install toplevel printers. (Florian Angeletti, review by Gabriel Scherer and David Allsopp)

Manual and documentation:

  • #11058: runtime/HACKING.adoc tips on debugging the runtime (Gabriel Scherer, review by Enguerrand Decorne and Nicolás Ojeda Bär)

  • #11093: Add an effect handlers tutorial (KC Sivaramakrishnan, review by François Pottier, Gabriel Scherer, François Bobot and Wiktor Kuchta)

  • #11192: Better documentation for condition variables. (François Pottier, review by Luc Maranget, Xavier Leroy, and Wiktor Kuchta)

  • #11093: Add tutorials on parallelism features and the relaxed memory model (KC Sivaramakrishnan, review by Damien Doligez, Anil Madhavapeddy, Gabriel Scherer, Thomas Leonard, Tom Ridge, Xavier Leroy, Luc Maranget, Fabrice Buoro, Olivier Nicole, Guillaume Munch-Maccagnoni, Jacques-Henri Jourdan)

  • #11640: Add Flambda commonly-used options to the ocamlopt manpage (Amandine Nangah, review by David Allsopp, Florian Angeletti, Sébastien Hinderer, and Vincent Laviron)

  • #11676: Fix missing since annotation in the Sys and Format modules (Github user Bukolab99, review by Florian Angeletti)

  • #11813: Make new multicore chapters easier to discover, and emphasize impact on C bindings. (Edwin Török, review by KC Sivaramakrishnan, and Florian Angeletti)

Compiler user-interface and warnings:

  • #9140, #11131: New command-line flag -nocwd to not include implicit the current directory to the load path. (Thomas Roglin, review by Gabriel Scherer and Nicolás Ojeda Bär)

  • #11089: Add 'since ' information to compiler warnings. (André Maroneze, review by Florian Angeletti and Gabriel Scherer)

  • #10909: Disable warning 59 (assignment to immutable blocks) unless flambda invariant checks are enabled. (Vincent Laviron, review by Gabriel Scherer)

  • #10981, #11276: Implement a -cmi-file option for ocamlc and ocamlopt. (Sébastien Hinderer, review by Damien Doligez, Daniel Bünzli and Florian Angeletti)

  • (breaking change) #11049: Stop padding 1-digit compiler minor version numbers. (So for instance OCaml 5.0 rather than 5.00) (Sébastien Hinderer, review by David Allsopp, Florian Angeletti and Xavier Leroy)
  • #11184, #11670: Stop calling ranlib on created / installed libraries (Sébastien Hinderer and Xavier Leroy, review by the same)

  • #11253: Deprecate ocaml script and ocamlnat script where script has no extension and is an implicit basename. (David Allsopp, review by Florian Angeletti and Sébastien Hinderer)

Internal/compiler-libs changes:

  • #10878, #10909: restore flambda after the Multicore merge. (Vincent Laviron, review by Gabriel Scherer and Xavier Leroy)

  • #10864, #10888: restore afl-fuzz mode for sequential programs. (Jan Midtgaard, review by Xavier Leroy and Gabriel Scherer)

  • #11008, #11047: rework GC statistics in the Multicore runtime (Gabriel Scherer, review by Enguerrand Decorne)

  • #11058: basic debugging documentation in runtime/HACKING.adoc (Gabriel Scherer, review by Enguerrand Decorne and Nicolás Ojeda Bär)

  • #11199: Stop installing topdirs.cmi twice. The toplevel now reads topdirs.cmi from +compiler-libs, as the debugger does. (David Allsopp, review by Sébastien Hinderer)

  • #11007, #11399: META files for the stdlib, compiler-libs and other libraries (unix, dynlink, str, runtime_events, threads, ocamldoc) are now installed along with the compiler. (David Allsopp, Florian Angeletti, Nicolás Ojeda Bär and Sébastien Hinderer, review by Daniel Bünzli, Kate Deplaix, Anil Madhavapeddy and Gabriel Scherer)

Build system:

  • (breaking change) #10893: Remove configuration options --disable-force-safe-string and DEFAULT_STRING=unsafe as well as --enable-force-safe-string and DEFAULT_STRING=safe which are now the default unconditionally. (Kate Deplaix, review by Gabriel Scherer and David Allsopp)
  • #11092: Build native-code compilers on OpenBSD/aarch64. (Christopher Zimmermann, review by Anil Madhavapeddy)

  • #11126: Build system: make it possible to choose which ocamldep (and flags) to use when computing dependencies for the compiler. Add a -no-slash option to ocamldep to let users override -slash. (Sébastien Hinderer, review by David Allsopp)

  • #11147: Factorize the stdlib-related compilation flags. Make it possible to control them consistently through the STDLIBFLAGS build variable. Make sure ocamldoc and ocamllex get compiled and linked with debugging information (-g). (Sébastien Hinderer, review by Gabriel Scherer)

  • #11149: Make the bootstrap process reproducible on systems with non-big-endian floating point. If the boot/ artefacts are up-to-date, this means that running make bootstrap on any platform should not change the images in boot/ and paves the way for automated testing that the bootstrap is repeatable. (David Allsopp, review by Damien Doligez and Sébastien Hinderer)

  • #11160: otherlibs: merge win32unix into unix. (Sébastien Hinderer, review by David Allsopp, Nicolás Ojeda Bär, Xavier Leroy, Vincent Laviron and Antonin Décimo)

  • (breaking change) #11198, #11298: Install the Dynlink, Str and Unix libraries to individual subdirectories of LIBDIR. The compiler, debugger and toplevel automatically add -I +lib if required, but display an alert. (David Allsopp, review by Florian Angeletti, Nicolás Ojeda Bär, Valentin Gatien-Baron and Sébastien Hinderer)
  • #11200: Install ocamlprof's Profiling runtime module to a +profiling, removing it from the default namespace. (David Allsopp, review by Sébastien Hinderer)

  • #11294: Switch minimum required autoconf to 2.71. (David Allsopp, review by Xavier Leroy)

  • #11370, #11373: Don't pass CFLAGS to flexlink during configure. (David Allsopp, report by William Hu, review by Xavier Leroy and Sébastien Hinderer)

  • #11487: Thwart FMA test optimization during configure (William Hu, review by David Allsopp and Sébastien Hinderer)

  • #11097: Build native-code compilers on NetBSD/aarch64 (Kate Deplaix, review by Anil Madhavapeddy)

Bug fixes:

  • #10768, #11340: Fix typechecking regression when combining first class modules and GADTs. (Jacques Garrigue, report by François Thiré, review by Matthew Ryan)

  • #10790: don't drop variance and injectivity annotations when pretty printing with constraints (for example, with type +!'a t = ...). (Florian Angeletti, report by Luke Maurer, review by Matthew Ryan and Gabriel Scherer)

  • #11167: Fix memory leak from signal stack. (Antoni Żewierżejew, review by Gabriel Scherer and Enguerrand Decorne)

  • #11112: harden -use-runtime against spaces or quotes in the provided path (Gabriel Scherer, report by Brahima Dibassi, review by David Allsopp)

  • #11068, #11070: Fix typo in function name given in Unix_error exception for Unix.readlink on Windows. (David Allsopp, report by Xia Li-yao)

  • #10807: Don't duplicate standard handles in the child process spawned by win32unix Unix.create_process if the handles were already inheritable. Fix broken signalling of EOF on standard handles if they were already inheritable. (Antonin Décimo, review by Xavier Leroy and Nicolás Ojeda Bär)

  • #10868: Fix off-by-1 bug when initializing frame hashtables (Jonah Beckford, review by Tom Kelly, Nicolás Ojeda Bär and KC Sivaramakrishnan)

  • #11077: Make dumpobj compatible with absence of naked pointer support (Olivier Nicole and Jan Midtgaard, review by Gabriel Scherer)

  • #11111: fix fork() usage in ocamltest C code. When calling fork() from C code with the Multicore runtime active, one needs to call caml_atfork_hook() on the forked child before it can use the OCaml runtime. (Gabriel Scherer, review by Xavier Leroy, report by Brahima Dibassi)

  • #10809: Use the WSA_FLAG_NO_HANDLE_INHERIT on Windows when creating sockets with WSASocket if the cloexec (non-inheritable) parameter is true. Fixes a race condition where a child process could inherit the socket and deadlock the parent. (Antonin Décimo, review by Xavier Leroy)

  • #11194, #11609: Fix inconsistent type variable names in "unbound type var" messages (Ulysse Gérard and Florian Angeletti, review Florian Angeletti and Gabriel Scherer)

  • #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when calling virtual methods introduced by constraining the self type from within the class definition. (Nicolás Ojeda Bär, review by Leo White)

  • #11263, #11267: caml/misc.h: check whether _MSC_VER is defined before using it to ensure that the headers can always be used in code which turns on -Wundef (or equivalent). (David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and Sébastien Hinderer)

  • #11289, #11405: fix some leaks on systhread termination (Fabrice Buoro, Enguerrand Decorne, Gabriel Scherer, review by Xavier Leroy and Florian Angeletti, report by Romain Beauxis)

  • #11314, #11416: fix non-informative error message for module inclusion (Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer)

  • #11358, #11379: Refactor the initialization of bytecode threading, This avoids a "dangling pointer" warning of GCC 12.1. (Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer)

  • #11387, module type with constraints no longer crash the compiler in presence of both shadowing warnings and the -bin-annot compiler flag. (Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer)

  • #11392, #11392: assertion failure with -rectypes and external definitions (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)

  • #11417: Fix regression allowing virtual methods in non-virtual classes. (Leo White, review by Florian Angeletti)

  • #11468: Fix regression from #10186 (OCaml 4.13) detecting IPv6 on Windows for mingw-w64 i686 port. (David Allsopp, review by Xavier Leroy and Sébastien Hinderer)

  • #11482, #11542: Fix random crash in large closure allocation (Damien Doligez, report by Thierry Martinez and Vincent Laviron, review by Xavier Leroy)

  • #11508, #11509: make Bytes.escaped domain-safe (Christiano Haesbaert and Gabriel Scherer, review by Xavier Leroy, report by Jan Midtgaard and Tom Kelly)

  • #11516, #11524: Fix the deprecated_mutable attribute. (Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti)

  • #11576: Fix bug in Bigarray.Genarray.init in the the case of zero-dimensional arrays. (Nicolás Ojeda Bär, Jeremy Yallop, report by Masayuki Takeda, review by Jeremy Yallop and Florian Angeletti)

  • #11587: Prevent integer comparison from being used on pointers (Vincent Laviron, review by Gabriel Scherer)

  • #11622: Prevent stack overflow when printing a constructor or record mismatch error involving recursive types. (Florian Angeletti, review by Gabriel Scherer)

  • #11662, #11673: fix a memory leak when using Dynlink, the bug was only present in development version of OCaml 5. (Stephen Dolan, report by Andre Maroneze, review by Gabriel Scherer)

  • #11732: Ensure that types from packed modules are always generalised (Stephen Dolan and Leo White, review by Jacques Garrigue)

  • #11737: Fix segfault condition in Unix.stat under Windows in the presence of multiple threads. (Marc Lasson, Nicolás Ojeda Bär, review by Gabriel Scherer and David Allsopp)

  • #11776: Extend environment with functor parameters in strengthen_lazy. (Chris Casinghino and Luke Maurer, review by Gabriel Scherer)

  • #11533, #11534: follow synonyms again in #show_module_type (this had stopped working in 4.14.0) (Gabriel Scherer, review by Jacques Garrigue, report by Yaron Minsky)

opam 2.1.4

Feedback on this post is welcomed on Discuss!

We are pleased to announce the minor release of opam 2.1.4.

This opam release consists of backported fixes:

  • Make opam able to fully build with OCaml 5.0. dose3 >= 6.1 and base64 >= 3.1.0 are now required (#5357)
  • Fix a bug where opam would not output any explanation when a conflict arises when attempting to install a package (#5378)

Opam installation instructions (unchanged):

  1. From binaries: run

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

    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
  • Add support for OCaml 5.0. Dose3 >= 6.1 and base64 >= 3.1.0 are now required [#5357 @kit-ty-kate @dra27 - fix #5354]
  • [BUG] Fix all empty conflict explanation messages [#5378 @kit-ty-kate - partial fix #4373]

We are pleased to announce the minor release of opam-publish 2.2.0.

This opam-publish release consists of the following breaking change:

  • Shorten the generated branch name. This is breaking change for people who want to force-push changes on an already opened PR using a previous version of opam-publish as the branch name might not be the same (#141)

and the following fixes:

  • Fix the github markdown syntax generated by opam-publish (#131)
  • Disambiguate GitHub archive URL computed from repository and tag (#135)
  • Upgrade to cmdliner >= 1.1.0 (#134)
  • Support git remotes with multiple push targets (#137)
  • Fix broken state if the initial opam-repository clone fails (#140)

Odoc 2.2.0

See full changelog

Additions

  • New unstable option --as-json for the HTML renderer that emits HTML fragments (preamble, content) together with metadata (table of contents, breadcrumbs, whether katex is used) in JSON format. (@sabine, #908)
  • New maths support via {m ... } and {math ... } tags. (@giltho, @gpetiot, #886)
  • Various optimisations (@jonludlam, #870, #883)
  • Better handling of alerts and deprecation notices. (@panglesd, #828)
  • Handle language tags on code blocks (@julow, #848)

Bugfixes

  • Shadowing issues (@jonludlam, #853)
  • Layout fixes and improvements (@panglesd, #832, #839, #847)
  • Handle comments on class constraints and inherit (@julow, #844)
  • Disable the missing root warning (@jonludlam, #881)
See full changelog

Oops, we went looking but didn't find the changelog for this release 🙈

The release of OCaml version 4.14.1 is imminent.

This companion release to the OCaml 5.0.0 release will backport many safe bug fixes from the currently experimental 5.0 branch to the stable 4.14 branch. A full list of bug fixes is available below.

In order to ensure that the future release works as expected, we are testing a release candidate during the upcoming weeks.

If you find any bugs, please report them here on GitHub.


Installation Instructions

The base compiler can be installed as an opam switch with the following commands on opam 2.1:

opam update
opam switch create 4.14.1~rc1

For previous version of opam, the switch creation command line is slightly more verbose:

opam update
opam switch create 4.14.1~rc1 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

It might be also interesting to check the new support for parallelism by installing the domainslib library with

opam install domainslib

The source code for the release candidate is available on

Fine-Tuned Compiler Configuration

If you want to tweak the configuration of the compiler, you can switch to the option variant with:

opam update
opam switch create <switch_name> ocaml-variants.4.14.1~rc1+options <option_list>

where <option_list> is a comma-separated list of ocaml-option-* packages. For instance, for a flambda and no-flat-float-array switch:

opam switch create 4.14.1~rc1+flambda+nffa ocaml-variants.4.14.1~rc1+options ocaml-option-flambda ocaml-option-no-flat-float-array

The command line above is slightly more complicated for opam versions before 2.1:

opam update
opam switch create <switch_name> --packages=ocaml-variants.4.14.1~rc1+options,<option_list> --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

In both cases, all available options can be listed with opam search ocaml-option.

See full changelog

Changes Since OCaml 4.14.0

Compiler User-Interface and Warnings:

  • #11184, #11670: Stop calling ranlib on created / installed libraries (Sébastien Hinderer and Xavier Leroy, review by the same)

Build System:

  • #11370, #11373: Don't pass CFLAGS to flexlink during configure. (David Allsopp, report by William Hu, review by Xavier Leroy and Sébastien Hinderer)

  • #11487: Thwart FMA test optimisation during configure (William Hu, review by David Allsopp and Sébastien Hinderer)

Bug Fixes:

  • #10768, #11340: Fix typechecking regression when combining first class modules and GADTs. (Jacques Garrigue, report by François Thiré, review by Matthew Ryan)

  • #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when calling virtual methods introduced by constraining the self type from within the class definition. (Nicolás Ojeda Bär, review by Leo White)

  • #11263, #11267: caml/{memory,misc}.h: check whether _MSC_VER is defined before using it to ensure that the headers can always be used in code which turns on -Wundef (or equivalent). (David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and Sébastien Hinderer)

  • #11314, #11416: fix non-informative error message for module inclusion (Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer)

  • #11358, #11379: Refactor the initialisation of bytecode threading, This avoids a "dangling pointer" warning of GCC 12.1. (Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer)

  • #11387, module type with constraints no longer crash the compiler in presence of both shadowing warnings and the -bin-annot compiler flag. (Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer)

  • #11392, #11392: assertion failure with -rectypes and external definitions (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)

  • #11417: Fix regression allowing virtual methods in non-virtual classes. (Leo White, review by Florian Angeletti)

  • #11468: Fix regression from #10186 (OCaml 4.13) detecting IPv6 on Windows for mingw-w64 i686 port. (David Allsopp, review by Xavier Leroy and Sébastien Hinderer)

  • #11489, #11496: More prudent deallocation of alternate signal stack (Xavier Leroy, report by @rajdakin, review by Florian Angeletti)

  • #11516, #11524: Fix the deprecated_mutable attribute. (Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti)

  • #11194, #11609: Fix inconsistent type variable names in "unbound type var" messages (Ulysse Gérard and Florian Angeletti, review Florian Angeletti and Gabriel Scherer)

  • #11622: Prevent stack overflow when printing a constructor or record mismatch error involving recursive types. (Florian Angeletti, review by Gabriel Scherer)

  • #11732: Ensure that types from packed modules are always generalised (Stephen Dolan and Leo White, review by Jacques Garrigue)

  • #11737: Fix segfault condition in Unix.stat under Windows in the presence of multiple threads. (Marc Lasson, Nicolás Ojeda Bär, review by Gabriel Scherer and David Allsopp)

  • #11776: Extend environment with functor parameters in strengthen_lazy. (Chris Casinghino and Luke Maurer, review by Gabriel Scherer)

  • #11533, #11534: follow synonyms again in #show_module_type (this had stopped working in 4.14.0) (Gabriel Scherer, review by Jacques Garrigue, report by Yaron Minsky)

  • #11768, #11788: Fix crash at start-up of bytecode programs in no-naked-pointers mode caused by wrong initialisation of caml_global_data (Xavier Leroy, report by Etienne Millon, review by Gabriel Scherer)

The release of OCaml version 5.0.0 is imminent. As a final step before the release, we are publishing a release candidate that you can test while waiting for the release in the upcoming weeks.

If you find any bugs, please report them on OCaml's issue tracker.

Compared to the second beta release, this release contains one toplevel bug fix and a minor type system fix.

If you are interested by the bug fixes beyond the new Multicore runtime, the full change log for OCaml 5.0.0 is available on GitHub

A short summary of the changes since the second beta release is also available below.


Installation Instructions

The base compiler can be installed as an opam switch with the following commands on opam 2.1:

opam update
opam switch create 5.0.0~rc1

For previous version of opam, the switch creation command line is slightly more verbose:

opam update
opam switch create 5.0.0~rc1 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

It might be also interesting to check the new support for parallelism by installing the domainslib library with

opam install domainslib

The source code for the release candidate is also directly available on:

Fine-Tuned Compiler Configuration

If you want to tweak the configuration of the compiler, you can switch to the option variant with:

opam update
opam switch create <switch_name> ocaml-variants.5.0.0~rc1+options <option_list>

where <option_list> is a comma-separated list of ocaml-option-* packages. For instance, for a flambda and no-flat-float-array switch:

opam switch create 5.0.0~rc1+flambda+nffa ocaml-variants.5.0.0~rc1+options ocaml-option-flambda ocaml-option-no-flat-float-array

The command line above is slightly more complicated for opam versions before 2.1:

opam update
opam switch create <switch_name> --packages=ocaml-variants.5.0.0~rc1+options,<option_list> --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

In both cases, all available options can be listed with opam search ocaml-option.

See full changelog

Changes Since the Second Beta Release

Bug Fixes

  • #11776: Extend environment with functor parameters in strengthen_lazy. (Chris Casinghino and Luke Maurer, review by Gabriel Scherer)

  • #11533, #11534: follow synonyms again in #show_module_type (this had stopped working in 4.14.0) (Gabriel Scherer, review by Jacques Garrigue, report by Yaron Minsky)

The release of OCaml 5.0.0 is drawing close.

In order to test the most recent bug fixes and to help you update your software and libraries ahead of the release, we have released a second beta version of OCaml 5.0.0, (see below for the installation instructions).

If you find any bugs, please report them on OCaml's issue tracker.

Compared to the first beta release, this second beta contains many small internal standard library fixes, one configuration fix and many small bug fixes.

We also have few updates of the documentation, which introduce two new alerts: one for the unstable modules Domain and Effect, and another for functions doing unsynchronized_access to mutable state in the standard library. Those two alerts are disabled by default, but are available for interested users.

The first release candidate for OCaml 5.0.0 is expected to follow closely this second beta release.

If you are interested in the ongoing list of bug fixes, the updated change log for OCaml 5.0.0 is available on GitHub.

You can also follow the state of the opam ecosystem on http://check.ocamllabs.io/.

A short summary of the changes since the first beta release is also available below.


Installation Instructions

The base compiler can be installed as an opam switch with the following commands on opam 2.1:

opam update
opam switch create 5.0.0~beta2

For previous versions of opam, the switch creation command line is slightly more verbose:

opam update
opam switch create 5.0.0~beta2 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

It might also be interesting to check the new support for parallelism by installing the domainslib library with

opam install domainslib

The source code for the beta release is also available at these addresses:

Fine-Tuned Compiler Configuration

If you want to tweak the configuration of the compiler, you can switch to the option variant with:

opam update
opam switch create <switch_name> ocaml-variants.5.0.0~beta2+options <option_list>

where option_list is a comma-separated list of ocaml-option-* packages. For instance, for a flambda and no-flat-float-array switch:

opam switch create 5.0.0~beta2+flambda+nffa ocaml-variants.5.0.0~beta2+options ocaml-option-flambda ocaml-option-no-flat-float-array

The command line above is slightly more complicated for opam versions before 2.1:

opam update
opam switch create <switch_name> --packages=ocaml-variants.5.0.0~beta2+options,<option_list> --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

In both cases, all available options can be listed with opam search ocaml-option.

See full changelog

Changes since the first beta

Configuration changes

  • #11097: Build native-code compilers on NetBSD/aarch64 (Kate Deplaix, review by Anil Madhavapeddy)

Bug fixes

  • #10875, +#11731: Add option to allocate fiber stacks and sigaltstacks with mmap(MAP_STACK) instead of malloc. This is exposed via a configure –enable-mmap-map-stack option, and is enabled by default on OpenBSD where it is mandatory. (Anil Madhavapeddy, review by Gabriel Scherer, Tom Kelly, Michael Hendricks and KC Sivaramakrishnan).
  • #11652: Fix benign off-by-one error in Windows implementation of caml_mem_map. (David Allsopp, review by Gabriel Scherer)
  • #11669, #11704: Fix construction of Effect.Unhandled exceptions in the bytecode interpreter. (David Allsopp and Xavier Leroy, report by Samuel Hym, review by Xavier Leroy and Gabriel Scherer)
  • #11184, +#11670: Stop calling ranlib on created / installed libraries (Sébastien Hinderer and Xavier Leroy, review by the same)
  • #11194, #11609: Fix inconsistent type variable names in “unbound type var” messages (Ulysse Gérard and Florian Angeletti, review Florian Angeletti and Gabriel Scherer)
  • #11622: Prevent stack overflow when printing a constructor or record mismatch error involving recursive types. (Florian Angeletti, review by Gabriel Scherer)
  • #11662, #11673: fix a memory leak when using Dynlink, the bug was only present in development version of OCaml 5. (Stephen Dolan, report by Andre Maroneze, review by Gabriel Scherer)
  • #11732: Ensure that types from packed modules are always generalised (Stephen Dolan and Leo White, review by Jacques Garrigue)
  • #11737: Fix segfault condition in Unix.stat under Windows in the presence of multiple threads. (Marc Lasson, Nicolás Ojeda Bär, review by Gabriel Scherer and David Allsopp)

Documentation

  • #11193, #11227: documentation on concurrency safety for mutable data types and states in the standard library. A unsynchronized_access alert have been added for functions that require user synchronizations on concurrent access. The new alert is diabled by default. (Florian Angeletti, review by François Pottier and KC Sivaramakrishnan )
  • #11526, add a unstable alert to the Domain and Effect modules. The new alert is disabled by default. (Florian Angeletti, review by Nicolás Ojeda Bär, Daniel Bünzli, and Kate Deplaix)
  • #11640: Add Flambda commonly-used options to the ocamlopt manpage (Amandine Nangah, review by David Allsopp, Florian Angeletti, Sébastien Hinderer, and Vincent Laviron)

Merlin 4.7

See full changelog
  • merlin binary
    • Replace custom "holes" AST nodes by extensions. This restores binary compatibility and fixes issues with PPXs when using typed-holes. (#1503)
    • Do not change temporarily Merlin's cwd when starting a PPX (#1521, fixes #1420)
    • Fix a parsing issue when declaring the (??) custom prefix operator. (#1507, fixes #1506)
    • Fix variant constructors' comments grouping (#1516, @mheiber, fixes #1513)
    • Filter-out duplicates from the enclosing command result (#1512)
    • Add a new verbosity=smart mode for type enclosing that only expand modules' types (#1374, @ulugbekna)
    • Improve locate for labels' declarations in the current buffer. (#1505, fixes #1524)
    • Fix locate on module without implementation (#1522, fixes #1519)
    • Allow program name customization when merlin is used as a library. (#1532)
  • editor modes
    • vim: load the plugin when necessary if it wasn't loaded before (#1511)
    • emacs: xref works from context menus; better highlighting of xref matches; xref recognises operators and binding operators at the cursor position; bad locations are filtered out (#1385, fixes #1410)
    • emacs: update CI for newer releases and fix some warnings (#1454, @mattiase)
  • test suite
    • Add tests for constructors' documentation (#1511)
    • Add test cases for label comment documentation (#1526, @mheiber)
    • Add a test for the enclosing command (#1512)
    • Add tests for interactions between locate and record labels (#1505)
    • Add test showing an issue with locate and implicit transitive deps

Dune 3.6.1

See full changelog
  • Fix status line enabled when ANSI colors are forced. (#6503, @MisterDA)

  • Fix build with MSVC compiler (#6517, @nojb)

  • Do not shadow library interface modules (#6549, fixes #6545, @rgrinberg)

Dune 3.6.0

Dear dune users, It is my pleasure to announce that dune 3.6.0 is now available on opam 🎉. Here's the changelog - I reused the same classification as in the previous announce for dune 3.5.0. Thanks again to all the contributors including bug reporters.

See full changelog

dune executable

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

Added

  • Introduce a $ dune ocaml top-module subcommand to load modules directly without sealing them behind the signature. (#5940, @rgrinberg)
  • Revive $ dune external-lib-deps under $ dune describe external-lib-deps. (#6045, @moyodiallo)
  • Extend the promotion CLI to a dune promotion group: dune promote is moved to dune promotion apply (the former still works) and the new dune promotion diff command can be used to just display the promotion without applying it. (#6160, fixes #5368, @emillon)
  • Build progress status now shows number of failed jobs (#6242, @Alizter)
  • Allow promoting into source directories specified by subdir (#6404, fixes #3502, @rgrinberg)
  • Support CLICOLOR and CLICOLOR_FORCE to enable/disable/force ANSI colors. (#6340, fixes #6323, @MisterDA).
  • Create a fake socket file _build/.rpc/dune on windows to allow rpc clients to connect using the build directory. (#6329, @rgrinberg)

Fixed

  • Forbid multiple instances of dune running concurrently in the same workspace. (#6360, fixes #236, @rgrinberg)
  • Make dune describe workspace return the correct root path (#6380, fixes #6379, @esope)
  • Fix running inline tests in bytecode mode (#5622, fixes #5515, @dariusf)

(lang dune 3.6)

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

Added

  • Add (glob_files <glob>) and (glob_files_rec <glob>) terms to the files field of the install stanza (#6250, closes #6018, @gridbugs)
  • Allow Byte_complete binaries to be installable (#4837, @AltGr, @rgrinberg)
  • Allow :standard in the (modules) field of the coq.pp stanza (#6229, fixes #2414, @Alizter)

Fixed

  • Allow absolute build directories to find public executables. For example, those specified with (deps %{bin:...}) (#6326, @anmonteiro)
  • [ctypes] do not mangle user written names in the ctypes stanza (#6374, fixes #5561, @rgrinberg)
  • Forbid private libraries with (package ..) set from depending on private libraries that don't belong to a package (#6385, fixes #6153, @rgrinberg)
  • [ctypes] always re-run pkg-config because we aren't tracking its external dependencies (#6052, @rgrinberg)
  • [ctypes] remove dependency on configurator in the generated rules (#6052, @rgrinberg)
  • Fix passing of flags to dune coq top (#6369, fixes #6366, @Alizter)
  • Prevent crash if absolute paths are used in the install stanza and in recursive globs. These cases now result in a user error. (#6331, @gridbugs)

Some of our ocaml.org services such as <watch.ocaml.org> involve storing user uploaded content. We need a way to make sure these are backed up in case of information loss, and to date this has been adhoc (involving rsyncing to another machine).

We now have a Tarsnap account as tarsnap@ocaml.org, and it is first being used to store backups of the videos uploaded to the <watch.ocaml.org> service. We'll expand its use to other infrastructures that also have precious data.

Other suggestions for backup services are welcome. In general, we're looking for solutions that do not involve a lot of key management, and a reasonable amount of redundancy (but backing up across 2-3 other machines in different datacentres is probably sufficient).

See full changelog

Fixes

  • Fix random requests failing after switching documents (#904, fixes #898)

  • Do not offer related diagnostic information unless the user enables in client capabilities (#905)

  • Do not offer diagnostic tags unless the client supports them (#909)

  • Do not attach extra data to diagnostics unless the client supports this (#910)

  • Use /bin/sh instead of /bin/bash. This fixes ocamllsp on NixOS

See full changelog

Fixes

  • Fix various server crashes when opening non OCaml/Reason files. Files such as dune, cram, etc. would cause the server to crash. (#884, fixes #871)

  • Ignore unknown tags in merlin configuration to improve forward compatibility with Dune. (#883)

Dune 3.5.0

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

See full changelog

dune executable

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

Added

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

Fixed

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

Changed

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

macOS support

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

Added

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

Fixed

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

(lang dune 3.5)

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

Added

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

Changed

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

Fixed

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

Coq support

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

Added

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

Changed

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

On behalf of the ocamllsp team, I'm pleased to announce version 1.14.0. This release contains a new code action to help you inline definitions thanks to @jfeser. We look forward to your feedback.

See full changelog

Features

  • Code action for inlining let bindings within a module or expression. (#847)

  • Tag "unused code" and "deprecated" warnings, allowing clients to better display them. (#848)

  • Refresh merlin configuration after every dune build in watch mode (#853)

Fixes

  • Respect showDocument capabilities. Do not offer commands or code actions that rely on this request without client support. (#836)

  • Fix signatureHelp on .mll files: avoid "Document.dune" exceptions

The release of OCaml 5.0.0 is drawing near. The standard library has been stabilized and many opam packages already work with this release. After two alpha releases, we have released the first beta version to help you update your software and libraries ahead of the release (see below for the installation instructions).

If you find any bugs, please report them on GitHub issues.

Compared to the last alpha release, this beta contains many small, internal runtime fixes (in particular in the systhreads library).

At the user level, the interface of the Domain and Effect module has been tweaked to be (hopefully) more forward-compatible:

  • Exceptions related to effects are now defined in the Effecŧ module.
  • The value Domain.recommended_domain_count is no longer a constant and the function Domain.at_each_spawn has been removed.

With those changes, the standard library should be stable now.

If you are interested in the ongoing list of bug fixes, the updated change log for OCaml 5.0.0 is available on GitHub.

You can also follow the state of the opam ecosystem on this opam-repository issues, and at check.ocamllabs.io

A short summary of the changes since the last alpha release is also available below.

Installation Instructions

The base compiler can be installed as an opam switch with the following commands on opam 2.1:

opam update
opam switch create 5.0.0~beta1

For previous versions of opam, the switch creation command line is slightly more verbose:

opam update
opam switch create 5.0.0~beta1 --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

It might also be interesting to check the new support for parallelism by installing the domainslib library with

opam install domainslib

The source code for the beta release is also available at these addresses:

Fine-Tuned Compiler Configuration

If you want to tweak the configuration of the compiler, you can switch to the option variant with:

opam update
opam switch create <switch_name> ocaml-variants.5.0.0~beta1+options <option_list>

where option_list is a comma-separated list of ocaml-option-* packages. For instance, for a flambda and no-flat-float-array switch:

opam switch create 5.0.0~beta1+flambda+nffa ocaml-variants.5.0.0~beta1+options ocaml-option-flambda ocaml-option-no-flat-float-array

The command line above is slightly more complicated for opam versions before 2.1:

opam update
opam switch create <switch_name> --packages=ocaml-variants.5.0.0~beta1+options,<option_list> --repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git

In both cases, all available options can be listed with opam search ocaml-option.

Optional opam Alpha Repository

During the beta release, if your dependencies are not yet compatible with OCaml 5.0.0, you might want to check the alpha opam repository: https://github.com/kit-ty-kate/opam-alpha-repository.

Which can be installed with

opam repo add alpha git+https://github.com/kit-ty-kate/opam-alpha-repository.git

You can check that the alpha repository has been correctly installed with

$ opam repo
<><> Repository configuration for switch 5.0.0~beta1 <><><><><><><><><><><><><>
 1 alpha   git+https://github.com/kit-ty-kate/opam-alpha-repository.git
 2 default https://opam.ocaml.org

This alpha repository contains various fixes that are in the process of being upstreamed, but it should be less and less required with the progress of the beta release.

See full changelog

Changes Since Last Alpha Release

Stdlib Changes

  • #11309, #11424, #11427, +#11545: Add Domain.recommended_domain_count. (Christiano Haesbaert, Konstantin Belousov, review by David Allsopp, KC Sivaramakrishnan, Gabriel Scherer, Nicolas Ojeda Bar)
  • #11423: Move the effect exceptions to the Effect module (KC Sivaramakrishnan, Xavier Leroy, Florian Angeletti, review by Florian Angeletti, Xavier Leroy, and KC Sivaramakrishnan)

  • #11593: Remove Domain.at_each_spawn (Florian Angeletti, review by Guillaume Munch-Maccagnoni and KC Sivaramakrishnan)

Bug Fixes

  • #11303: Ensure that GC is not invoked from bounds check failures (Stephen Dolan, review by Sadiq Jaffer and Xavier Leroy)

  • #5299, #4787, #11138, #11272, #11506: To help debugging, Caml_state now dynamically checks that the domain lock is held and fails otherwise (with a fatal error at most entry points of the C API, or systematically in debug mode). A new variable Caml_state_opt is introduced and is NULL when the domain lock is not held. This allows to test from C code if the current thread holds its domain lock. (Guillaume Munch-Maccagnoni, review by Florian Angeletti, Damien Doligez, Sadiq Jaffer, Xavier Leroy, and Gabriel Scherer)

  • #11223: The serialisation format of custom blocks changed in 4.08, but the deserialiser would still support the pre-4.08 format. OCaml 5.x removed support for this old format and provided a clear error message in this case. (Hugo Heuzard, review by Gabriel Scherer)

  • #11504, #11522: Use static allocation for caml_make_float_vect in no-flat-float-array mode, it's more efficient and avoids a race condition (Xavier Leroy, report by Guillaume Munch-Maccagnoni, review by David Allsopp)

  • #11461, #11466: Fix gethostbyaddr for IPv6 arguments and make it domain-safe (Olivier Nicole, Nicolás Ojeda Bär, David Allsopp and Xavier Leroy, review by the same)

  • #11479: Make Unix.symlink domain-safe on Windows (Olivier Nicole, review by Xavier Leroy and David Allsopp)

  • #11294: Switch minimum required autoconf to 2.71. (David Allsopp, review by Xavier Leroy)

  • #11370, #11373: Don't pass CFLAGS to flexlink during configure. (David Allsopp, report by William Hu, review by Xavier Leroy and Sébastien Hinderer)

  • #11487: Thwart FMA test optimization during configure (William Hu, review by David Allsopp and Sébastien Hinderer)

  • #11468: Fix regression from #10186 (OCaml 4.13) detecting IPv6 on Windows for mingw-w64 i686 port. (David Allsopp, review by Xavier Leroy and Sébastien Hinderer)

  • #11482, #11542: Fix random crash in large closure allocation (Damien Doligez, report by Thierry Martinez and Vincent Laviron, review by Xavier Leroy)

  • #11508, #11509: make Bytes.escaped domain-safe (Christiano Haesbaert and Gabriel Scherer, review by Xavier Leroy, report by Jan Midtgaard and Tom Kelly)

  • #11516, #11524: Fix the deprecated_mutable attribute. (Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti)

  • #11576: Fix bug in Bigarray.Genarray.init in the the case of zero-dimensional arrays. (Nicolás Ojeda Bär, Jeremy Yallop, report by Masayuki Takeda, review by Jeremy Yallop and Florian Angeletti)

  • #11587: Prevent integer comparison from being used on pointers (Vincent Laviron, review by Gabriel Scherer)

Documentation Changes

  • #11093: Add tutorials on parallelism features and the relaxed memory model (KC Sivaramakrishnan, review by Damien Doligez, Anil Madhavapeddy, Gabriel Scherer, Thomas Leonard, Tom Ridge, Xavier Leroy, Luc Maranget, Fabrice Buoro, Olivier Nicole, Guillaume Munch-Maccagnoni, Jacques-Henri Jourdan)

Ppxlib 0.28.0

See full changelog
  • Make esequence right-associative. (#366, @ceastlund)
  • Deprecate unused attributes in Deriving.Generator (#368, @sim642)
  • Remove a pattern match on mutable state in a function argument. (#362, @ceastlund)
  • Add code-path manipulation attributes. (#352, @ceastlund)
  • Update context-free rules to collect expansion errors generated by ppxlib and propagate them to top level without failing. (#358 and #361, @ceastlund)
  • Add driver benchmarks (#376, @gridbugs)

opam 2.1.3

Feedback on this post is welcomed on Discuss!

We are pleased to announce the minor release of opam 2.1.3.

This opam release consists of backported fixes:

  • Fix opam init and opam init --reinit when the jobs variable has been set in the opamrc or the current config. (#5056)
  • opam var no longer fails if no switch is set (#5025)
  • Setting a variable with option --switch <sw> fails instead of writing an invalid switch-config file (#5027)
  • Handle external dependencies when updating switch state pin status (all pins), instead as a post pin action (only when called with opam pin (#5046)
  • Remove windows double printing on commands and their output (#4940)
  • Stop Zypper from upgrading packages on updates on OpenSUSE (#4978)
  • Clearer error message if a command doesn't exist (#4112)
  • Actually allow multiple state caches to co-exist (#4554)
  • Fix some empty conflict explanations (#4373)
  • Fix an internal error on admin repository upgrade from OPAM 1.2 (#4965)

and improvements:

  • When inferring a 2.1+ switch invariant from 2.0 base packages, don't filter out pinned packages as that causes very wide invariants for pinned compiler packages (#4501)
  • Some optimisations to opam list --installable queries combined with other filters (#4311)
  • Improve performance of some opam list combinations (e.g. --available, --installable) (#4999)
  • Improve performance of opam list --conflicts-with when combined with other filters (#4999)
  • Improve performance of opam show by as much as 300% when the package to show is given explicitly or is unique (#4997)(#4172)
  • When a field is defined in switch and global scope, try to determine the scope also by checking switch selection (#5027)

You can also find API changes in the release note.


Opam installation instructions (unchanged):

  1. From binaries: run

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

    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] Fix opam init and opam init --reinit when the jobs variable has been set in the opamrc or the current config. [#5056 @rjbou]
  • When inferring a 2.1+ switch invariant from 2.0 base packages, don't filter out pinned packages as that causes very wide invariants for pinned compiler packages [#5176 @dra27 - fix #4501]
  • [BUG] Fix an internal error on repository upgrade from OPAM 1.2 [#4965 @AltGr]
  • Some optimisations to opam list --installable queries combined with other filters [#4882 @AltGr - fix #4311]
  • Improve performance of some opam list combinations (e.g. --available, --installable) [#4999 @kit-ty-kate]
  • Improve performance of opam list --conflicts-with when combined with other filters [#4999 @kit-ty-kate]
  • Improve performance of opam show by as much as 300% when the package to show is given explicitly or is unique [#4998 @kit-ty-kate - fix #4997 and partially #4172]
  • [BUG] opam var no longer fails if no switch is set [#5027 @rjbou - fix #5025]
  • [BUG] Setting a variable with option --switch <sw> fails instead of writing an invalid switch-config file [#5027 @rjbou]
  • When a field is defined in switch and global scope, try to determine the scope also by checking switch selection [#5027 @rjbou]
  • [BUG] Handle external dependencies when updating switch state pin status (all pins), instead as a post pin action (only when called with opam pin [#5047 @rjbou - fix #5046]
  • [BUG] When reinstalling a package that has a dirty source, if uncommitted changes are the same than the ones stored in opam's cache, opam consider that it is up to date and nothing is updated [4879 @rjbou]
  • Stop Zypper from upgrading packages on updates on OpenSUSE [#4978 @kit-ty-kate]
  • Clearer error message if a command doesn't exist [#4971 @kit-ty-kat - fix #4112]
  • [BUG] Remove windows double printing on commands and their output [#4940 @rjbou]
  • Actually allow multiple state caches to co-exist [#4934 @dra27 - actually fixes #4554]
  • Update cold compiler to 4.13 to avoid issues with glibc 2.34 on Unix [#5017 @dra27]
  • Bump opam-file-format to 2.1.4 [#5117 @kit-ty-kate - fix #5116]
  • Fix some empty conflict explanations [#4982 @kit-ty-kate - partially fix #4373]
  • Port some tests from master [#4841 #4974 #4861 #4915 #4979 #5004 #5006 #5015 #5024 #5025 #5031 #5131 #5176 @AltGr @dra27 @kit-ty-kate]
  • Update test engine to allow for additional tests [#4913 #4966 #4979 #5004 #5009 #5024 #5097 @AltGr @kit-ty-kate @rjbou]
  • Update for git protocol deprecation on GitHub [#5097 @rjbou]
  • When building opam, do not fail if curl/wget is missing [#5223 #5233 @kit-ty-kate]

Dune 3.4.1

See full changelog
  • Fix build on cygwin/i686-w64-mingw32 (#6008, @kit-ty-kate)

Dune 3.4.0

On behalf of the dune team, I’m pleased to announce the release of version 3.4.0.

Bug fixes, a couple new features, better hints and error messages - I won't restate what's in the changelog below. Thanks to everyone involved in this release!

See full changelog
  • Make dune describe correctly handle overlapping implementations for virtual libraries (#5971, fixes #5747, @esope)

  • Building the @check alias should make sure the libraries and executables don't have dependency cycles (#5892, @rgrinberg)

  • [ctypes] Add support for the errno parameter using the errno_policy field in the ctypes settings. (#5827, @droyo)

  • Fix dune coq top when it is invoked on files from a subdirectory of the directory containing the associated stanza (#5784, fixes #5552, @ejgallego, @rlepigre, @Alizter)

  • Fix hint when an invalid module name is found. (#5922, fixes #5273, @emillon)

  • The (cat) action now supports several files. (#5928, fixes #5795, @emillon)

  • Dune no longer uses shimmed META files for OCaml 5.x, solely using the ones installed by the compiler. (#5916, @dra27)

  • Fix handling of the (deps) field in (test) stanzas when there is an .expected file. (#5952, #5951, fixes #5950, @emillon)

  • Ignore insignificant filesystem events. This stops RPC in watch mode from flashing errors on insignificant file system events such as changes in the .git/ directory. (#5953, @rgrinberg)

  • Fix parsing more error messages emitted by the OCaml compiler. In particular, messages where the excerpt line number started with a blank character were skipped. (#5981, @rgrinberg)

  • env stanza: warn if some rules are ignored because they appear after a wildcard rule. (#5898, fixes #5886, @emillon)

  • On Windows, XDG_CACHE_HOME is taken to be the FOLDERID_InternetCache if unset, and XDG_CONFIG_HOME and XDG_DATA_HOME are both taken to be FOLDERID_LocalAppData if unset. (#5943, fixes #5808, @nojb)

See full changelog

New features

  • Support odoc-parser.2.0.0 (#2123, @gpetiot)
    • Breaking change: incompatible with earlier versions of odoc-parser
    • New inline math elements {m ...} available in doc-comments
    • New block math elements {math ...} available in doc-comments
See full changelog
  • Allow cancellation of workspace symbols requests (#777)

  • Fix unintentionally interleaved jsonrpc IO that would corrupt the session (#786)

  • Ignore SIGPIPE . (#788)

See full changelog

Fixes

  • Fix a bad interaction between inferred interfaces and promotion code actions in watch mode (#753)

  • Fix URI parsing (#739 fixes #471 and #459)

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