OCaml Changelog

RSS

Read the latest releases and updates from the OCaml ecosystem.

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://raw.githubusercontent.com/ocaml/opam/master/shell/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)
If you want to contribute to a new release announcement, check out the Contributing Guide on GitHub.