OCaml Changelog

RSS

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

We are excited to announce the release of dune-release 2.2.0 which brings full compatibility with cmdliner 2.0.0!

Please note that this release introduces a change in user-facing behavior: following the stricter requirements of Cmdliner 2.0, prefix-matching for command options is no longer supported. Users must now provide the full wording for all flags (for example, --skip-tests instead of --skip-test).

We recommend that all users update their automation scripts to use explicit, full-length options to ensure a smooth transition.

See full changelog

Breaking

  • Update to use cmdliner 2.0.0. Shortened arguments will not work anymore. (#512, @psafont)

Dune 3.21.0

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

This is a large release, including dozens of fixes, improvements, and additions, thanks to many contributors. See the full changelog for all changes and contributors.

If you encounter a problem with this release, please report it in our issue tracker.

See full changelog

Fixed

  • Fix include_subdirs qualified incorrectly picking the furthest module instead of the closest when resolving module name ambiguities. (#12587, @ElectreAAS and @Alizter)

  • Fix: include the module alias in the transitive dependency closure with (include_subdirs qualified). (#12299, @anmonteiro)

  • Improve error messages for invalid version formats containing non-ASCII characters. Previously, non-ASCII characters in version strings (e.g., (lang dune è) or (using menhir π3.14)) would fail with a generic "Invalid file" error. Now they display a clear message: "Invalid atom: contains non-ASCII character(s). Atoms must only contain ASCII characters." The fix is implemented at the lexer level, providing consistent error handling across all s-expression parsing. (#12844, fixes #12836, @benodiwal)

  • Pass private modules with -H when this is available (#12666, @rgrinberg)

  • Allow multiple modules in (modules_flags ...), in coq.theory (#12733, @rlepigre)

  • Improve error message for invalid version formats in both (lang dune ...) and (using extension ...) declarations. Changes "Atom of the form NNN.NNN expected" to "Invalid version. Version must be two numbers separated by a dot." (#12833, @benodiwal)

  • Fix crash when running dune build @check on a library with virtual modules. (#12644, fixes #12636, @Alizter)

  • Provide a more informative error message when (pkg enabled) is put in dune-project instead of dune-workspace. (#12802, fixes #12801, @benodiwal)

  • Improve error message when invalid version strings are used in dune-project files. Non-ASCII characters and malformed versions now show a helpful hint with an example of the correct format. (#12794, fixes #12751, @benodiwal)

  • Stop hiding the root_module from the include path (#12239, @rgrinberg)

  • Allow $ dune init to work on absolute paths (#12601, fixes #7806, @rgrinberg)

  • (include_subdirs qualified): Add missing alias dependency to module group. (#12530, @anmonteiro)

  • Add Melange compilation to the @all alias in libraries (#12628, @anmonteiro)

  • Fix greedy version location in lang declarations. Previously, error locations for invalid lang versions would span multiple bytes for multi-byte UTF-8 characters, causing carets to appear misaligned and seemingly include the closing parenthesis. Now, error locations for ASCII strings show the full length (e.g., "Ali" shows ^^^), while non-ASCII strings show only the first byte (e.g., "è" shows ^) to avoid multi-byte character display issues. (#12869, fixes #12806, @benodiwal)

  • melange support: don't emit empty JavaScript modules for generated module aliases. (#12464, @anmonteiro)

Added

  • (Experimental): Introduce the library_parameter stanza. It allows users to declare a parameter when using the OxCaml compiler. (#11963, implements #12084, @maiste)
  • Added the ability to scroll horizontally in TUI. (#12386, @Alizter)
  • Feature: Include shell command that was executed when a cram test has occurred in the error message (#12307, @rgrinberg)
  • support expanding variables in (promote (into ..)) (#12832, fixes #12742, @anmonteiro)
  • Add support for %{cmt:...} and %{cmti:...} variables to reference compiled annotation files (.cmt and .cmti) containing typed abstract syntax trees with location and type information. (#12634, grants #12633, @Alizter)
  • Add $ dune describe tests to describe the tests in the workspace (@Gromototo, #12545, fixes #12030)
  • Add argv, the process environment, and the dune version to the config event in the trace (#12909, @rgrinberg)
  • Allow dune runtest to properly run while a watch mode server is running. (#12473, grants #8114, @gridbugs and @ElectreAAS)
  • Use copy-on-write (COW) when copying files on filesystems that support it (Btrfs, ZFS, XFS, etc), under Linux. (#12074, fixes #12071, @nojb)
  • Add support for Tangled ATproto-based code repositories (#12197, @avsm)
  • Add support for instantiating OxCaml parameterised libraries. (#12561, @art-w)
  • Add a (conflict_markers error|ignore) option to the cram stanza. When (conflict_markers error) is set, the cram test will fail in the presence of conflict markers. Git, diff3 and jujutsu conflict markers are detected. (#12538, #12617, #12655, fixes #12512, @rgrinberg, @Alizter)
  • Introduce a %{ppx:lib1+..+libn} stanza to make it possible to refer to ppx executables built by dune. This is useful for writing tests (#12711, @rgrinberg)
  • Introduce a (dir ..) field on packages defined in the dune-project. This field allows to associate a directory with a particular package. This makes dune automatically filter out all stanzas in this directory and its descendants with --only-packages. All users are recommended to switch to using this field. (#12614, fixes #3255, @rgrinberg)
  • Add support for DUNE_ROOT environment variable, similar to the existing --root CLI parameter. (fixes #12399 @sir4ur0n)
  • Introduce an unused-libs alias to detect unused libraries. (#12623, fixes #650, @rgrinberg)
  • Add --files flag to dune describe opam-files to print only the names of the opam files line by line. (#9793, @reynir and @Alizter)
  • dune exec now accepts absolute paths inside the workspace. (#12094, @Alizter)
  • Add coqdoc_header and coqdoc_footer fields to the coq field of the env stanza, and to the coq.theory stanza, allowing to configure a custom header or footer respectively in the HTML output of coqdoc. (#11131, @rlepigre)
  • Allow dune fmt to properly run while a watch mode server is running. Note that the --preview flag is not supported in this mode. (#12064, @ElectreAAS)
  • Support for generating _CoqProject files for coq.theory stanzas. (#11752, @rlepigre)
  • Added (files) stanza, similar to (dirs) to control which files are visible to Dune on a per-directory basis. (#12879, @nojb)
  • Add support for %{ocaml-config:ox} (#12236, @jonludlam)
  • Introduce dune promotion show command to display the contents of corrected files that are ready for promotion. This allows users to preview changes before running dune promote. The command accepts file arguments to show specific files, or displays all promotable files when called without arguments. (#12669, fixes #3883, @MixiMaxiMouse)
  • New (lang rocq) build mode for Rocq 9.0 and later. This new mode is very similar to the existing (lang coq), except that it doesn't need the coq* compatibility wrappers. As of today (lang rocq) doesn't support yet composed builds with Rocq itself, this will be added later. (lang coq) is deprecated, development is frozen, and will be removed at some point in the future. (#12035, @ejgallego, @lysxia, fixes #11572)

Changed

  • Don't run ocamldep to compute false dependencies on the root_module (#12227, @rgrinberg)
  • dune format-dune-file now uses the syntax version of the Dune project that contains the file being formatted (if any) instead of using the latest version available, which remains the default if there is no Dune project in scope. (#11865, @nojb)
  • Persistent DB and process events have been slightly modified. Persistent DB events have more concise names and job events always include full information. (#12867, @rgrinberg)
  • Removed the --trace-extended flag. Its functionality is always enabled when tracing is active (#12908, @rgrinberg)
  • The test/dune file generated by dune init proj now depends on the project library. (#12791, @shonfeder)
  • Starting with version 3.21 of the Dune language, Dune no longer changes the default set of compiler warnings. For users that would like to keep the old behaviour, the variable %{dune-warnings} can be used in an (env) stanza in a top-level Dune file: (env (dev (flags :standard %{dune-warnings}))). (#12766, @nojb)
  • Fix: stop generating cmt files for cinaps binaries (#12530, @rgrinberg)

This release of ocaml-lsp-server introduces support for .mlx files, new custom requests, and configuration updates for code-lens.

Features

  • .mlx Support: Added support for .mlx files, including diagnostics, code actions, hover, and formatting via ocamlformat-mlx.
  • New Custom Requests: Added typeExpression, locate, and phrase requests to the server.
  • Code-Lens Configuration: code-lens for nested let bindings is now configurable.

Fixes and Improvements

  • Configuration Fallback: The server now falls back to .merlin configuration if a dune-project file is missing, provided dot-merlin-reader is installed.
  • Metrics: Improved the precision of timestamps for collected metrics.
See full changelog

Features

  • Make code-lens for nested let bindings configurable (#1567)
  • Add support for .mlx files, including formatting via ocamlformat-mlx and most OCaml LSP features (diagnostics, code actions, hover, etc.) (#1528)
  • Add typeExpression custom request (#1576)
  • Add locate custom request (#1576)
  • Add phrase custom request (#1576)

Fixes

  • Improve precision of collected metrics timestamps. (#1565)
  • Fallback on .merlin configuration if no dune-project file is found and if dot-merlin-reader is installed. (#1563, fixes #1522)

We're happy to announce the release of merlin v5.6.1-504!

This latest release brings performance optimizations, refined editor behavior, and improved stability to your OCaml development environment.

Key Improvements

  • Smarter Signature Help: Now triggers correctly on unfinished let ... in bindings and no longer appears redundantly on function names.
  • More Reliable Completion: Fixed issues with completion for inlined record labels.
  • Improved Performance: Optimized buffer indexing and path calculations to ensure Merlin remains fast and responsive during heavy editing.
  • Bug Fixes:
    • Resolved a bug where the document command concatenated labels and variants incorrectly.
    • Fixed various minor issues in the underlying C code and added regression tests to prevent previous crashes from returning.
See full changelog
  • merlin binary
    • Fix a plethora of minor issues with the C code (#1998)
  • merlin library
    • Signature help should not appear on the function name (#1997)
    • Fix completion not working for inlined records labels (#1978, fixes #1977)
    • Perform buffer indexing only if the query requires it (#1990 and #1991)
    • Stop unnecessarily forcing substitutions when initializing short-paths graph (#1988)
    • Fix Mocaml.with_printer didn't update replacement_printer_doc (#2010)
    • test suite
    • Add a test to ensure the behavior showed in issue #1517 is no longer relevant (#1995)
    • Add a test to ensure the code fragment exhibited in issue #1118 no longer makes Merlin crash (#1996)
    • Add a test case illustrating how a snippet produces two unrelated errors in issue #2000. (#2003)
    • Add a test reproducing issue #1983 where document command which sometime concatenates consecutive variants and labels (#2005)
    • Signature-help should trigger on unfinished let ... in bindings (#2009)

We're happy to announce the release of merlin v4.7.1-413, which fixes an issue in the merlin binary that prevented installation!

See full changelog
  • merlin binary
    • Fix an issue preventing installation. (fixes #1993)

2.5.0

Hi everyone,

We’re happy to announce the release of opam 2.5.0 and encourage all users to upgrade.

Note: the following section will recap the various major changes in opam 2.5.0 for anyone who haven’t already read the previous pre-release announcements. For those who did, note that nothing changed between 2.5.0~beta1 and the final 2.5.0.

What’s new? Some highlights:

  • Speedup opam update up to 70%. Thanks to @arozovyk, opam update now load opam file incrementally, only parsing the files that have changed since the last time you called opam update. Before that, opam files in opam repositories were all loaded after an update if there was any change. The performance improvement of this change thus depends on how often you call opam update and what type of repository and OS you are using. (#5824)
  • Improved shell integration. A number of users have been hitting issues with opam’s shell integration where parts of a previous environment was kept in the current environment, causing a number of issues. These can be triggered by, for example, nuking your opam root directory (by default ~/.opam or %LocalAppData%\opam). For this particular case we are still working on a fix, but many other users have reported similar issues without nuking their root directory and in that case we believe to have fixed the majority of issues. (dbuenzli/topkg#142, #4649, #5761)
  • ² We’ve also changed the default file to which opam init writes the opam shell integration to be .bashrc instead of the previous .profile or .bash_profile when bash is detected. Doing it this way prevents some issues with existing .profile files that source the .bashrc file and causing an infinity loop when opam asks users to make sure to source their .bashrc file into their .profile file. (#5819, #4201, #3990)
  • The opam install script now installs an appropriate apparmor profile on systems configured with apparmor (this is enabled by default on Ubuntu). This change is not strictly speaking related to this release as it is deployed for every versions. (#5968).
  • Many more UI additions and improvements, bug fixes, …

You can read our blog post for more information about these changes and more, and for even more details you can take a look at the release note or the changelog.


Try it!

The upgrade instructions are unchanged:

For Unix systems

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

or from PowerShell for Windows systems

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

Please report any issues to the bug-tracker.

Happy hacking,

<> <> The opam team <> <>

See full changelog

2.5.0:

  • (no difference compared to 2.5.0~rc1)

2.5.0~rc1:

  • (no difference compared to 2.5.0~beta1)

2.5.0~beta1:

  • Allow the macOS sandbox to write in the /var/folders/ and /var/db/mds/ directories as it is required by some of macOS core tools [#4797 @kit-ty-kate - fix #4389 #6460]
  • Fixed a bug occuring on version-equivalent package rename (i.e. pkg.00 -> pkg.0) leading to the package being completely removed [#6774 @arozovyk - fix #6754]
  • Stop opam switch create --dry-run from creating switch root directory by stopping the creation of build directory and writing the switch-state cache [#6540 @hannesm - fix #5918]
  • Stop cleaning the build directory when installing packages with --dry-run [#6540 @hannesm]
  • Build changes:
  • Add the upcoming OCaml 5.5 (trunk) support when using dune's dev profile [#6670 @kit-ty-kate]
  • opam no longer depends on cmdliner [#6755 @kit-ty-kate - fix #6425]
  • Clean variables before calling make on different projects (e.g. downlodad-if-missing OCaml compiler) to avoid clashes with other variables set by these projects [#6769 @kit-ty-kate]
  • Improve the release script:
  • Fix the placement of the vendored archives in the release tarball [#6765 @kit-ty-kate - fix #6762]
  • Fix the Windows build [#6769 @kit-ty-kate]
  • Improve and extend the testsuite [#6540 #6774 @arozovyk @kit-ty-kate]
  • Improve and extend the test infrastructure [#6732 @kit-ty-kate]
  • API changes in opam-state:
  • OpamRepositoryState.load_opams_from_diff: track added packages to avoid removing version-equivalent packages [#6774 @arozovyk - fix #6754]
  • API changes in opam-core:
  • OpamCmdliner was added. It is the new internal interface for Cmdliner, accessible through a new opam-core.cmdliner sub-library, however it is meant for internal use only. [#6755 @kit-ty-kate]

2.5.0~alpha1:

  • Implement incremental opam file loading to process only changed files during repository updates and repository state loading [#6614 @arozovyk - fix #5824]
  • The variables.*sh script used for shell hooks now only updates the environment if OPAM_SWITCH_PREFIX is unset-or-empty [#6729 @dra27 - fix dbuenzli/topkg#142, #4649, #5761]
  • Default to the .bashrc file instead of the .profile when writing the shell hook with bash during opam init [#6603 @kit-ty-kate - fix #5819 #4201 #3990]
  • Remove getconf from the list of required runtime tools, which allows opam init to work out-of-the-box on Haiku [#6634 @kit-ty-kate - fix #6632]
  • Archives without checksums now fetch only once per call of opam install if their url match [#6627 @psafont - fix #5638]
  • Do not ignore extra-files whose name is invalid and fail early in that case [#6679 @rjbou @kit-ty-kate]
  • Refine the specification of pkg:opamfile variable and update its computation accordingly [#6659 @kit-ty-kate - fix #5346]
  • Make global option default-invariant modifiable [#6730 @rjbou]
  • Raise a warning instead of a fatal uncaught exception when an item of extra-files is missing [#6696 @rjbou]
  • No longer ignore extra-files whose name is invalid and raise a warning in that case [#6679 @rjbou @kit-ty-kate]
  • csh: Don't double-set unconditional variables in variables.csh and env_hook.csh [#6729 @dra27]
  • The shell/install.sh script now installs an appropriate apparmor profile on systems configured with apparmor [#6647 @kit-ty-kate - fix #5968]
  • Improve the UI:
  • Show the invalid character when detecting an erroneous package name [#6638 @lefessan - fix #6396]
  • Improve the error messages on opam source, especially in case of Failure [#6696 @rjbou]
  • The name of missing or erroneous extra-files are now displayed instead of their path in error messages [#6679 @kit-ty-kate @rjbou]
  • Remove duplicated directory separator when displaying some rare filenames [#6703 @rjbou]
  • Handle non-displayable characters when detecting an erroneous package name or version [#6640 @kit-ty-kate]
  • More fine grained error message in opam install in case of bad hash or missing extra-files error (and remove raw fatal error) [#6696 @rjbou]
  • Update warning messages when the git remote is not found and when skipping local pins [#6422 @rjbou]
  • Add an upgrade advice if the repository is 1.2 version, for all opam admin commands except upgrade [#6385 @rjbou]
  • Bug fixes:
  • Fix erroneous recompilations on opam files with empty but present build/runtest/install/remove field [#6505 @kit-ty-kate - fix #5814]
  • Fix parsing of OPAMFETCH (support quotes / proper POSIX shell syntax) [#5492 @kit-ty-kate - fix #5490]
  • Fix opam remove --force that was launching commands in current directory [#6672 @rjbou - fix #6570]
  • Fix opam lock's error message on pinned packages with no git remote by handling exit code 2 from git remote get-url [#6422 @rjbou]
  • Fix opam install pkg --depext-only exiting with code 0 instead of 20 (not found) [#6516 @rjbou - fix #6488]
  • Fix the false-positive mismatch debug warning during opam update when faced with nested extra-files on Windows [#6715 @kit-ty-kate]
  • Check the status of git submodules when checking if a repository is up-to-date [#6132 @kit-ty-kate]
  • Harden the parsing of apk policy on Alpine [#6742 @kit-ty-kate]
  • Build changes:
  • Update the dependency constraint on patch to now require its stable version [#6663 @kit-ty-kate]
  • Update the download-if-missing dependencies to their latest version (re.1.14.0, dune.3.20.2, menhir.20250903) [#6700 @kit-ty-kate]
  • Remove seq from the list of packages to download-if-missing as it is no longer a dependency of re [#6700 @kit-ty-kate]
  • ./configure --enable-static is now supported on OpenBSD [#6705 @flumf]
  • Add missing constraints to avoid cmdliner 2.0.0 [#6707 @kit-ty-kate]
  • Add patch library dependency to opam-state [#6614 @arozovyk]
  • Update the bootstrap compiler's flexdll to 0.44 [#6592 @MisterDA]
  • Update the msvs-detect script used on Windows during compiler bootstrap to 0.7.0 [#6592 @MisterDA]
  • Improve the release script:
  • The OpenBSD binary now a full static binary [#6705 @flumf @kit-ty-kate - fix #6241]
  • The release archive (opam-full-*.tar.gz) is now reproducible [#6706 @kit-ty-kate - fix #6619]
  • Various internal changes:
  • Replace every polymorphic uses of List.mem by a version that doesn't use Repr.equal [#6644 @kit-ty-kate]
  • Simplify the src_ext/update-sources.sh script [#6701 @kit-ty-kate]
  • Homogeneise verbose command output between sandboxed and non sandboxed one [#6675 @rjbou]
  • Add the install-pin-depends, ignore-pin-depends, proceed-actions and switch-clean-up named questions (for opam developers use only) [#6611 @kit-ty-kate @rjbou]
  • Add logging for file reads and writes [#6679 @rjbou]
  • Add cli version 2.5 [#6709 @kit-ty-kate]
  • Add mechanism for the OPAMAUTOANSWER environment variable (for opam developers use only) [#6709 @kit-ty-kate]
  • Complete upgrade mechanism to permit on the fly upgrade and write upgrade from repo and switch level [#6416 @rjbou]
  • Enforce repository root check for every opam admin commands [#6385 @rjbou]
  • Improve and extend the testsuite [#6673 #6450 #6638 #6627 #6640 #6671 #6690 #6688 #6691 #6659 #6659 #6675 #6715 #6614 #6719 #6611 #6679 #6153 #6516 #6672 #6741 #6729 #6505 #6422 #5492 #6385 @rjbou @kit-ty-kate @arozovyk @dra27]
  • Improve and extend the benchmarks [#6681 @arozovyk]
  • Improve and extend the test infrastructure [#6624 #6450 #6663 #6675 #6710 #6708 #6734 #6643 #6652 #6648 #6582 #6394 #6656 #6655 #6657 #6666 #6676 #6701 #6741 #6745 @kit-ty-kate @rjbou @arozovyk]
  • Improve and extend the documentation [#6620 #6631 #6650 #6653 #6653 #6596 #6364 #6660 @kit-ty-kate @jmid @gahr @mbarbin @arozovyk]
  • API changes in opam-client:
  • OpamAdminRepoUpgrade: add upgradefrom_version that have version "1.2" hardcoded [#6391 @rjbou]
  • OpamClientConfig.opam_init: now takes an optional auto_answer argument [#6709 @kit-ty-kate]
  • API changes in opam-repository:
  • OpamLocal.rsync_*: change the return type from OpamFilename.* to unit [#6658 @kit-ty-kate]
  • OpamRepository.update: changed the 'Changes return type to include Patch.operation list of changes. [#6614 @arozovyk]
  • OpamRepositoryBackend.update type : include the Patch.t list in Update_patch variant [#6614 @arozovyk]
  • OpamRepositoryBackend.get_diff: include Patch.t list in the return type (along with filename) [#6614 @arozovyk]
  • API changes in opam-state:
  • OpamRepositoryState: add load_opams_from_diff to update package definitions based on file change operations (diff) [#6614 @arozovyk]
  • OpamRepositoryState.get_repo_files: was added [#6679 @kit-ty-kate @rjbou]
  • OpamSwitchState.files: was removed [#6662 @kit-ty-kate]
  • OpamSwitchState.overlay_opam_file: was added [6679 @rjbou]
  • API changes in opam-format:
  • OpamFile.OPAM.get_metadata_dir: was removed [#6679 @kit-ty-kate]
  • OpamFile.OPAM.get_extra_files: no longer takes a named repos_roots argument and instead takes a named get_repo_files argument. It also now returns the content of the files instead of their path [#6679 @kit-ty-kate @rjbou]
  • OpamFormula: add equal function for OpamFormula.t [#6730 @rjbou]
  • OpamFormula.equal_relop: was added [#6644 @kit-ty-kate]
  • OpamTypesBase.{action,pkg_flag,simple_arg,arg,filter,command}_equal: were added [#6644 @kit-ty-kate]
  • OpamVariable.variable_contents_equal: was added [#6644 @kit-ty-kate]
  • API changes in opam-core:
  • OpamConsole.confirm: now takes an optional name argument (for opam developers use only) [#6709 @kit-ty-kate]
  • OpamConsole.log: does not keep log messages before initialization if the code is ran through a library [#6487 @kit-ty-kate]
  • OpamCoreConfig.auto_answer: field and arguments were added [#6709 @kit-ty-kate]
  • OpamCoreConfig.{answer,anwser_is,answer_is_yes}: now take a name labeled argument (for opam developers use only) [#6709 @kit-ty-kate]
  • OpamCoreConfig.in_opam: was added [#6487 @kit-ty-kate]
  • OpamCompat.Lazy: add map_val [#6679 @rjbou]
  • OpamCompat.List.fold_left_map: was added [#6442 @kit-ty-kate]
  • OpamCompat.List.equal: was added [#6644 @kit-ty-kate]
  • OpamCompat.Map.filter_map: was added [#6442 @kit-ty-kate]
  • OpamCompat.MAP: was added [#6442 @kit-ty-kate]
  • OpamCompat.Pair.equal: was added [#6644 @kit-ty-kate]
  • OpamCompat.String.{starts_with,ends_with,for_all,fold_left}: were added [#6442 @kit-ty-kate]
  • OpamFilename.create: deduplicate the directory separator character when the basename starts with one [#6703 @rjbou]
  • OpamFilename: add parse_patch that preprocesses and parses a patch file. [#6614 @arozovyk]
  • OpamFilename.patch: use variants to make the input either Filename.t or reuse Patch.diffs directly. Remove the ?preprocess argument since the preprocess logic is moved to the OpamFilename.parse_patch function that is called only in OpamVCS (mirroring the previous logic). [#6614 @arozovyk]
  • OpamHash.check_string: was added [#6661 @kit-ty-kate]
  • OpamHash.equal_kind: was added [#6644 @kit-ty-kate]
  • OpamShellCommand: create the module and add of_string [#5492 @kit-ty-kate]
  • OpamStd.Char: Create the module and export is_whitespace [#5492 @kit-ty-kate]
  • OpamStd.Config.auto_answer: was added (for opam developers use only) [#6709 @kit-ty-kate]
  • OpamStd.List.fold_left_map: was moved to OpamCompat.List.fold_left_map [#6442 @kit-ty-kate]
  • OpamStd.List.{cons,find_opt,filter_map}: were removed. Use Stdlib.List instead. [#6442 @kit-ty-kate]
  • OpamStd.List.mem: was added, having as argument the equality function [#6644 @kit-ty-kate]
  • OpamStd.Map.filter_map: is now the implementation from Stdlib.Map when using OCaml >= 4.11 [#6442 @kit-ty-kate]
  • OpamStd.Map.{find_opt,choose_opt,fold,map,mapi}: are now the implementation from Stdlib.Map [#6442 @kit-ty-kate]
  • OpamStd.Op.{(@@),(|>)}: were removed. Use Stdlib instead. [#6442 @kit-ty-kate]
  • OpamStd.Option.{map,iter,compare,equal,to_string,some}: were removed. Use Stdlib.Option instead. [#6442 @kit-ty-kate]
  • OpamStd.Set.{map,choose_opt,fold}: are now the implementation from Stdlib.Set [#6442 @kit-ty-kate]
  • OpamStd.String.contains_char: was removed. Use Stdlib.String.contains instead. [#6442 @kit-ty-kate]
  • OpamStd.String.map: was removed. Use Stdlib.String.map instead. [#6442 @kit-ty-kate]
  • OpamStd.String.{starts_with,ends_with,for_all,fold_left}: were moved to OpamCompat.String [#6442 @kit-ty-kate]
  • OpamSystem.cpu_count: now uses a C binding instead of system utilities to get the number of cores of the current machine [#6634 @kit-ty-kate]
  • OpamSystem.is_reg_dir: is now exposed, which returns true only if its parameter is a directory, exists and is not a symlink. It returns false otherwise [#6450 @kit-ty-kate]
  • OpamSystem.patch: change the signature to work directly with Patch.diffs (implementation is now the previously internal_patch function), parsing is now done separately. [#6614 @arozovyk]
  • OpamSystem: add lower-level parse_patch that preprocesses and parses a patch file. [#6614 @arozovyk]

We announce the release of opam-publish 2.7.1, whose full release notes can be seen here.

Changes in opam-publish 2.7.1

In 2.7.0, opam-publish changed the way user’s branches are pushed to their GitHub forks before opening a PR, switching from using SSH keys to using the GitHub API token that opam-publish already requires.

2.7.1 fixes a couple of bugs related to that where opam-publish stopped working if the GitHub Action workflow files of upstream opam-repository are changed, owing to the way GitHub token permissions work. Thanks to @filipeom both for the original contribution in 2.7.0 and for subsequent work on it in 2.7.1.

Read our blog post for more details.

Please report any issues to the opam-publish bug-tracker.

See full changelog
  • Advertise the need, and check, for the workflow scope for github personal access tokens [#184 @kit-ty-kate - fix #180]
  • Enforce the git remote used to push branches to users' fork to be used instead of the SSH method, for users migrating from versions of opam-publish prior to 2.7.0 [#179 @filipeom - fix #178]
  • Avoid potential previously used tokens with the wrong permissions to be used instead of the new one [#179 @filipeom - fix #187]
  • Add support for the opam 2.5 API [#181 #173 @kit-ty-kate]

We're happy to announce the release of OCamlFormat 0.28.1!

Highlight

  • * Support for OCaml 5.4 (#2717, #2720, #2732, #2733, #2735, @Julow, @Octachron, @cod1r, @EmileTrotignon) OCamlformat now supports OCaml 5.4 syntax. Module packing of the form ((module M) : (module S)) are no longer rewritten to (module M : S) because these are now two different syntaxes.
  • * Reduce indentation after |> map (fun (#2694, @EmileTrotignon) Notably, the indentation no longer depends on the length of the infix operator, for example:
    (* before *)
    v
    |>>>>>> map (fun x ->
                x )
    (* after *)
    v
    |>>>>>> map (fun x ->
        x )
    
    @@ match can now also be on one line.
See full changelog

CHANGES:

  • * Support for OCaml 5.4 (#2717, #2720, @Julow, @Octachron)
    OCamlformat now supports OCaml 5.4 syntax.
    Module packing of the form ((module M) : (module S)) are no longer
    rewritten to (module M : S) because these are now two different syntaxes.

  • * Reduce indentation after |> map (fun (#2694, @EmileTrotignon)
    Notably, the indentation no longer depends on the length of the infix
    operator, for example:

    (* before *)
    v
    |>>>>>> map (fun x ->
                x )
    (* after *)
    v
    |>>>>>> map (fun x ->
        x )
    

    @@ match can now also be on one line.

  • Added option module-indent option (#2711, @HPRIOR) to control the indentation
    of items within modules. This affects modules and signatures. For example,
    module-indent=4:

    module type M = sig
        type t
    
        val f : (string * int) list -> int
    end
    
  • exp-grouping=preserve is now the default in default and ocamlformat
    profiles. This means that its now possible to use begin ... end without
    tweaking ocamlformat. (#2716, @EmileTrotignon)

  • Starting in this release, ocamlformat can use cmdliner >= 2.0.0. When that is
    the case, the tool no longer accepts unambiguous option names prefixes. For
    example, --max-iter is not accepted anymore, you have to pass the full
    option --max-iters. This does not apply to the keys in the .ocamlformat
    configuration files, which have always required the full name.
    See dbuenzli/cmdliner#200.
    (#2680, @emillon)

  • * The formatting of infix extensions is now consistent with regular
    formatting by construction. This reduces indentation in f @@ match%e
    expressions to the level of indentation in f @@ match. Other unknown
    inconsistencies might also be fixed. (#2676, @EmileTrotignon)

  • * The spacing of infix attributes is now consistent across keywords. Every
    keyword but begin function, and fun had attributes stuck to the keyword:
    match[@a], but fun [@a]. Now its also fun[@a]. (#2676, @EmileTrotignon)

  • * The formatting oflet a = b in fun ... is now consistent with other
    contexts like a ; fun .... A check for the syntax let a = fun ... in ...
    was made more precise. (#2705, @EmileTrotignon)

  • * |> begin, ~arg:begin, begin if, lazy begin, begin match,
    begin fun and map li begin fun can now be printed on the same line, with
    one less indentation level for the body of the inner expression.
    (#2664, #2666, #2671, #2672, #2681, #2685, #2693, @EmileTrotignon)
    For example :

    (* before *)
    begin
      fun x ->
        some code
    end
    (* after *)
    begin fun x ->
      some code
    end
    
  • * break-struct=natural now also applies to sig ... end. (#2682, @EmileTrotignon)

  • Fixed wrap-comments=true not working with the janestreet profile (#2645, @Julow)
    Asterisk-prefixed comments are also now formatted the same way as with the
    default profile.

  • Fixed nested-match=align not working with match%ext (#2648, @EmileTrotignon)

  • Fixed the AST generated for bindings of the form let pattern : type = function ...
    (#2651, @v-gb)

  • Print valid syntax for the corner case (1).a (#2653, @v-gb)

  • Ast_mapper.default_mapper now iterates on the location of in in let+ .. in ..
    (#2658, @v-gb)

  • Fix missing parentheses in let+ (Cstr _) : _ = _ (#2661, @Julow)
    This caused a crash as the generated code wasn't valid syntax.

  • Fix bad indentation of let%ext { ... (#2663, @EmileTrotignon)
    with dock-collection-brackets enabled.

  • ocamlformat is now more robust when used as a library to print modified ASTs
    (#2659, @v-gb)

  • Fix crash due to edge case with asterisk-prefixed comments (#2674, @Julow)

  • Fix crash when formatting mld files that cannot be lexed as ocaml (e.g.
    containing LaTeX or C code) (#2684, @emillon)

  • * Fix double parens around module constraint in functor application :
    module M = F ((A : T)) becomes module M = F (A : T). (#2678, @EmileTrotignon)

  • Fix misplaced ;; due to interaction with floating doc comments.
    (#2691, @EmileTrotignon)

  • The formatting of attributes of expression is now aware of the attributes
    infix or postix positions: ((fun [@a] x -> y) [@b]) is formatted without
    moving attributes. (#2676, @EmileTrotignon)

  • begin%e ... end and begin [@a] ... end nodes are always preserved.
    (#2676, @EmileTrotignon)

  • begin end syntax for () is now preserved. (#2676, @EmileTrotignon)

  • Fix a crash on type 'a t = A : 'a. {a: 'a} -> 'a t. (#2710, @EmileTrotignon)

  • Fix a crash where type%e nonrec t = t was formatted as type nonrec%e t = t,
    which is invalid syntax. (#2712, @EmileTrotignon)

  • Fix commandline parsing being quadratic in the number of arguments
    (#2724, @let-def)

  • * Fix ;; being added after a documentation comment (#2683, @EmileTrotignon)
    This results in more ;; being inserted, for example:

    (* before *)
    print_endline "foo"
    let a = 3
    
    (* after *)
    print_endline "foo" ;;
    let a = 3
    

0.37.0

We are pleased to announce the release of ppxlib 0.37.0. This version introduces initial support for the OCaml 5.4 compiler and provides several enhancements to AST handling and code generation.

Key Highlights

  • OCaml 5.4 Support: This release includes initial support for OCaml 5.4.
  • Module Derivers: Users can now derive code from module bindings and module declarations, expanding the scope of automated code generation.
  • New Context-Free Rules: A new rule type has been added to replace AST nodes that have specific registered attributes attached to them.
  • Astlib Enhancements: Added Longident.to/of_compiler to astlib to simplify the maintenance of PPXs that interact with compiler-libs components like the type checker.

Bug Fixes and Improvements

  • Printer Fixes: Resolved an issue where infix operators (e.g., mod) were incorrectly printed as raw identifiers in Pprintast.
  • Migration Accuracy: Fixed 5.2 to 5.3 migration for constants to ensure correct location data, improving the quality of error messages.
  • AST Cleanup: The AST is now automatically cleaned of ppxlib migration attributes when using Pretty_print mode with the use_compiler_pp flag.
  • Custom Printing: Added a ?printer configuration parameter to pp_ast functions to support custom printers.

Deprecations and API Changes

  • Inline Tags: Added @@@ppxlib.inline.end and formally deprecated @@@deriving.end.
  • Error Exposure: Ppxlib.Location.Error.t is now explicitly exposed as an alias for Astlib.Location.Error.t.
See full changelog

CHANGES:

5.4 Support

Other Changes

  • Add Longident.to/of_compiler to astlib to simplify maintenance
    of ppx-es that interacts with other parts of the compiler-libs such
    as the type checker. (#603, @NathanReb)

  • Fix a bug where some infix operators such as mod would be printed as
    raw identifiers by our Pprintast. (#601, @NathanReb)

  • Fix 5.2 -> 5.3 migration of constants. Those used to always have a none
    location which can lead to unhelpful error messages.
    (#569, @NathanReb)

  • Add a new context-free rule type that replaces AST nodes that have the registered
    attributes attached to them. (#574, @Skepfyr)

  • Allow users to derive code from module bindings and module declarations
    (#576, @patricoferris)

  • Expose Ppxlib.Location.Error.t = Astlib.Location.Error.t (#593, @ceastlund)

  • Add @@@ppxlib.inline.end, deprecate @@@deriving.end. (#594, @ceastlund)

  • Clean the AST of any ppxlib migration attributes whenever printing using
    Pretty_print mode and the use_compiler_pp flag. (#598, @patricoferris)

  • Add custom printer support to pp_ast functions via the ?printer config
    parameter. (#526, @pedrobslisboa)

We have the pleasure of celebrating the birthdays of Camille Saint-Saëns and Karl Schwarzschild by announcing the release of OCaml version 5.4.0.

Some of the highlights of OCaml 5.4.0 are:

Labelled tuples

It is now possible to put labels on tuple fields

let ( * ) (x,~dx) (y,~dx:dy) = x*.y, ~dx:(x *. dy +. y *. dx )

Those labeled tuples are equivalent to SML records: they are an order-dependent and structurally-typed variants of records. They are mostly intended for local types.

Array literal syntax support for immutable arrays and floatarrays

The array literal syntax is now shared by array-like primitive datatypes, like 'a array, floatarray and immutable array iarray. For instance, this code

let x =
  let x = Array.Flotarray.create 3 in
  Array.Flotarray.set x 0 1.;
  Array.Flotarray.set x 1 2.;
  Array.Flotarray.set x 2 3.;
  x

can now be written

let x : floatarray = [|0.; 1.; 2.|]

This also supported in patterns

let one = match x with
  | [|_;y;_|] -> Some y
  | _ -> None

However array indexing still needs to go through user-defined indexing operator

let (.$()) = Array.Floatarray.get
let (.$()<-) = Array.Floatarray.set
let () = x.$(0) <- x.$(1)

Immutable arrays

Along with shared array literals, OCaml 5.4 adds support for immutable arrays.

let v: int iarray = [| 0; 1; 2 |]

Immutable arrays are covariant in the type of their elements, it is thus possible to coerce immutable arrays with no costs at runtime:

let i1: _ iarray = [|object method m = 0 end|]
let i2 = ( i1 :> < > iarray)

Atomic record fields

It is now possible to mark a field of a record as atomic. Atomic operations on those fields require to use the new Atomic.Loc submodule after accessing the location of those fields with the [%atomic.loc ...] builtin extension. For instance,

type 'a mpsc_list = { mutable head:'a list; mutable tail: 'a list [@atomic] }

let rec push t x =
  let before = Atomic.Loc.get [%atomic.loc t.tail] in
  let after = x :: before in
  if not (Atomic.Loc.compare_and_set [%atomic.loc t.tail] before after) then
    push t x
  ...

Moreover, it is forbidden to pattern match on atomic fields:

let f { head; tail } = tail;;
Error: Atomic fields (here tail) are forbidden in patterns,
      as it is difficult to reason about when the atomic read
      will happen during pattern matching: the field may be read
      zero, one or several times depending on the patterns around it.

in order to make all reads explicit.

Four new standard library modules: Pair, Pqueue, Repr, and Iarray

The standard library has been extended with four new modules:

  • Pair: functions for working on pairs
let ones = Pair.map_fst succ (0,1)
  • Pqueue: priority queues, generic or not
module Int_pqueue = Pqueue.MakeMin(Int)
let q = Int_pqueue.of_list [4;0;5;7]
let some_zero = Int_pqueue.pop_min q
  • Repr: physical and structural equality, comparison function, more generically all functions dependent on the memory representation of values.
let f = Repr.phys_equal (ref 0) (ref 0)
  • Iarray: functions on immutable arrays
let a = Iarray.init 10 Fun.id
let b = Iarray.map succ a

Restored "memory cleanup upon exit" mode

This mode allows to restart many time the OCaml runtime in C-driven programs that interact with OCaml libraries. It is also useful to reduce noise when tracking memory leaks in C code running the OCaml runtime. To get around cancellation issues, the restored mode currently assume that all domains are joined before exiting the OCaml runtime.

A new section in the reference manual on profiling OCaml programs on Linux and macOS

A new section in the reference manual explains how to use OS specific profiling tools to profile native OCaml programs.

A lot of incremental changes:

  • Many runtime and code generation improvements
  • More than thirty new standard library functions
  • Nearly a dozen improved error messages
  • Around fifty bug fixes

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

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


Installation Instructions

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

opam update
opam switch create 5.4.0

The source code for the release 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.4.0+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.4.0+flambda+nffa ocaml-variants.5.4.0+options ocaml-option-flambda ocaml-option-no-flat-float-array
See full changelog

Language features:

  • #13097: added immutable arrays ('a iarray type, Iarray stdlib module) (Antal Spector-Zabusky and Olivier Nicole, review by Gabriel Scherer, Jeremy Yallop and Vincent Laviron)

  • #13340: Array literal syntax [| e1; ...; en |] can now be used to denote values of type 'a array and 'a iarray and floatarray, both in expressions and patterns. The compiler disambiguates each case by using contextual type information (assuming 'a array by default). (Nicolás Ojeda Bär, review by Richard Eisenberg, Jeremy Yallop, Jacques Garrigue, and Gabriel Scherer)

  • #13498: Tuple fields are now optionally labeled: (x:42, y:0) and let (~x, ~y) = ... in .... (Ryan Tjoa and Chris Casinghino, review by Gabriel Scherer, Chris Casinghino, and Leo White)

  • RFCs#39, #13404: atomic record fields { ...; mutable readers : int [@atomic]; ... } Atomic.Loc.fetch_and_add [%atomic.loc data.readers] 1 (Clément Allain and Gabriel Scherer, review by KC Sivaramakrishnan, Basile Clément and Olivier Nicole)

Standard library:

  • (breaking change) #14124: Do not raise Invalid_argument on negative List.{drop,take}. (Daniel Bünzli, review by Gabriel Scherer, Nicolás Ojeda Bär)
  • #13696: Add Result.product and Result.Syntax: let open Result.Syntax in let* x = ... in ... (Daniel Bünzli, review by Gabriel Scherer, Nicolás Ojeda Bär)

  • #12871: Add the Pqueue module to the stdlib. It implements priority queues. (Jean-Christophe Filliâtre, review by Daniel Bünzli, Léo Andrès and Gabriel Scherer)

  • #13760: Add String.{edit_distance,spellcheck} (Daniel Bünzli, review by wikku, Nicolás Ojeda Bär, Gabriel Scherer and Florian Angeletti)

  • #13753, #13755: Add Stdlib.Repr: Repr.phys_equal and Repr.compare are more explicit than (==) and compare. (Kate Deplaix, Thomas Blanc and Léo Andrès, review by Gabriel Scherer, Florian Angeletti, Nicolás Ojeda Bär, Daniel Bünzli and Jeremy Yallop)

  • #13695: Add Stdlib.Char.Ascii (Daniel Bünzli, review by by Nicolás Ojeda Bär and Jeremy Yallop)

  • #13720: Add Result.{get_ok',error_to_failure} (Daniel Bünzli, review by wikku, Gabriel Scherer, Nicolás Ojeda Bär, Vincent Laviron and hirrolot)

  • #13885: Add Dynarray.{exists2, for_all2}. (T. Kinsart, review by Daniel Bünzli, Gabriel Scherer, and Nicolás Ojeda Bär)

  • (breaking change) #13862: Make List.sort_uniq keep the first occurrences of duplicates. (Benoît Jubin, review by Nicolás Ojeda Bär, Gabriel Scherer)
  • #13836: Add [Float.]Array.{equal,compare}. (Daniel Bünzli, review by Nicolás Ojeda Bär and Gabriel Scherer)

  • #13796: Add Uchar.utf_8_decode_length_of_byte and Uchar.max_utf_8_decode_length. (Daniel Bünzli, review by Nicolás Ojeda Bär and Florian Angeletti)

  • #13768: Add Either.get_left and Either.get_right (T. Kinsart, review by Nicolás Ojeda Bär and Florian Angeletti)

  • (breaking change) #13570, #13794: Format, add an out_width function to Format device for approximating unicode width. (Florian Angeletti, review by Nicolás Ojeda Bär, Daniel Bünzli, and Gabriel Scherer)
  • #13731: Add Either.retract (Daniel Bünzli, review by Nicolás Ojeda Bär and David Allsopp)

  • #13729: Add Seq.filteri (T. Kinsart, review by Nicolás Ojeda Bär and Daniel Bünzli)

  • #13721: Add Result.retract (Daniel Bünzli, review by Gabriel Scherer, Nicolás Ojeda Bär and David Allsopp)

  • #13310: Add Stdlib.Pair (Victoire Noizet, review by Nicolás Ojeda Bär, Daniel Bünzli, Xavier Van de Woestyne, Jeremy Yallop and Florian Angeletti)

  • #13662: Add eager boolean operations Bool.logand, Bool.logor, Bool.logxor (Jeremy Yallop, review by Nicolás Ojeda Bär)

  • #13463, #13572: Avoid raising Queue.empty in Format when it is used concurrently, raise a specific exception instead. (Chritophe Raffalli, review by Gabriel Scherer and Daniel Bünzli)

  • #13620: Avoid copying the string in String.concat, String.sub and String.split_on_char when the full string is returned. (Christophe Raffalli, review by Nicolás Ojeda Bär and Gabriel Scherer and Hugo Heuzard)

  • #13727: Reimplement Sys.getenv_opt not to use exceptions internally, meaning that the current backtrace is preserved when Sys.getenv_opt returns None. (David Allsopp, review by Nicolás Ojeda Bär, Josh Berdine and Gabriel Scherer)

  • #13737: Avoid closure allocations in Weak.Make.add when resizing the table (Vincent Laviron, review by Gabriel Scherer and Daniel Bünzli)

  • #13740: Improve performance of Weak.find_aux (Josh Berdine, review by Gabriel Scherer)

  • #13782: Improve performance and type safety of Type.Id by using [%extension_constructor] instead of Obj.Extension_constructor.of_val. (Basile Clément, review by Vincent Laviron and Nicolás Ojeda Bär)

  • #13589: Expose Sys.io_buffer_size, the size of internal buffers used by the runtime system and the unix library. (Yves Ndiaye and Nicolás Ojeda Bär, review by Daniel Bünzli and Nicolás Ojeda Bär)

  • #13569: add a Format.format_text which adds break hints to format literals. (Florian Angeletti, review by Nicolás Ojeda Bär, Daniel Bünzli, and Gabriel Scherer)

  • #13578: On Windows, use the OS CSPRNG to seed the Stdlib.Random generator. (Antonin Décimo, review by Miod Vallat, Nicolás Ojeda Bär, and Xavier Leroy)

  • #13859: Fix Weak.get_copy not darkening custom blocks (Josh Berdine, review by Stephen Dolan)

  • #13909: Add Dynarray.unsafe_to_iarray (Olivier Nicole, review by Daniel Bünzli, Stefan Muenzel and Gabriel Scherer, request by Daniel Bünzli)

  • #13932: Add List.singleton and Seq.singleton (David Allsopp, tariffs applied by Nicolás Ojeda Bär and Gabriel Scherer)

  • (breaking change) #13843: Add signal definitions for SIGIO and SIGWINCH. Introduces a type alias for signal int, signal_to_string to convert OCaml signal numbers to their POSIX equivalent names, and signal_of_int/signal_to_int for converting between OCaml and platform signal numbers. (Reported in #13825) (Tim McGilchrist, review by David Allsopp, Nicolás Ojeda Bär, Daniel Bünzli Jan Midtgaard and Miod Vallat)

Runtime system:

  • #13500: Add frame pointers support for ARM64 on Linux and macOS. (Tim McGilchrist, review by KC Sivaramakrishnan, Fabrice Buoro and Miod Vallat)

  • #12964: Reintroduce "memory cleanup upon exit" mode. The cleanup will however be incomplete if not all domains have been joined when the main domain terminates. (Miod Vallat, review by KC Sivaramakrishnan, feedback from Nick Barnes and Gabriel Scherer)

  • #13582: Enable software prefetching support for ARM64, s390x, PPC64 and RiscV. Used during GC marking and sweeping to speed up both operations by prefetching data. (Tim McGilchrist, review by Nick Barnes, Antonin Décimo, Stephen Dolan and Miod Vallat)

  • #13675: Make Unix.map_file memory show up in Gc.Memprof. (Stephen Dolan, review by Guillaume Munch-Maccagnoni and Gabriel Scherer)

  • #13785: Add Runtime_events.Timestamp.get_current. (Simon Cruanes)

  • #13774: Fix for inaccurate live blocks/words stats in compaction. (Sadiq Jaffer, report by KC Sivaramakrishnan and Jan Midtgaard, review by Gabriel Scherer)

  • #13773: Ensure that shared pool owners are correctly set on pool adoption. (Stephen Dolan, review by Sadiq Jaffer and Gabriel Scherer)

  • (breaking change) #11449, #13497: Add caml_stat_char_array_{to,of}_os functions allowing conversion of string data which may contain NUL characters. Correct implementation of caml_stat_strdup_to_utf16 to raise Out_of_memory instead of returning of NULL (the behaviour of caml_stat_strdup_to_os was inconsistent between Unix/Windows). (David Allsopp, review by Nick Barnes, Antonin Décimo and Miod Vallat)
  • #13352: Concurrency refactors and cleanups. (Antonin Décimo, review by Gabriel Scherer, David Allsopp, and Miod Vallat)

  • #13437: Stop using GetProcAddress to load functions that were not available in older, now unsupported Windows versions. (Antonin Décimo, review by Nicolás Ojeda Bär and David Allsopp)

  • #13470: Constify some function parameters, flags tables, and some pointers in C code (take 3). (Antonin Décimo, review by Stephen Dolan and Miod Vallat)

  • #13492: Parse the CAML_LD_LIBRARY_PATH environment variable for the shared_libs_path item in ocamlrun -config in addition to displaying the entries found in ld.conf. (David Allsopp, review by Stephen Dolan)

  • #13496: Add missing .type and .size directives to main frametable to silence warnings from the linker when using libasmrun_shared on amd64 and power. The other backends already carried these directives. (David Allsopp, review by Tim McGilchrist and Miod Vallat)

  • #13354: Use C99 flexible array member syntax everywhere. (Antonin Décimo, review by Miod Vallat, Gabriel Scherer, and Xavier Leroy)

  • #11865, #13584: Fix a deadlock triggered by deleting C roots from C finalisers (Stephen Dolan, report by Timothy Bourke, review by Mark Shinwell and Damien Doligez)

  • #13613: Functions from caml/skiplist.h and caml/lf_skiplist.h no longer raise Out_of_memory exceptions that the runtime could not handle. (Guillaume Munch-Maccagnoni, review by Stephen Dolan)

  • #13575, #13635: Maintain OCaml frame pointers correctly even when using C libraries that do not support them. (Stephen Dolan and David Allsopp, report by Thomas Leonard, review by Tim McGilchrist and Fabrice Buoro)

  • #13643: Allow values reachable from ephemeron keys to be collected by minor GC (Stephen Dolan, review by François Bobot)

  • #13701: optimize caml_continuation_use based on #12735 (Hugo Heuzard, review by KC Sivaramakrishnan)

  • #13227, #13714: Review of locking in the multicore runtime. Fix deadlocks in runtime events and potential deadlocks with named values. (Guillaume Munch-Maccagnoni, review by Gabriel Scherer, tests by Jan Midtgaard)

  • #13736: Fix major GC pacing bug triggered by synchronous collections. (Nick Barnes, review by Damien Doligez and Tim McGilchrist)

  • #13827: Avoid re-marking ephemerons with trivial data. (Stephen Dolan, review by Nick Barnes and Josh Berdine, benchmarking by Nicolás Ojeda Bär)

  • #13300, #13861: introduce Gc.ramp_up to explicitly mark ramp-up phases of memory consumption and avoid GC overwork. Ramp-up behaviors are worse with OCaml 5 than with OCaml 4 due to higher sensitivity to excessive pacing computations. Indicating ramp-up explicitly eliminates the main known slowdown of OCaml 5 (relative to OCaml 4) for Coq/Rocq. (Gabriel Scherer, review by Damien Doligez and Guillaume Munch-Maccagnoni, report by Emilio Jesús Gallego Arias and Olivier Nicole)

  • #14057: Don't update memprof too early at the end of a minor GC. (Nick Barnes, review by Damien Doligez).

Code generation and optimizations:

  • #13262, #14074: fix performance issue on Apple Silicon macOS by emitting stlr instead of dmb ishld; str. (KC Sivaramakrishnan, report by François Pottier, analysis by Frédéric Bour, Xavier Leroy, Miod Vallat, Gabriel Scherer and Stephen Dolan, review by Miod Vallat, Vincent Laviron and Xavier Leroy)
  • (breaking change) #13050, #14104, #14143: Use '$' instead of '.' to separate module names in symbol names on macOS and Windows (including the Cygwin backend). This changes mangling of OCaml identifiers on those operating systems from camlModule.name_NNN to camlModule$name_NNN. Additionally it changes the encoding of special characters from $xx (two hex digits) to $$xx (two dollar signs followed by two hex digits). (Tim McGilchrist, with contributions from Xavier Leroy, reviewed by Xavier Leroy, Miod Vallat, Gabriel Scherer, Nick Barnes and Hugo Heuzard)
  • #13807: Allow unaligned memory accesses on ARM64. (Matthew Else, review by Xavier Leroy)

  • #13565: less tagging in switches compiled to affine transformations by ocamlopt. (Gabriel Scherer and Clément Allain, review by Vincent Laviron, report by Vesa Karvonen)

  • #13672 Avoid register stall on conversion instructions on amd64. (Pierre Chambart, review by Gabriel Scherer and Xavier Leroy, report by Patrick Nicodemus)

  • #13667: (originally #11162) Fix instr_size computation on arm64. (Stephen Dolan and Tim McGilchrist, review by Xavier Leroy and David Allsopp)

  • #13758: Propagate more value kinds in Flambda to allow more unboxing (Vincent Laviron, review by Pierre Chambart)

  • #13759: Propagate more type information from clambda to cmm. (Pierre Chambart, review by Gabriel Scherer)

  • #13735: Follow the behaviour of the C compiler to decide whether to emit the .size and .type directives and the .note.GNU-stack section (Samuel Hym, review by Miod Vallat, Antonin Décimo and Gabriel Scherer)

Other libraries:

  • (breaking change) #13435: On Windows, use system calls for Filename.get_temp_dir_name instead of directly reading the environment, which in particular improves the security of OCaml processes running in the SYSTEM security context by mitigating privileged file operation attacks. For all other processes running with the default environment (where TEMP is set), there is no discernible change. (Antonin Décimo, review by Nicolás Ojeda Bär and David Allsopp)
  • #13504, #13625, #14223: Add Thread.set_current_thread_name. (Romain Beauxis, review by Gabriel Scherer and Antonin Décimo)
  • (breaking change) #13376: Allow Dynlink.loadfile_private to load bytecode libraries with internal dependencies (Vincent Laviron, report by Stéphane Glondu, review by Nicolás Ojeda Bär and Xavier Leroy)
  • #13429: add Unix.sigwait, a binding to the sigwait system call; implement Thread.wait_signal using Unix.sigwait, and Thread.sigmask using Unix.sigprocmask. (Xavier Leroy, review by Antonin Décimo, Gabriel Scherer, Miod Vallat)

  • #13442, #13452: Fix Unix.getgroups for users belonging to more than 32 groups when using musl (Kate Deplaix, review by Gabriel Scherer, Antonin Décimo, Anil Madhavapeddy)

  • #13576: Introduce internal helpers to convert between time representations. On Windows, prevent erroneously waiting for an unbounded time in Unix.select if more than 64 file descriptors per lists are watched, or if watching non-socket file descriptors, and a timeout longer than $2^{32}$ milliseconds is used. Cap the timeout to $2^{32}$ milliseconds. (Antonin Décimo, review by Gabriel Scherer and Miod Vallat)

  • #13921: Set cloexec correctly on CRT file descriptors created by the Unix library on Windows. The inheritance on the underlying Win32 handles was correctly set, but the book-keeping for the CRT was leaking the value of non-inherited handles which combined with re-use of HANDLE values within processes could appear to make a CRT file descriptor "re-open". (David Allsopp, review by Nicolás Ojeda Bär)

Tools:

  • #13686: Fix Python debugger extensions (for LLDB and GDB) to restore functionality broken by #13272 in 5.3. (Nick Barnes, review by Tim McGilchrist Gabriel Scherer)

  • #12019: ocamlc: add align_double and align_int64 to ocamlc -config output. (Romain Beauxis, review by David Allsopp)

  • #12642, #13536, #14184, #14192: in the toplevel, print shorter paths for constructors and labels when only some modules along their path are open. (Gabriel Scherer, review by Florian Angeletti)

  • #13199, #13485, #13665, #13762, #13965: Support running native debuggers in ocamltest. (Tim McGilchrist, Sebastien Hinderer, David Allsopp, Antonin Décimo, review by Sebastien Hinderer, Gabriel Scherer, Antonin Décimo, and Tim McGilchrist)

  • #13764, #13779: add missing "-keywords" flag to ocamldep and ocamlprof (Florian Angeletti, report by Prashanth Mundkur, review by Gabriel Scherer)

  • #13877: ocamldoc, add a -latex-escape-underscore flag to control the escaping of _ underscore in latex references (in order to be able to match odoc behaviour). (Florian Angeletti, review by Gabriel Scherer)

  • #13906: Add support for a multicore tag in ocamltest and use it for tests that fail on mono-core systems. (Stéphane Glondu, review by Nicolás Ojeda Bär)

Manual and documentation:

  • #13751: Document support for profiling with Linux perf and frame pointers. (Tim McGilchrist, review by Gabriel Scherer and Miod Vallat)

  • #12452: Add examples to Stdlib.Fun documentation. (Hazem ElMasry, review by Florian Angeletti and Gabriel Scherer)

  • #13924: Document how to put [@deprecated] on let bindings, constructors, etc in the manual (Valentin Gatien-Baron, review by Florian Angeletti)

  • #13694: Fix name for caml_hash_variant in the C interface. (Michael Hendricks)

  • #13732: Document that custom finalizers must not access the OCaml heap, etc. (Josh Berdine, review by Stephen Dolan and Guillaume Munch-Maccagnoni)

Type system

  • (breaking change) #13830: fail rather than silently create abstract module types when avoiding (i.e. hiding) signature items, as in:
      module N = struct
        open (struct type t = A | B end)
        module type T = sig type u = t * int end
      end
    
    Before, it was succeeding with module N : sig module type T end, now it fails. Similarly for anonymous functor calls (of the form `F(struct ... end)) (Clement Blaudeau, review by Gabriel Scherer)

Compiler user-interface and warnings:

  • #13817: align spellchecking hints with the possibly misspelled identifier/ Error: Unbound type constructor "aray" Hint: Did you mean "array"? (Florian Angeletti, suggestion by Daniel Bünzli, review by Gabriel Scherer)

  • #13587: Enable native backend on x86_64 GNU/Hurd. (Samuel Thibault, review by Antonin Décimo, Sébastien Hinderer and Miod Vallat)

  • #13663: Improve the error message when GADT parameter variance cannot be checked. (Stefan Muenzel, review by Gabriel Scherer and Florian Angeletti)

  • #13646: Improve the error messages when a recursive module type references another recursive module type. (Stefan Muenzel, review by Florian Angeletti and Gabriel Scherer)

  • #13702, #13865: Specialized error messages for functors appearing in contexts where non-functors were expected module A: sig ... end = Set.Make (and the reverse) (Florian Angeletti, report by Jeremy Yallop, review by Gabriel Scherer)

  • #13788, #13813: Keep the module context in spellchecking hints. Fun.protact now prompts Did you mean "Fun.protect?" rather than Did you mean "protect?". (Florian Angeletti, suggestion by Daniel Bünzli, review by Gabriel Scherer)

  • #13428: support dump=[source | parsetree | lambda | ... | cmm | ...] in OCAMLRUNPARAM (Gabriel Scherer, review by Vincent Laviron)

  • #13493: Clearer error message in ocamlc for conflicting link options for C stubs when shared libraries are not available. (David Allsopp, review by Gabriel Scherer)

  • #13563, lighter inline code styling for output without bold support: inline code is no longer printed as "..." to avoid confusion with OCaml strings. (Florian Angeletti, review by Richard Eisenberg)

  • #13568, composable formatting for warning and alert messages (Florian Angeletti, review by Richard Eisenberg)

  • #13601: Enable natdynlink on x86_64 GNU/Hurd (Samuel Thibault, review by Sébastien Hinderer)

  • #13809: Distinguish (module M : S) and (module M) : (module S) and change locations of error messages when S is ill-typed in (module S) (Samuel Vivien, review by Florian Angeletti and Gabriel Scherer)

  • #13814, 13898: Add an unused-type-declaration warning when using a t as 'a with no other occurences of 'a (Samuel Vivien, review by Florian Angeletti, Kate Deplaix)

  • #13818: better delimited hints in error message (Florian Angeletti, review by Gabriel Scherer)

Internal/compiler-libs changes:

  • #13539, #13776: Use nanosleep instead of usleep or select, if available. (Antonin Décimo, review by Miod Vallat and Gabriel Scherer)

  • #13748: Add a .editorconfig file for basic editor auto-configuration. (Antonin Décimo, review by Gabriel Scherer and David Allsopp)

  • #13302, #14236: Store locations of longidents components (Ulysse Gérard and Jules Aguillon, review by Jules Aguillon and Florian Angeletti)

  • #13314: Comment the code of Translclass (Vincent Laviron and Nathanaëlle Courant, review by Olivier Nicole)

  • #13362: reimplement Floatarray.concat in C (caml_floatarray_concat), matching the implementation of Array.concat. (Gabriel Scherer, review by Nicolás Ojeda Bär)

  • #13624: Added location to exception definitions and type extensions (Samuel Vivien, review by Gabriel Scherer)

  • #13425: undocumented -dmatchcomp flag for the debug output of the pattern-matching compiler (Gabriel Scherer, review by Vincent Laviron and Nicolás Ojeda Bär)

  • #13460: introduce a variant of all predefined types (Gabriel Scherer, review by Ulysse Gérard and Florian Angeletti)

  • #13457, #13537: Annotate alloc/free open/close pairs of functions with compiler attributes for static analysis. (Antonin Décimo, review by Gabriel Scherer and Florian Angeletti)

  • #13464: Use generic types in call to subtype. This improves inference of type-directed disambiguation in principal mode. (Richard Eisenberg, review by Jacques Garrigue)

  • #13606: Fix Numbers.Int_base.compare (Mark Shinwell, review by Vincent Laviron)

  • #13612: Refactor type_application (Ulysse Gérard, Leo White, review by Antonin Décimo, Gabriel Scherer, Samuel Vivien, Florian Angeletti and Jacques Garrigue)

  • #13744: Refactor in collect_apply_args (Samuel Vivien, review by Florian Angeletti and Gabriel Scherer)

  • #13787: a new -dcanonical-ids option to show canonicalized identifier stamps in -d{lambda,cmm,...} outputs. (Gabriel Scherer, review by Vincent Laviron and David Allsopp, suggested by David Allsopp)

  • #13820: Add a new option -i-variance to print the variance of every type parameter; bivariance is printed as +-, and for consistency, parser is modified too to accept +- and -+ as type_variance. (Takafumi Saikawa and Jacques Garrigue, review by Florian Angeletti)

  • #13828: Apply BUILD_PATH_PREFIX_MAP to Sys.argv.(0) before storing it in .cmt and .cmti files. (David Allsopp, review by Daniel Bünzli and Gabriel Scherer)

  • #13848: Add all paths components to the cmt files indexes (Ulysse Gérard, review by Florian Angeletti)

  • #13854: Make the parser set loc_ghost more correctly, for keyword%extension syntax (Valentin Gatien-Baron, review by Florian Angeletti)

  • #13856: Add a new indirection in types AST called package that stores the content of a Tpackage node (Samuel Vivien, review by Florian Angeletti)

  • #13866: Modified occurence check that prevents recursive types for it to see the checked type as a graph rather than a tree (Samuel Vivien, report by Didier Remy, review by Florian Angeletti and Jacques Garrigue)

  • #13884 Correctly index modules in constructors and labels paths (Ulysse Gérard, review by Florian Angeletti)

  • #13946: refactor the #install_printer code in the debugger and toplevel (Pierre Boutillier, review by Gabriel Scherer and Florian Angeletti)

  • #13952: check and document the correctness of caml_domain_alone (). (Gabriel Scherer, review by KC Sivaramakrishnan, report by Olivier Nicole)

  • #13971: Keep generalized structure from patterns when typing let (Leo White, review by Samuel Vivien and Florian Angeletti)

  • (breaking change) #13972: Renamed the -no-alias-deps flag internal representation to no_alias_deps instead of transparent_modules. (Clement Blaudeau, review by Gabriel Scherer)

Build system:

  • (breaking change) #13526, #13789, #13804: Simplify the build of cross compilers This replaces the configure --with-target-bindir option by an equivalent TARGET_BINDIR variable (Samuel Hym, review by Miod Vallat, Xavier Leroy, Antonin Décimo and Sébastien Hinderer)
  • #13431: Simplify github action responsible for flagging PRs with the parsetree-changes label and extend it to mention the @ppxlib-dev team. (Nathan Rebours, review by Florian Angeletti)

  • #13494: Use native symlinks on Windows for the OCaml installation, reducing disk usage considerably. (David Allsopp, review by Nicolás Ojeda Bär and Gabriel Scherer)

  • #13789: Strictly validate the host and target triplets when building for the Windows ports to be --cygwin, -w64-mingw32 or *-pc-windows. Other Cygwin variants used to be rejected - other MSVC and mingw-w64 variants are now rejected too. (David Allsopp, review by Antonin Décimo and Gabriel Scherer)

Bug fixes:

  • #13819: Fix field initialisation bug in runtime events subsystem. (Nick Barnes, review by Gabriel Scherer).

  • #13977: Pass -fPIC when compiling C files using ocamlopt. This was a regression in OCaml 5.3. (Nicolás Ojeda Bär, review by Daniel Bünzli and Gabriel Scherer)

  • #13957: Allow 'effect' as attribute id. (Pieter Goetschalckx, review by Nicolás Ojeda Bär and Florian Angeletti)

  • #13691 #13895: Make four globals underlying Gc.control atomic to avoid C data races against them. (Jan Midtgaard, review by Miod Vallat, Sadiq Jaffer and Antonin Décimo)

  • #13454: Output a correct trace of the C_CALLN bytecode. (Miod Vallat, review by Antonin Décimo)

  • #13595: Use x19 as Canonical Frame Address (CFA) register. This would cause backtraces to be truncated when calling no alloc C code. (Tim McGilchrist, report by Nick Barnes, review by Nick Barnes)

  • (breaking change) #13605: Fix ungenerated constraints when they where impossible due to polyvars issues (Samuel Vivien, review by Florian Angeletti, Richard Eisenberg and Jacques Garrigue)
  • #13677, #13679: domain.c: remove backup_thread_running to simplify concurrent state updates to the backup thread status. (Gabriel Scherer, review by Jan Midtgaard and Miod Vallat, report by Jan Midtgaard)

  • #13896, #14098: ocamldoc, do not wrap module description in a paragraph tag inside the table of modules (Florian Angeletti, report by John Whitington, review by Gabriel Scherer)

  • #13703: wrong explanation for some polymorphic-variant subtyping errors (Gabriel Scherer, review by Jacques Garrigue, report by Wiktor Kuchta and Richard Eisenberg)

  • #13710: Support unicode identifiers in comments. (Pieter Goetschalckx, review by Florian Angeletti and Gabriel Scherer)

  • #13763: Track type of variables bound by as-patterns (Leo White, review by Gabriel Scherer, port by Vincent Laviron)

  • #13778, #13811: do not warn for unused type declarations when the type is used in a first-class module type (module S with type t = int). (Florian Angeletti, report by Nicolás Ojeda Bär, review by Gabriel Scherer)

  • #13790: Fix bytecode-only build of Cygwin when flexlink is being bootstrapped with the compiler. (David Allsopp, review by Antonin Décimo and Miod Vallat)

  • #13812: Add forgotten check about the validity of the type variable name on the right-hand side of _ as _. (Samuel Vivien, review by Gabriel Scherer)

  • #13845: Fix bug in untypeast/pprintast for value bindings with polymorphic type annotations. (Chris Casinghino, review by Florian Angeletti and Gabriel Scherer)

  • #13930, #13933: Fix bugs in recursive values definitions involving lazy values that have already been evaluated. (Gabriel Scherer, review by Vincent Laviron, report by Vincent Laviron)

  • #13867: Fix bug with some recursive bindings of lazy values. (Guillaume Bury and Vincent Laviron, review by Stefan Muenzel and Gabriel Scherer)

  • #13931: fix bugs in nested recursive value definitions. (Gabriel Scherer, review by Vincent Laviron, report by Vincent Laviron)

  • #13875, #13878: Add dedicated constructor for mutable variable access in Cmm to prevent bugs linked to incorrect handling of coeffects. (Vincent Laviron, review by Gabriel Scherer)

  • #13880: Make object stat counters atomic (Dimitris Mostrous, review by Gabriel Scherer and Nicolás Ojeda Bär)

  • #13172, #13829: Fix a missing check of illegal recursive module-type definitions (Clement Blaudeau, review by Florian Angeletti)

  • #13541, #13777: Using C++11 thread_local causes name-mangling issues when linking with flexlink on Cygwin. (Antonin Décimo and David Allsopp, report by Kate Deplaix)

  • (breaking change) #13874, #13882: Make evaluation order consistent for applications when using the non-flambda native compiler (Vincent Laviron, report by Jean-Marie Madiot, review by Gabriel Scherer)
  • #13942: Fix assertion on empty array case (Olivier Nicole, review by Gabriel Scherer)

  • #13950: Avoid tearing in Array.sub (Gabriel Scherer and Olivier Nicole, report by Jan Midtgaard, review by Gabriel Scherer)

  • #13928, #13944: Fix handling of excessively nested unboxed types (Vincent Laviron, review by Gabriel Scherer)

  • #13987: Remove a spurious TSan report in case of benign data race between major GC read and write from the mutator (fixes #13427) (Olivier Nicole, report by Thomas Leonard, review by Gabriel Scherer)

  • #14007, #14015: Fix memory corruption when an exception is raised during demarshaling. (Benoît Vaugon, review by David Allsopp and Gabriel Scherer)

  • #14025: fix data race between compaction and domain termination (Gabriel Scherer, review by Jan Midtgaard, report by Jan Midtgaard)

  • #13956 Fix a regression introduced in #13308 triggering wrong unused warnings. (Ulysse Gérard, review by Florian Angeletti)

  • #14070: also point to label mismatches in error messages for labelled tuples (Florian Angeletti, review by Gabriel Scherer)

  • #14088, #14091: fix non-deterministic code generation in matching.ml (backport of rescript-lang/rescript#7557) (Christiano Calgano, review by Gabriel Scherer and Vincent Laviron)

  • #14105: Fix a loop in Pprintast that could result in a hang when printing constructor (::) in isolation. (Ulysse Gérard, review by Nicolás Ojeda Bär and Florian Angeletti)

  • #14108: toplevel, fix a typo in directive type mismatch (Florian Angeletti, review by Gabriel Scherer)

  • #13586, #14093: Fix closing an out_channel during flush (Stephen Dolan, report by Jan Midtgaard, investigation by Nick Roberts, review by Antonin Décimo and Miod Vallat)

  • #14101, #14139: define atomic helper types inside caml/misc.h to improve header compatibility with C++ (Florian Angeletti, report by Kate Deplaix, review by Gabriel Scherer)

  • #14135: Fix a rare internal typechecker error when combining recursive modules, polymorphic fields or methods, and constrained type parameters. (Florian Angeletti, review by Gabriel Scherer)

  • #14169: runtime, fix cache miss within the stack fragments cache (Florian Angeletti, review by Gabriel Scherer)

  • #14196, #14197: ocamlprof: do not instrument unreachable clauses (Gabriel Scherer, review by Nicolás Ojeda Bär, report by Ali Caglayan)

  • #14200, #14202 : bad variance check with private aliases (Jacques Garrigue, report and review by Stephen Dolan)

  • #14061, #14209: fix a memory-ordering bug in Weak.set that could result in uninitialized memory seen by Weak.get on another domain. (Damien Doligez, review by Gabriel Scherer)

  • #14214, #14221: fix a confused error message for module inclusions, functor error messages were missing some type equalities potentially leading to nonsensical "type t is not compatible with type t" submessage (Florian Angeletti, report by Basile Clément, review by Gabriel Scherer)

  • #14238: Fix certain variadic macros in misc.h which could trigger C warnings under certain conditions in prerelease versions of OCaml 5.4. (Antonin Décimo, review by Nicolás Ojeda Bär)

2.5.1

We're happy to announce the release of mdx 2.5.1, which brings support for OCaml 5.4, as well as improvements to the handling of skipped blocks in .mli/.mld files.

See full changelog

Added

Changed

  • Improved implementation of handling of skipped blocks in mli/mld
    files (#466, @jonludlam)

You can comment on this announcement on the OCaml Discuss forums!

We're pleased to announce that OCaml.org now has dedicated RSS feeds and pages for stable and experimental announcements, introduced in PR #3278!

What's new:

  • OCaml Changelog at ocaml.org/changelog — Official stable release announcements and updates from the OCaml compiler, OCaml infrastructure, and the OCaml Platform Tools
  • Backstage OCaml at ocaml.org/backstage — Updates on experimental releases, work-in-progress, and opportunities to contribute to the development of the OCaml Platform and its infrastructure

This separation helps keep the main changelog focused on production-ready releases while providing a dedicated space for those interested in experimental work, early testing, and contributing to OCaml's development.

Both pages have their own RSS feeds, so you can subscribe to whichever matches your needs—or both!

We welcome your feedback as we continue improving OCaml.org.

Feedback on this post is welcomed on Discuss!

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

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

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

Other minor changes include:

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

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

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

Key Changes

New locate-types command

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

OCaml 5.4 support

This release supports OCaml 5.4.

Improved error recovery

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

OpenBSD support

Fixed merlin_reader to work correctly on OpenBSD.

Vim plugin fix

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

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

See full changelog

CHANGES:

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

There is now a dedicated Security Response Team (SRT) to handle vulnerability reports and coordinate security responses. If you discover a security issue in the OCaml compiler, runtime, standard library, or ecosystem tools, you can report it confidentially to the team.

The SRT follows responsible disclosure practices, working with reporters to validate issues, develop fixes, and coordinate public disclosure timelines. This effort also helps OCaml developers and companies comply with emerging security regulations like the EU Cyber Resilience Act.

For more information, see the announcement on Discuss.

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

This maintenance release fixes three key issues:

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

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

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

See full changelog

Fixes

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

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

What's Fixed

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

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

Both fixes improve compatibility across OCaml compiler versions.

See full changelog

CHANGES:

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

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

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

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

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

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

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

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

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

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

Happy indenting!

See full changelog

CHANGES:

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

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

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

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

Dune 3.20.2

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

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

See full changelog

Fixed

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

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

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

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

TL;DR

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

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

What is ocaml-eglot?

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

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

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

Who Should Use ocaml-eglot?

Use ocaml-eglot if you:

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

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

Getting Started

Follow the installation instructions in the ocaml-eglot README.

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

Features

Error Navigation: Quick jump to next/previous errors

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

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

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

Search: Find definitions, declarations, and references

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

Next Steps

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

Documentation

Related Releases

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

Dune 3.20.1

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

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

See full changelog

Fixed

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

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

Changed

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

Dune 3.20.0

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

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

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

See full changelog

Fixed

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

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

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

Added

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

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

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

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

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

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

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

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

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

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

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

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

Changed

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

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

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

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

Utop 2.16.0

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

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

See full changelog

opam 2.4.1

Feedback on this post is welcomed on Discuss!

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

Changes

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

This release also extends the tests.

Try it!

The upgrade instructions are unchanged:

  1. Either from binaries: run

For Unix systems

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

or from PowerShell for Windows systems

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

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

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

You should then run:

opam init --reinit -ni

Please report any issues to the bug-tracker.

Happy hacking!

opam 2.4.0

Feedback on this post is welcomed on Discuss!

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

Try it!

The upgrade instructions are unchanged:

  1. Either from binaries: run

For Unix systems

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

or from PowerShell for Windows systems

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

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

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

You should then run:

opam init --reinit -ni

Major changes

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

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

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

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

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

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

UI changes

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

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

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

New commands / options

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

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

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

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

Other noteworthy changes

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

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

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

  • Fix sandboxing support in NixOS (#6333)

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

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

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

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

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

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

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

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

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

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

Please report any issues to the bug-tracker.

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


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

Odoc 3.1.0

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

What's New

OCaml 5.4.0 Compatibility

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

New Output Formats and Options

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

Key Improvements

Modernized Dependencies

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

Updated System Requirements

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

Better Configuration Management

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

Improved LaTeX Output

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

Bug Fixes

This release addresses several important issues:

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

Getting Started

To install odoc 3.1.0:

opam install odoc

For existing users, upgrade with:

opam upgrade odoc

Contributors

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

What's Next

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

Happy documenting!

See full changelog

### Added

Changed

Fixed

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

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

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

See full changelog

Features

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

Fixes

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

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

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

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

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

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

See full changelog

Features

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

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

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

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

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

Fixes

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

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

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

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

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

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

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

Dune 3.19.1

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

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

See full changelog

Fixed

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

Dune 3.19.0

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

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

See full changelog

Fixed

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

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

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

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

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

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

Added

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

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

Changed

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

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

Dune 3.18.2

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

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

See full changelog

Fixed

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

Dune 3.18.1

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

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

See full changelog

Fixed

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

Dune 3.18.0

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

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

See full changelog

Fixed

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

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

Added

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

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

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

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

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

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

Changed

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

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

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

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

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

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

Odoc 3.0.0

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

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

Here is an overview of some major new features:

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

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

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

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

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

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

See full changelog

Added

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

Changed

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

Fixed

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Dune-release 2.1.0 has been released!

With this update,

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

Added

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

Changed

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

Fixed

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

Removed

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

Dune 3.17.2

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

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

See full changelog

Fixed

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

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

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

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

See full changelog

Features

  • Enable experimental project-wide renaming of identifiers (#1431)
If you want to contribute to a new release announcement, check out the Contributing Guide on GitHub.