This release of UTop 2.14.0 brings support for the upcoming version of the compiler, OCaml 5.2.
See full changelog
- Add support for OCaml 5.2 (#470, fixes #466, @leostera, @ManasJayanth, @huwaireb)
Official stable release announcements and updates from the OCaml compiler, OCaml infrastructure and the OCaml Platform Tools.
This release of UTop 2.14.0 brings support for the upcoming version of the compiler, OCaml 5.2.
We're thrilled to announce the release of Merlin 4.14, a significant update that introduces a suite of enhancements and fixes to improve your OCaml editor experience.
In addition to the improvements and bug fixes in this release, Merlin 4.14 is the first version to support the upcoming OCaml 5.2 compiler.
Some highlights in this release include:
Happy coding!
FLG -pp ppx.exe -as-pp/-dump-ast use of invalid shell redirection when
direct process launch on Windows. (#1723, fixes #1722)ocamlmerlin responses to detect server crashes (#1716)module-type (#1728, partially fixes #1656)We're happy to announce that Dune 3.14.0 is now available. This feature has many fixes and new features that you can find in the changelog.
There are a few new features that we would like to specially highlight.
(dynamic_include)It is common for some parts of a build to be dynamic: for example a source file can be generated, or some parts of the configuration like C flags can be generated from a Dune rule. But until now it was not possible to generate rules dynamically.
For example, one might want to do it is to set up one rule per input file. This is a common pattern in test suites and is easy to do with Make. But Dune does not have a concept of parameterized rules, so it is necessary to set up one rule per input file.
The pattern to do this with Dune is to:
dune.inc file using this generator;(include dune.inc) in the main dune file,However, this requires checking in the generated dune.inc file in the
repository. Another drawback is that when modifying the list of input files, it
is necessary to run tests twice: one to update dune.inc, one to run the new
test.
This release of Dune adds a new (dynamic_include) stanza that lifts these
restrictions: dune.inc does not have to be part of the source tree, it can be
generated transparently. This comes with some restrictions: some stanzas can
not be generated, in particular the ones that define public libraries. And due
to how rule loading works, the generated stanza needs to be defined in a
different directory.
Still, this should be useful for many users that rely on the generate-include-commit pattern described above.
Sherlodoc is a search engine for OCaml documentation, which supports search by
name, documentation and fuzzy type search (similar to Hoogle in the Haskell
world). It can be obtained from opam using opam install sherlodoc.
When it is available, Dune commands that produce HTML documentation, such as
dune build @doc and dune build @doc-new, will include a search bar in the
generated output.
Introduce a (dynamic_include ..) stanza. This is like (include foo) but
allows foo to be the target of a rule. Currently, there are some
limitations on the stanzas that can be generated. For example, public
executables, libraries are currently forbidden. (#9913, @rgrinberg)
Introduce $ dune promotion list to print the list of available promotions.
(#9705, @moyodiallo)
If Sherlodoc is installed, add a search bar in generated HTML docs (#9772, @EmileTrotignon)
Add only_sources field to copy_files stanza (#9827, fixes #9709,
@jchavarri)
The (foreign_library) stanza now supports the (enabled_if) field. (#9914,
@nojb)
Fix $ dune install -p incorrectly recognizing packages that are supposed to
be filtered (#9879, fixes #4814, @rgrinberg)
subst: correctly handle opam files in opam/ subdirectory (#9895, fixes #9862, @emillon)
Odoc private rules are not set up if a library is not available due to
enabled_if (#9897, @rgrinberg and @jchavarri)
When dune language 3.14 is enabled, resolve the binary in (run %{bin:..} ..) from where the binary is built. (#9708, @rgrinberg)
boot: remove single-command bootstrap. This was an alternative bootstrap strategy that was used in certain conditions. Removal makes the bootstrap a bit slower on Linux when only a single core is available, but bootstrap is now reproducible in all cases. (#9735, fixes #9507, @emillon)
The ppxlib dev team is happy to announce the release of ppxlib.0.32.0.
The main feature of this release, implemented by @burnleydev1 during their Outreachy internship, is a huge improvement of the handling of located exceptions raised by ppx-es. Whenever a rewrite of the AST throws such an exception, the ppxlib driver catches it and resumes the rewriting using the latest valid AST it knows of. All caught exceptions are appended to the final AST as [%%ocaml.error ..] nodes. This means the driver returns a valid AST instead of one composed of a single error node corresponding to the first raised exception.
This leads to a much better experience for ppx users as merlin now has a valid AST to work with when this happens, allowing it to properly function, reporting all errors, from ppx-es or otherwise.
Note that despite this change we still recommend ppx authors to embed errors in the rewritten AST rather than throw exceptions.
The release also comes with a few bug fixes on longident parsing or windows compatibility and a new simplified API for ppx authors using attributes as flags (i.e. attributes without payloads such as [@ignore] for instance).
We'd like to thank our external contributors for this release:
We'd also like to thank the OCaml Software Foundation who has been funding my work on this release.
Add an optional embed_errors argument to Context_free.map_top_down that
controls how to deal with exceptions thrown by context-free rules.
(#468, @NathanReb)
Fix Longident.parse so it properly handles unparenthesized dotted operators
such as +. or *.. (#111, @rgrinberg, @NathanReb)
raising an exception does no longer cancel the whole context free phase(#453, @burnleydev1)
Sort embedded errors that are appended to the AST by location so the compiler reports the one closer to the beginning of the file first. (#463, @NathanReb)
Update Attribute.get to ignore loc_ghost. (#460, @ceastlund)
Add API to manipulate attributes that are used as flags (#408, @dianaoigo)
Update changelog to use ISO 8061 date format: YYYY-MM-DD. (#445, @ceastlund)
Replace Caml with Stdlib. (#427, @ceastlund)
When a transformation raises, the last valid AST is used as input to the upcoming transformations. All such errors are collected and appended as extension nodes to the final AST (#447, @burnleydev1)
Fix a small mistake in the man pages: Embededding errors is done by default with
-as-pp, not with -dump-ast (#464, @pitag-ha)
Set appropriate binary mode when writing to stdout especially for Windows
compatibility. (#466, @jonahbeckford)
We just released version 3.13.1 with some bugfixes.
Fix performance regression for incremental builds (#9769, fixes #9738, @rgrinberg)
Fix dune ocaml top-module to correctly handle absolute paths. (#8249, fixes
#7370, @Alizter)
subst: ignore broken symlinks when looking at source files (#9810, fixes #9593, @emillon)
subst: do not fail on 32-bit systems when large files are encountered. Just log a warning in this case. (#9811, fixes #9538, @emillon)
boot: sort directory entries in readdir. This makes the dune binary reproducible in terms of filesystem order. (#9861, fixes #9794, @emillon)
The release of odoc 2.4.0 last month introduced a regression that caused Dune rules to fail in some cases. This release of odoc 2.4.1 fixes this issue.
We're happy to announce that Dune 3.13.0 is now available. This feature is packed with fixes and new features that you can find in the changelog.
There are a few new features that we would like to specially highlight.
When menhir is used to generate code from .mly files, there are sometimes
issues with the grammar itself, such as shift-reduce conflicts.
Menhir has an option to generate a "conflicts" file using its --explain flag,
but until now this was not exposed by Dune. Starting from this version, this
file will be generated automatically to help developers debug their grammars.
Dune's global cache is a way to save the result of intermediate build results, even across projects. Previously, it would only work with file targets. With this change, it now supports Dune's experimental directory targets.
In several places in the Dune language, it is possible to pass a list of
modules. For example in a (library) stanza, if for some reason the default of
picking all the source files in the current directory is not the right thing to
do, it is possible to pass (module A B C) to only attach these modules to the
library.
An important limitation has been that the list of modules needed to be static:
written as is in the dune file. This limitation has now been lifted and it is
possible to use (:include) or %{read-lines:file} in this field and similar
ones.
LexiFi's use case is a system of static plug-ins: a program is extended by selecting which modules are linked to the application core. This list of modules can now be emitted by a generator that reads a configuration file.
Previously, this required using OCaml syntax for the dune file, which has
several issues, including incompatibility with features like
(include_subdirs) and poor performance because Dune does not know the
dependencies of the generator and needs to re-run the build more times than
necessary.
Add command dune cache clear to completely delete all traces of the Dune
cache. (#8975, @nojb)
Allow to disable Coq 0.8 deprecation warning (#9439, @ejgallego)
Allow OCAMLFIND_TOOLCHAIN to be set per context in the workspace file
through the env stanza. (#9449, @rgrinberg)
Menhir: generate .conflicts file by default. Add new field to the
(menhir) stanza to control the generation of this file: (explain <blang expression>). Introduce (menhir (flags ...) (explain ...)) field in the
(env) stanza, delete (menhir_flags) field. All changes are guarded under
a new version of the Menhir extension, 3.0. (#9512, @nojb)
Directory targets can now be cached. (#9535, @rleshchinskiy)
It is now possible to use special forms such as (:include) and variables
%{read-lines:} in (modules) and similar fields. Note that the
dependencies introduced in this way (i.e., the files being read) must live in a
different directory than the stanza making use of them. (#9578, @nojb)
Remove warning 30 from default set for projects where dune lang is at least
3.13 (#9568, @gasche)
Add coqdoc_flags field to coq field of env stanza, allowing the setting
of workspace-wide defaults for coqdoc_flags. (#9280, fixes #9139, @Alizter)
ctypes: fix an error where (ctypes) with no (function_description) would
cause an error trying refer to a nonexistent _stubs.a dependency (#9302,
fix #9300, @emillon)
(depends) and related fields in dune-project
are well-formed. (#9472, fixes #9270, @ElectreAAS)Do not ignore (formatting ..) settings in context or workspace files
(#8447, @rgrinberg)
Fixed a bug where Dune was incorrectly parsing the output of coqdep when it was escaped, as is the case on Windows. (#9231, fixes #9218, @Alizter)
Copying mode for sandboxes will now follow symbolic links (#9282, @rgrinberg)
Forbid the empty (binaries ..) field in the env stanza in the workspace
file unless language version is at least 3.2. (#9309, @rgrinberg)
[Coq] Fix bug in computation of flags when composed with boot theories. (#9347, fixes #7909, @ejgallego)
Fixed a bug where the (select) field of the (libraries) field of the
(test) stanza wasn't working properly. (#9387, fixes #9365, @Alizter)
Fix handling of the PATH argument to dune init proj NAME PATH. An
intermediate directory called NAME is no longer created if PATH is
supplied, so dune init proj my_project . will now initialize a project in
the current working directory. (#9447, fixes #9209, @shonfeder)
Experimental doc rules: Correctly handle the case when a package depends upon its own sublibraries (#9461, fixes #9456, @jonludlam)
Resolve various public binaries to their build location, rather than to where
they're copied in the _build/install directory (#9496, fixes #7908,
@rgrinberg).
Correctly ignore warning flags in vendored projects (#9515, @rgrinberg)
Use watch exclusions in watch mode on MacOS (#9643, fixes #9517, @PoorlyDefinedBehaviour)
Fix Merlin configuration for (include_subdirs qualified) modules (#9659,
fixes #8297, @rgrinberg)
Fix handling of enabled_if in binary install stanzas. Previously, we'd
ignore the result of enabled_if when evaluating %{bin:..} (#9707,
@rgrinberg)
We just released version 3.12.2 with 2 bugfixes.
Fix version check in runtest_alias for cram stanza (#9454, @emillon)
Fix stack overflow when a (run) action can not be parsed. (#9530, fixes
#9529, @gridbugs)
We are pleased to announce the release of OCaml LSP 1.17.0. This version comes packed with fixes and new features.
Notable features that come in this release include:
in keyword completing to other terms in the editor, we've added auto-completion for this keyword in OCaml LSP. Typing in will now only suggest auto completion for the in keyword.--fallback-read-dot-merlin flag is on. (#1173)in (#1217)The odoc team is delighted to announce the release of odoc 2.4.0. It mainly contains support for search engines. There are of course bugfixes and smaller new features.
Odoc now support searching in the documentation ! The search is made to run in the browser, so that you do not need a server to enable search: you can have search on your documentation hosted on github pages or even locally on your machine.
No search engine is shipped with, you need to provide one, but all the facilities to make use of one are present. We adapted @art-w 's sherlodoc for seamless integration with odoc, alongside with new features. It is not yet released on opam, but we hope it will be soon.
You can already test sherlodoc and play with it on your own projects, there are instructions in its readme. Sherlodoc has fuzzy typed-based search like hoogle in the haskell world, and is made to work best for OCaml (unlike a general purpose search engine like elastic search).
Check the results on odoc's own online documentation : ocaml.github.io/odoc.
While we are dedicated to developing the best tooling to generate and serve documentation on OCaml.org, creating a well-documented library ecosystem can only be a collective effort. Package authors: we’re working hard to give you great tools, but we’ll need all your help to create an ecosystem of well-documented libraries for OCaml!
If you find that writing documentation for your library isn’t as straightforward as you would like, please do share your feedback with us.
We're happy to announce the release of Merlin 4.13. This release comes with a number of bug fixes to the Merlin binary.
It also introduces a new -cache-lifespan flag that can be used to set cache invalidation periods. This flag allows for fine-tuning of cache invalidation periods, enabling users to customize Merlin's internal configurations for optimal performance in various project contexts.
Additionally, this release includes several improvements in editor modes. For more details, we encourage you to delve into the full changelog.
-cache-lifespan flag, that sets cache invalidation period. (#1698,
#1705)We're pleased to announce the release of Dune 3.12!
Note that due to a mistake during the release process, version 3.12.0 was not
published to opam and should not be used.
This version contains many fixes but we would like to highlight the following features:
dune ocaml doc is a new command that will build the docs of your package,
and open them in a web browser directly.dune build @doc-new. Note that this is still experimental.Introduce $ dune ocaml doc to open and browse documentation. (#7262, fixes
#6831, @EmileTrotignon)
dune cache trim now accepts binary byte units: KiB, MiB, etc. (#8618,
@Alizter)
Introduce the runtest_alias field to the cram stanza. This allows
removing default runtest alias from tests. (@rgrinberg, #8887)
Display cache location in Dune log (#8974, @nojb)
Dune can now be built and installed on Haiku (#8795, fix #8551, @Alizter)
Mark installed directories in dune-package files. This fixes (package)
dependencies against packages that contain such directories. (#8953, fixes
#8915, @emillon)
Introduce new experimental odoc rules (#8803, @jonjudlam)
dune-build-info: when version="" is found in a META file, we now return
None as a version string (#9177, @emillon)
No longer force colors for OCaml 4.03 and 4.04 (#8778, @rgrinberg)
Dependencies in the copying sandbox are now writeable (#8920, @rgrinberg)
Rules that only use internal dune actions (write-file, echo, etc.) can
now be sandboxed. (#9041, fixes #8854, @rgrinberg)
Add test_ prefix to default test name in dune init project (#9257,
fixes #9131, @9sako6)
Do not ignore libraries named bigarray when they are defined in conjunction
with OCaml 5.0 (#8902, fixes #8901, @rgrinberg)
Correctly ignore bigarray on recent versions of OCaml (#9076, @rgrinberg)
Absent packages shouldn't prevent all rules from being loaded (#8948, fixes #8630, @rgrinberg)
Correctly determine the stanza of menhir modules when (include_subdirs qualified) is enabled (@rgrinberg, #8949, fixes #7610)
Re-run actions whenever (expand_aliases_in_sandbox) changes (#8990,
@rgrinberg)
Do not re-run rules when their location changes (#9052, @rgrinberg)
[coq rules] Be more tolerant when coqc --print-version / --config don't work
properly, and fallback to a reasonable default. This fixes problems when
building Coq projects with (stdlib no) and likely other cases. (#8966, fix
#8958, @Alizter, reported by Lasse Blaauwbroek)
Dune will now run at a lower framerate of 15 fps rather than 60 when
INSIDE_EMACS. (#8812, @Alizter)
We’re pleased to announce the release of opam-publish 2.3.0.
This release, apart from a couple of light improvements, mainly consists of the following new option:
opam-publish with the --no-confirmation argument for use in automated pipeline. Use this option with extreme caution if you do use it.The full changelog is available below.
Enjoy, The opam team
--no-confirmation argument for use in automated pipeline [#158 @AltGr - fix #132]Following the release of odoc 2.3.0, we're releasing a patch release with odoc 2.3.1 that fixes support for OCaml 5.1.
After giving space for feedback and objections by the community,
we have deprecated ocaml-migrate-parsetree (aka OMP). It is superseded by Ppxlib.
There are four major differences between OMP and Ppxlib, which all go hand in hand.
The first major difference is in the library and therefore impacts how to write PPXs. With OMP, each PPX author had to choose a parsetree version to define their PPX against. There was no version agreement between different PPXs. With Ppxlib, each PPX author uses the same parsetree version.
The second major difference is about compatibility with new compiler syntax. While with OMP, each PPX was on its own parsetree version, Ppxlib keeps them all on the version of the latest stably released compiler. That makes using any PPX compatible with using the latest compiler syntax features!
The third major difference is in the philosophy of PPXs. With OMP, all PPX transformations were global transformations, i.e., transformations of the whole parsetree. Ppxlib has introduced the concept of "context-free" transformations, i.e., transformations that transform only one parsetree node. By restricting their scope of action, context-free PPXs are a lot more predictable and less dangerous! Also, Ppxlib merges all context-free PPXs into one parsetree pass, defining clear semantics of PPX composition.
The fourth major difference is in the driver, i.e., the binary that drives the application of all used PPXs in a project. The Ppxlib driver is significantly more performant than the OMP driver used to be. That's partly because it does a lot fewer parsetree migrations and partly thanks to merging all context-free PPXs into one parsetree pass.
As a consequence of the deprecation, OMP will be incompatible with any new compiler version. The first incompatible compiler version is OCaml 5.1.
Thanks a lot to everyone involved in OCaml's transition from OMP to Ppxlib, for example by porting their PPX!
Following the release of Dune 3.11.0 a few days ago, we've just released version 3.11.1 with a couple of bug fixes:
dune rpc status command that was incorrectly showing that there were
no RPC servers running on Windows.(inline_tests).Fix dune rpc commands on Windows (#8806, fixes #8799, @nojb)
Fix inline_tests when the partition list is empty (#8849, fixes #8848, @hhugo)
We're happy to announce the release of Ppxlib 0.31.0. Shortly after OCaml 5.1.0 has been released,
this Ppxlib release fixes a bug in the support of OCaml 5.1.0. Before that bug fix, the warnings about a generative/applicative mismatch between a functor creation and its application introduced by OCaml 5.1.0 were also triggered when that mismatch didn't exist.
Furthermore, the release contains a couple of bug fixes in the context of attributes.
We're also excited about two main enhancements. One allows authors of extension node rewriters to add a path argument to the extension node. That's excellent for hygiene since it allows the PPX to be explicit about modules rather than depending on its scope.
The other main enhancement allows an opt-in for compiler warnings about unused code generated by derivers (warnings w32 and w60). That opting in needs to happen on both sides of the deriver, the writer side and the user side. Opting in to those code warnings will help to clean up unused code, leading to performance improvements in compilation and editor support.
Fix support for OCaml 5.1: migrated code preserves generative functor warnings, without creating more. Locations are better preserved. (#432, @pitag-ha, @panglesd)
Driver: Add -unused-code-warnings command-line flag. (#444, @ceastlund)
Add ?warning flag to Deriving.Generator.make. (#440, @jacksonzou123 via @ceastlund)
Restore the path_arg functionality in the V3 API. (#431, @ELLIOTTCABLE)
Expose migration/copying/etc. functions for all AST types needed by Pprintast. (#454, @antalsz)
Preserve quoted attributes on antiquotes in metaquot. (#441, @ncik-roberts)
Attribute namespaces: Fix semantics of reserving multi-component namespaces. (#443, @ncik-roberts)
We're pleased to announce the release of Dune 3.11!
Here are some highlights from this release.
The biggest highlight in this release is the introduction of the new Terminal User Interface (TUI) display mode.
You can now run dune build --display tui to open a TUI. We recommend using it in conjunction with Dune watch
mode (dune build -w --display tui).
From the TUI, you will be able to navigate messages from Dune build, scroll through them, or click to minimize them. Press ? to show the help screen.
Another exciting feature in this release is the new (source_trees ..) field added to the (install ..) stanzas to add every files in a directory to the installation. For instance, to add your manual to the installation, you can use:
(install
(section doc)
(source_trees manual))
Let us know what you think about these features, and don't hesistate to open issues on Dune's bug tracker if you encounter any issue.
enabled_if now supports arch_sixtyfour variable (#8023, fixes #7997,
@Alizter)
Experimental: Added a $ dune monitor command that can connect to a running
dune build in watch mode and display the errors and progress. (#8152,
@Alizter)
The progress RPC procedure now has an extra field for the In_progress
constructor for the number of failed jobs. (#8212, @Alizter)
Add a --preview flag to dune fmt which causes it to print out the changes
it would make without applying them (#8289, @gridbugs)
Introduce (source_trees ..) to the install stanza to allow installing
entire source trees. (#8349, @rgrinberg)
Add --stop-on-first-error option to dune build which will terminate the
build when the first error is encountered. (#8400, @pmwhite and @Alizter)
Dune now displays the number of errors when waiting for changes in watch mode. (#8408, fixes #6889, @Alizter)
Add with_prefix keyword for changing the prefix of the destination of
installed files matched by globs. (#8416, @gridbugs)
Added experimental --display tui option for Dune that opens an interactive
Terminal User Interface (TUI) when Dune is running. Press '?' to open up a
help screen when running for more information. (#8429, @Alizter and
@rgrinberg)
Add a warnings field to dune-project files as a unified mechanism to
enable or disable dune warnings (@rgrinberg, 8448)
dune exec: support syntax like %{bin:program}. This can appear anywhere
in the command line, so things like dune exec time %{bin:program} now work.
(#6035, #8474, fixes #2691, @emillon, @Leonidas-from-XIV)
Add a new alias @doc-json to build odoc documentation in JSON format. This
output can be consumed by external tools. (#8178, @emillon)
Use posix_spawn instead of fork on MacOS. This gives us a performance
boost and allows us to re-enable thread. (#8090, @rgrinberg)
Modules that were declared in (modules_without_implementation),
(private_modules) or (virtual_modules) but not declared in (modules)
will raise an error. (#7674, @Alizter)
No longer emit linkopts(javascript) in META files (#8168, @hhugo)
RPC message styles are now serialised meaning that RPC diagnostics keep their ANSI styling. (#8516, fixes #6921, @Alizter)
Truncate output from actions that produce too much output (@tov, #8351)
Allow libraries to shadow OCaml built-in libraries. Previously, built-in libraries would always take precedence. (@rgrinberg, #8558)
dune utop no longer links utop in "custom" mode, which should make this
command considerably faster. (#8631, fixes #6894, @nojb)
Ensure that package names in dune-project are valid opam package names.
(#8331, @emillon)
init: check that module names are valid (#8644, fixes #8252, @emillon)
dune init: parse --public as a public name (#8603, fixes #7108, @emillon)
Stop signing source files with substitutions. Sign only binaries instead (#8361, fixes #8360, @anmonteiro)
Make copy sandbox support directory targets. (#8705, fixes #7724, @emillon)
Deprecate install destination paths beginning with ".." to prevent packages escaping their designated installation directories. (#8350, @gridbugs)
Remove warning against .dune files generated by pre Dune 2.0 (#8611,
@rgrinberg)
Remove versions 0.1 and 0.2 of the experimental ctypes extension. (#8293, @emillon)
We are thrilled to announce the release of odoc 2.3.0! 🎉 This release is the result of almost a year of diligent work from the odoc team since the last major release of odoc 2.2.0, it comes packed with significant new features and improvements!
Here are a couple of the new features introduced in Odoc 2.3.0 that we'd like to highlight.
Table support is the last addition to the odoc language, and comes with two syntax flavours: a light one, and a heavy one. The light markup is similar to markdown's markup for table, producing tables that are readable in the source file as well.
However, this markup has some limitation, since it only allows inline content in cells. It can also be difficult to read and mantain for big tables, without a proper editor support. For this reason, Odoc also provides a "heavy" markup, closer to the html one, with fewer limitations!
Here is a table in heavy, light, and rendered form:
{t
Table | support
------|--------
is | cool!
}
{table
{tr {th Table} {th support}}
{tr {td is} {td cool!}}
}
Table | support ------|-------- is | cool!
Source code rendering is an extremely exciting new feature. Not only odoc is now able to generate a rendering of the source files (and source hierarchy) of a project, but it is also able to create direct links from the documentation to the implementation!
This puts the documentation browsing to a new level, by helping to quickly answer any implementation-related question!
The source code rendering is also tailored to OCaml, for instance with links from variables to their definition, something missing from traditional html-based source viewing such as github!
Using this features in odoc’s driver will require some work, but you can already have a preview of the feature by going to the odoc API website, which was built with the feature enabled. For instance, the Odoc_html 19 module is now populated with many Source links, jumping right into the implementation file 5! Directory pages to browser the implementation are also included 8 :smiley:
Some background on our roadmap and what comes next.
The lack of access to comprehensive documentation for OCaml libraries is one of the biggest pain points reported by the OCaml community, as highlighted in the 2022 OCaml survey (c.f. Q50).
This motivated the odoc and OCaml.org teams to jointly work on a centralised package documentation, that went live in April 2022, as part of the new version of OCaml.org.
With documentation for OCaml libraries readily available on OCaml.org, we now turn our focus on making sure that library authors have the tooling they need to create high-quality documentation.
Our roadmap highlights some features we believe will make the generated documentation significantly better for readers, and documentation-writing much more pleasant and rewarding.
This release is a significant milestone in implementing the features on our roadmap and is the precursor to a series of upcoming releases. Odoc 2.4.0 will follow shortly and will bring support for search. Stay tuned and follow our progress through the OCaml Platform newsletter!
While we are dedicated to developing the best tooling to generate and serve documentation on OCaml.org, creating a well-documented library ecosystem can only be a collective effort. Package authors: we're working hard to give you great tools, but we'll need all your help to create an ecosystem of well-documented libraries for OCaml!
If you find that writing documentation for your library isn't as straightforward as you would like, please do share your feedback with us.
--hidden not always taken into account (@panglesd, #940)We are happy to announce the release of MDX 2.3.1! This is the first release of MDX to be compatible with OCaml 5.1.
We've also vendored the odoc-parser library, eliminating the need to have it
as a dependency. MDX can now be installed independently of the odoc version
you're using.
Add os_type label to enable/disable based on Sys.os_type (#433,
@polytypic)
Make MDX compatible with OCaml 5.1 (#435, @polytypic and @kit-ty-kate)
odoc-parser library, removing the need to have it
as a dependency. (#430, @jonludlam)Merlin 4.12 is a small patch release fixing regressions introduced in previous versions.
We are pleased to announce the release of Merlin 4.11 for OCaml 4.14.1, 5.0, and 5.1.
This release brings official support for OCaml 5.1 and introduces some changes to Emacs' default bindings proposed by the community:
tuareg-eval-region) and bind
C-c C-v instead to merlin-error-check;merlin-document and bind C-c M-d and
C-c | instead to merlin-destruct;merlin-type-expr.Thanks to everyone involved!
tuareg-eval-region) and bind C-c C-v instead to merlin-error-check;
rebind C-c C-d to merlin-document and bind C-c M-d and C-c | instead to merlin-destruct;
bind C-u C-c C-t to merlin-type-expr.defadvice macro (ocaml/merlin#1675)We are pleased to announce the release of OCamlFormat 0.26.1!
This is the first OCamlFormat release to be compatible with OCaml 5.1.
We highlight notable formatting improvements below:
type t =
| Foo
| (* Redirect (None, lib) looks up lib in the same database *)
- Redirect of
- db option * (Loc.t * Lib_name.t)
+ Redirect of db option * (Loc.t * Lib_name.t)
+
object keywordmodule type S = sig
- class tttttttttttt : aaaaaaaaaaaaaaaaaa:int -> bbbbbbbbbbbbbbbbbbbbb:float ->
+ class tttttttttttt :
+ aaaaaaaaaaaaaaaaaa:int ->
+ bbbbbbbbbbbbbbbbbbbbb:float ->
cccccccccccccccccccc
end
class type ct =
let open M in
- object
+object
val x : t
end
We've also fixed a few bugs. Attributes that were previously skipped are not preserved, and we fixed a crash that occured in the presence of nested modules.
Have a look at the full changelog to see the list of improvements, and don’t hesitate to share your feedback on this release on OCaml Discuss.
object keyword in class types (#2425, @Julow)with module (#2419, @Julow)We're thrilled to announce the release of Merlin 4.10, which comes with many bug fixes and improvements.
One of the standout features of this release is the significantly enhanced
support for binding operators like let+ and and+. You'll find that the
results from type-enclosing on expressions that contain let bindings are now
more precise.
construct command (#1618). Prefixes are still produced when
warning 42 (disambiguated name) is active.short-path from looping in some cases related to recursive type
definitions (#1645)type-enclosing on let/and operators (#1653)merlin-construct-with-local-values (#1644)As OCaml 5.1 is on the horizon, we're excited to announce the release of odoc 2.2.1. This latest version brings compatibility with the upcoming OCaml 5.1 release.
Additions
The fix to sendfile in 3.9.2 was not quite enough so here is the last part of
the fix. It brings compatibility with filesystems where sendfile is not
available, in particular when ecryptfs is used.
sendfile fallback (#8288, fixes #8284, @alan-j-hu)We're happy to announce the release of Dune 3.10.0. It comes with some internal fixes as well as some interesting features:
dune describe that will allow a better implementation of
opam-dune-lint to check the
consistency between library and package dependenciesdune show for a more consistent command
line interfaceAdd dune show rules as alias of the dune rules command. (#8000, @Alizter)
Add dune show installed-libraries as an alias of the dune installed-libraries command. (#8135, @Alizter)
Add dune build --dump-gc-stats FILE argument to dump garbage collection
stats to a named file. (#8072, @Alizter)
Add dune describe package-entries to print all package entries (#7480,
@moyodiallo)
Fix %{deps} to expand properly in (cat ...) when containing 2 or more
items. (#8196, @Alizter)
Fix the severity of error messages sent over RPC which was missing. (#8193,
@Alizter)
Fix bug with ppx and Reason syntax due to missing dependency in sandboxed action (#7932, fixes #7930, @Alizter)
Improve dune describe external-lib-deps by adding the internal dependencies
for more information. (#7478, @moyodiallo)
Re-enable background file digests on Windows. The files are now open in a way that prevents race condition around deletion. (#8262, fixes #8268, @emillon)
This bugfix-only release contains two platform-specific changes: one fixes the
Dune cache on Windows, and the other one completes the fix on Linux when
sendfile is not available. This makes Dune available where user directories
are encrypted using ecryptfs for example.
Disable background digests on Windows. This prevents an issue where unremovable files would make Dune crash when the shared cache is enabled. (#8243, fixes #8228, @emillon)
Fix permission errors when sendfile is not available (#8234, fixes #8210,
@emillon)
We are thrilled to announce the release of OCamlFormat 0.26.0!
After almost 5 months of intense development, this release comes with a ton of consistency improvements and bug fixes. In particular, the handling of comments should be largely superior!
Have a look at the full changelog to see the list of improvements, and don't hesitate to share your feedback on this release on OCaml Discuss.
Items marked with an asterisk (*) are changes that are likely to format
existing code differently from the previous release when using the default
profile.
--numeric feature (#2333, #2357, @gpetiot)let f (type a) :> a M.u = .. (#2399, @Julow)module T = (val (x : (module S))) (#2370, @Julow)then begin end (#2369, @Julow)fun _ : _ -> (#2352, @Julow)(::) (#2347, @Julow)as-patterns that have parentheses (#2359, @Julow)@@ let+ x = ... (#2315, #2396, @Julow)
It was formatted differently than @@ let x = ....fun (type a) -> following fun x -> (#2294, @Julow)((module M) : (module S)) is formatted as (module M : S)) (#2280, #2300, @gpetiot, @Julow)~label:(fun ... (#2271, #2291, #2293, #2298, #2398, @Julow)
The fun keyword is docked where possible and the arguments are indented to avoid confusion with the body.The release of UTop 2.13.0 introduced a regression on Windows. We're releasing UTop 2.13.1 with a patch, and made UTop 2.13.0 unavailable on Windows.
In Dune 3.9.0, we added a feature that offloads some computations to background threads. Unfortunately, this has a bad interaction on macOS, where we fork processes to implement the RPC server and watch mode.
We marked Dune 3.9.0 unavailable on macOS, and released 3.9.1 with some mitigations: we don't offload these computations on macOS, and we only fork when necessary.
The plan for the next release is to stop forking processes on macOS.
Disable background operations and threaded console on macOS and other Unixes where we rely on fork. (#8100, #8121, fixes #8083, @rgrinberg, @emillon)
Initialize async I/O thread lazily. (#8122, @emillon)
We're releasing version 2.13.0 of UTop! This version comes with a couple of bug fixes.
It also bumps the minimal required version of OCaml to 4.11.0 and removes deprecated values from the API.
Fix behavior of utop -stdin (#434, fixes #433, @tuohy)
Handle bounds with Zed.next_error (#442, @tmattio)
Load files from XDG directories (the legacy paths still work). (#431, @Skyb0rg007)
Remove deprecated values prompt_continue, prompt_comment, smart_accept,
new_prompt_hooks, at_new_prompt (#427, @emillon)
Require OCaml 4.11.0 or newer. (#444, @emillon)
The Dune team is thrilled to announce the release of Dune 3.9.0. This version ships with a host of new features and improvements, including:
dune show Command: This command enables you to display various pieces of information. For instance, you can use dune show pp to display the preprocessed output of a file or dune show aliases [DIR] to list the aliases available in DIR. Read more about the command on its manpage using dune show --help..eml files.(build_if) Toggle in (test) Stanza: This new field facilitates the packaging of non-portable tests and benchmarks. If you have tests that don't build on a specific platform, you can now tell Dune not to build them on other Platforms with the build_if field.Enjoy the new features and improvements incorporated into this version!
Include the time it takes to read/write state files when --trace-file is
enabled (#7960, @rgrinberg)
Include source tree scans in the traces produced by --trace-file (#7937,
@rgrinberg)
Add --all option to dune rpc status to show all Dune RPC servers running.
(#8011, fix #7902, @Alizter)
Add additional metadata to the traces provided by --trace-file whenever
--trace-extended is passed (#7778, @rleshchinskiy)
$ dune describe is now a command group, so arguments to subcommands must be
passed after subcommand itself. (#7919, @Alizter)
Add dune show command group which is an alias of dune describe. (#7946,
@Alizter)
Add dune show env command and make dune printenv an alias of it. (#7985,
@Alizter)
Add commands dune show targets and dune show aliases that display all the
available targets and aliases in a given directory respectively. (#7770,
grants #265, @Alizter)
Extensions used in (dialect) can contain periods (e.g., cppo.ml). (#7782,
fixes #7777, @nojb)
The interface and implementation fields of a (dialect) are now optional
(#7757, @gpetiot)
Add (build_if) to the (test) stanza. When it evaluates to false, the
executable is not built. (#7899, fixes #6938, @emillon)
Allow (include_subdirs qualified) to be used when libraries define a
(modules ...) field (#7797, fixes #7597, @anmonteiro)
Allow multiple globs in library's (stdlib (internal_modules ..))
(@anmonteiro, #7878)
Do not rerun OCaml syntax files on every iteration of the watch mode. This is too memory consuming. (#7894, fix #6900, @rgrinberg)
Attach melange rules to the default alias (#7926, @haochenx)
Compute digests and manage sandboxes in background threads (#7947, @rgrinberg)
Validate file extension for $ dune ocaml top-module. (#8005, fixes #8004,
@3Rafal)
Cinaps: The promotion rules for cinaps would only offer one file at a time no matter how many promotions were available. Now we offer all the promotions at once (#7901, @rgrinberg)
Add necessary parentheses in generated opam constraints (#7682, fixes #3431, @Lucccyo)
We're excited to announce the release of Dune-release 2.0.0!
This release brings support for putting your .opam files in a opam/
directory. If your project contains dozens of packages, you'll be able to
generate them into the opam/ folder starting with Dune 3.8 using (opam_file_location inside_opam_directory) in your dune-project.
Another notable change is the removal of delegates. Users of dune-release who
want to publish their packages to another platform than GitHub can now use the
dune-release delegate-info and use the output to build their own publication
workflows.
opam/
subdirectory. (#466, @Leonidas-from-XIV)dune-release check now attempts to discover and parse the change
log, and a new flag --skip-change-log disables this behaviour. (#458,
@gridbugs)dune-project. The parser could get confused
when opam file generation is used. Now it only considers the first (name X)
in the file. (#445, @emillon)dune-release delegate-info
and wrap dune-release calls in a script. See #188 for details.
(#428, @NathanReb)dune-release expects
the opam binary to be version 2.0 at least. (#406, #411,
@Leonidas-from-XIV)We've released OCaml LSP 1.16.2 with a fix that was introduced in 1.16.1 that prevented users from using preprocessor such as CPPO.
We're thrilled to announce the release of OCaml LSP 1.16.1! 🎉
This release comes with new "Extract local" and "Extract function" code actions to easily refactor your code.
We've also disabled code lenses by default following user feedback. You can follow the discussion on GitHub.
This release is also the first OCaml LSP release to use upstream Merlin. Among other things, this means that it is compatible with all the OCaml versions supported by Merlin: currently OCaml 4.14 and 5.0.0.
We're also releasing numerous bug fixes, including:
And much more! Read the full changelog for a complete list of improvements and bug fixes.
didChangeConfiguration notification (#1103)merlin-lib 4.9 (#1070)Support building with OCaml 5.0 and 5.1 (#1150)
Disable code lens by default. The support can be re-enabled by explicitly setting it in the configuration. (#1134)
Fix initilization of ocamlformat-rpc in some edge cases when ocamlformat is
initialized concurrently (#1132)
Kill unnecessary $ dune ocaml-merlin with SIGTERM rather than SIGKILL
(#1124)
Refactor comment parsing to use odoc-parser and cmarkit instead of
octavius and omd (#1088)
This allows users who migrated to omd 2.X to install ocaml-lsp-server in the same opam switch.
We also slightly improved markdown generation support and fixed a couple in the generation of inline heading and module types.
Allow opening documents that were already open. This is a workaround for neovim's lsp client (#1067)
Disable type annotation for functions (#1054)
Respect codeActionLiteralSupport capability (#1046)
Fix a document syncing issue when utf-16 is the position encoding (#1004)
Disable "Type-annotate" action for code that is already annotated. (#1037, fixes #1036)
Fix semantic highlighting of long identifiers when using preprocessors (#1049, fixes #1034)
Fix the type of DocumentSelector in cram document registration (#1068)
Accept the --clientProcessId command line argument. (#1074)
Accept --port as a synonym for --socket. (#1075)
Fix connecting to dune rpc on Windows. (#1080)
We've released Dune 3.8.2 with a few bug fixes.
-p / --only-packages for melange.emit artifacts (dune#7849, @anmonteiro)We've just released a patch version of Dune to fix regressions introduced in Dune 3.8.0.
In particular, we've reverted some cross-compilation improvements that caused build failures when using ppx_runtime_libraries and we'll revisit them in a future version of Dune.
(mode vo) for
these older versions of Coq. (dune#7847, fixes dune#7846, @Alizter)ppx_runtime_libraries in the target context when
cross compiling) (dune#7887, fixes dune#7875, @emillon)Feedback on this post is welcomed on Discuss!
We are pleased to announce the patch release of opam 2.1.5.
This opam release consists of backported bug & security fixes:
archive-mirrors field from init config file to config (#5315)Opam installation instructions (unchanged):
From binaries: run
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.1.5"
or download manually from the Github "Releases" page to your PATH. In this case, don't forget to run opam init --reinit -ni to enable sandboxing if you had version 2.0.0~rc manually installed or to update you sandbox script.
From source, using opam:
opam update; opam install opam-devel
(then copy the opam binary to your PATH as explained, and don't forget to run opam init --reinit -ni to enable sandboxing if you had version 2.0.0~rc manually installed or to update your sandbox script)
From source, manually: see the instructions in the README.
We hope you enjoy this new minor version, and remain open to bug reports and suggestions.
archive-mirrors field from init config file to config
[#5315 @hannesm]We are pleased to announce the release of Merlin 4.9 for OCaml 4.14.1 and 5.0.
This maintenance release brings multiple bug fixes and improvements. In particular we identified and patched an important memory consumption issue that could greatly affect Merlin’s performance in heavily functorized projects.
scope option to the occurrences command in preparation for
the upcoming project-wide-occurrences feature (#1596)false instead of true in the
construct command, for consistency (#1599).construct results ordering for sum types sand poly variants (#1603)errors to erroneously alert about missing
cmi files (#1577)merlin-construct (#1598)construct ordering (#1603)The dune team is pleased to announce the release of Dune 3.8.0.
It is now available in opam-repository. As usual, it should always be safe to upgrade your dune package: new features and deprecations are only available if you upgrade the language version in your dune-project files.
concurrent actionDune 3.8.0 introduced the new concurrent action. You can now use it instead of the progn action to execute actions concurrently.
For instance:
(rule
(action
(concurrent
(write-file A "I am file A.\n")
(write-file B "I am certainly file B.\n")
(write-file C "I am most certainly file C.\n"))))
will write to files A, B and C concurrently.
.mld filesIn Dune 3.7.0, we introduced version 0.3 of the mdx stanza, which came with support for .mld files.
In Dune 3.8.0, .mld files are now supported by default with version 0.4 of the mdx stanza!
Have a look at this diff to see how to migrate your code to the new stanza version.
Introduce mdx stanza 0.4 requiring mdx >= 2.3.0 which updates the default
list of files to include *.mld files (#7582, @Leonidas-from-XIV)
Allow (stdlib ...) to be used with (wrapped false) in library stanzas
(#7139, @anmonteiro).
Allow the main module of a library with (stdlib ...) to depend on other
libraries (#7154, @anmonteiro).
Support (link_flags ...) in (cinaps ...) stanza. (#7423, fixes #7416,
@nojb)
Allow (package ...) in any position within (rule ...) stanza (#7445,
@Leonidas-from-XIV)
Added a new user action (concurrent ) which is like (progn ) but runs the
actions concurrently. (#6933, @Alizter)
Accept the Ordered Set Language for the modes field in library stanzas
(#6611, @anmonteiro).
Allow parallel execution of inline tests partitions (#7012, @hhugo)
Add the --display-separate-messages flag to separate the error messages
produced by commands with a blank line. (#6823, fixes #6158, @esope)
Add --watch-exclusions to Dune build options (#7216, @jonahbeckford)
Adds support for loading plugins in toplevels (#6082, fixes #6081, @ivg, @richardlford)
Introduce a public_headers field on libraries. This field is like
install_c_headers, but it allows to choose the extension and choose the
paths for the installed headers. (#7512, @rgrinberg)
Dune can now detect Coq theories from outside the workspace. This allows for composition with installed theories (not necessarily installed with Dune). (#7047, @Alizter, @ejgallego)
Added a --no-build option to dune coq top for avoiding rebuilds (#7380,
fixes #7355, @Alizter)
Add a coqdoc_flags field to the coq.theory stanza allowing the user to
pass extra arguments to coqdoc. (#7676, fixes #7954 @Alizter)
Preliminary support for Coq compiled intefaces (.vos files) enabled via
(mode vos) in coq.theory stanzas. This can be used in combination with
dune coq top to obtain fast re-building of dependencies (with no checking
of proofs) prior to stepping into a file. (#7406, @rlepigre)
Read pkg-config arguments from the PKG_CONFIG_ARGN environment variable
(#1492, #7734, @anmonteiro)
Use $PKG_CONFIG, when set, to find the pkg-config binary (#7469, fixes
#2572, @anmonteiro)
Bootstrap: remove reliance on shell. Previously, we'd use the shell to get the number of processors. (#7274, @rgrinberg)
Non-user proccesses such as version control or config checking are now run silently. (#6994, fixes #4066, @Alizter)
Bytecode executables built for JSOO are linked with -noautolink and no
longer depend on the shared stubs of their dependent libraries (#7156, @nojb)
Always include opam files in the generated .install file. Previously, it
would not be included whenever (generate_opam_files true) was set and the
.install file wasn't yet generated. (#7547, @rgrinberg)
Modules that were declared in (modules_without_implementation),
(private_modules) or (virtual_modules) but not declared in (modules)
will cause Dune to emit a warning which will become an error in 3.9. (#7608,
fixes #7026, @Alizter)
Coq language versions less 0.8 are deprecated, and will be removed
in an upcoming Dune version. All users are required to migrate to
(coq lang 0.8) which provides the right semantics for theories
that have been globally installed, such as those coming from opam
(@ejgallego, @Alizter)
Find pps dependencies in the host context when cross-compiling, (#7415,
fixes #4156, @anmonteiro)
Fix plugin loading with findlib. The functionality was broken in 3.7.0. (#7556, @anmonteiro)
Load the host context findlib.conf when cross-compiling (#7428, fixes
#1701, @rgrinberg, @anmonteiro)
Allow overriding the ocaml binary with findlib configuration (#7648,
@rgrinberg)
Resolve ppx_runtime_libraries in the target context when cross compiling
(#7450, fixes #2794, @anmonteiro)
Fix dune install when cross compiling (#7410, fixes #6191, @anmonteiro,
@rizo)
Fix string quoting in the json file written by --trace-file (#7773,
@rleshchinskiy)
Correctly set MANPATH in dune exec. Previously, we would use the bin/
directory of the context. (#7655, @rgrinberg)
merlin: ignore instrumentation settings for preprocessing. (#7606, fixes #7465, @Alizter)
When a rule's action is interrupted, delete any leftover directory targets. This is consistent with how we treat file targets. (#7564, @rgrinberg)
Fix dune crashing on MacOS in watch mode whenever $PATH contains $PWD
(#7441, fixes #6907, @rgrinberg)
Dune in watch mode no longer builds concurrent rules in serial (#7395 @rgrinberg, @jchavarri)
dune coq top now correctly respects the project root when called from a
subdirectory. However, absolute filenames passed to dune coq top are no
longer supported (due to being buggy) (#7357, fixes #7344, @rlepigre and
@Alizter)
RPC: Ignore SIGPIPE when clients suddenly disconnect (#7299, #7319, fixes #6879, @rgrinberg)
Always clean up the UI on exit. (#7271, fixes #7142 @rgrinberg)
Bootstrap: correctly detect the number of processors by allowing nproc to be
looked up in $PATH (#7272, @Alizter)
Speed up file copying on macos by using clonefile when available
(@rgrinberg, #7210)
Support commands that output 8-bit and 24-bit colors in the terminal (#7188, @Alizter)
Speed up rule generation for libraries and executables with many modules (#7187, @jchavarri)
Do not re-render UI on every frame if the UI doesn't change (#7186, fix #7184, @rgrinberg)
Make coq_db creation in scope lazy (@ejgallego, #7133)
dune install now respects --display quiet mode (#7116, fixes #4573, fixes #7106, @Alizter)
Stub shared libraries (dllXXX_stubs.so) in Dune-installed libraries could
not be used as dependencies of libraries in the workspace (eg when compiling
to bytecode and/or Javascript). This is now fixed. (#7151, @nojb)
Fix regression where Merlin was unable to handle filenames with uppercase letters under Windows. (#7577, @nojb)
On nix+macos, pass -f to the codesign hook to avoid errors when the binary
is already signed (#7183, fixes #6265, @greedy)
Fix bug where RPC clients built with dune-rpc-lwt would crash when closing their connection to the server (#7581, @gridbugs)
Fix RPC server on Windows (used for OCaml-LSP). (#7666, @nojb)
Following the release of UTop 2.12.0 a few days ago, we released UTop 2.12.1, a patch release that fixes a regression with unit qualification.
This release also includes an implementation of completion-at-point for Emacs.
Unit module is in scope with
no () constructor (fix regression with unit qualification ocaml-community/utop#429, fixes regression with qualifying () ocaml-community/utop#428, @emillon)UTop 2.12.0 is out with support for the upcoming release of OCaml 5.1!
This release also fixes an issue that prevented users to redefine the () constructor.
You can now safely run type t = () of unit and continue using your top-level session.
Add support for OCaml 5.1 (#421, @emillon)
Mark prompt_continue, prompt_comment, smart_accept, new_prompt_hooks,
at_new_prompt as deprecated (they have been documented as such since 2012
and most of them are ignored) (#415, @emillon)
Qualify () constructor in generated expressions. (#418, fixes #417, @emillon)
We're pleased to announce the release of Mdx 2.3.0!
This release comes with support for mld files and changes the parser used
by the toplevel, which allows Camlp5's parser to be used with MDX.
Starting in MDX 2.3.0, you can now execute code blocks in your .mld files! 🎉
As a reminder, .mld files are text files similar to Markdown, but instead of
using the Markdown markup language, they use the Ocamldoc markdown language - as
is used in .mli files. .mld are typically used to write manuals with
odoc.
To run mdx on .mld files, start by enabling mdx in your dune-project:
(using mdx 0.3)
Then list your .mld files in the mdx stanza in your dune:
(mdx
(files index.mld))
Now if you put a code block in index.mld, it will be executed when running dune test and if dune will suggest to promote the output. For instance, if you run dune test with this index.mld:
Here's an example code block in a [.mld] file:
{[
# List.map (fun x -> x * x) [(1 + 9); 2; 3; 4];;
]}
dune test will return:
---+++@@@@ Here's an example code block in a [.mld] file:
{[
# List.map (fun x -> x * x) [(1 + 9); 2; 3; 4];;
+ - : int list = [100; 4; 9; 16]
]}
You can run dune promote to accept the change.
You can see a complete demo of this here.
Now you can keep the code blocks in your manual up-to-date even when your API changes!
mld files (#423, @jonludlam)ref, instead of always the official OCaml parser). This allows
Camlp5's parser to be used with MDX. (#417, @chetmurthy)We are excited to announce the release of Dune 3.7.1, which brings a few bug fixes from the recent 3.7.0 release:
... and a few more, you can consult the changelog for a full list of bug fixes.
Fix segfault on MacOS when dune was being shutdown while in watch mode. (#7312, fixes #6151, @gridbugs, @emillon)
Fix preludes not being recorded as dependencies in the (mdx) stanza (#7109,
fixes #7077, @emillon).
Pass correct flags when compiling stdlib.ml. (#7241, @emillon)
Handle "Too many links" errors when using Dune cache on Windows. The fix in 3.7.0 for this same issue was not effective due to a typo. (#7472, @nojb)
We are pleased to announce the release of OCamlFormat 0.25.1! This release contains several bug fixes, changes, and new features.
The library is also available through the ocamlformat-lib package on opam. The ocamlformat package only contains the binary.
We would like to thank all contributors for their valuable contributions to this release. Please see the complete changelog for more details.
We hope you enjoy this release and continue to find OCamlFormat a valuable tool for your OCaml projects. You can download ocamlformat.0.25.1 from the opam repository or GitHub.
Thank you for your support and feedback, and please don't hesitate to reach out if you have any questions or issues.
The OCamlFormat team
if-then-else and break-cases optionsStarting in OCamlFormat 0.25.1, we've also added new values to the if-then-else and break-cases options. Now you can use the vertical value to format these expressions in a more readable and consistent way.
These options are not set by default but you can try them out by customizing your .ocamlformat file as usual.
Here are a few examples:
if-then-else = vertical- let epi = if Option.is_some next then fmt "@\n" else fmt_opt epi in
+ let epi =
+ if Option.is_some next then
+ fmt "@\n"
+ else
+ fmt_opt epi
+ in
- if tree_depth tree > depth then node_depth_truncate_ depth node
- else (* already short enough; don't bother truncating *)
+ if tree_depth tree > depth then
+ node_depth_truncate_ depth node
+ else
+ (* already short enough; don't bother truncating *)
node
break-cases = vertical-| Ok (`Version | `Help) -> Stdlib.exit 0
-| Error _ -> Stdlib.exit 1
+| Ok (`Version | `Help) ->
+ Stdlib.exit 0
+| Error _ ->
+ Stdlib.exit 1
- ~f:(function `Int _ | `Float _ -> true | _ -> false)
+ ~f:(function
+ | `Int _
+ | `Float _ ->
+ true
+ | _ ->
+ false)
Formatting .mld files as odoc documentation files is now possible! This will make it much easier to maintain high-quality documentation alongside your OCaml code.
This feature is only available in ocamlformat for now, but keep an eye on the future dune releases to know when dune fmt will be able to format your .mld files!
We fixed various issues related to indentation, alignment, and comments positioning.
Here are a few examples:
| [ node ] ->
( (if List.mem node ~set:integer_graph.(node)
- then Has_loop [ numbering.forth.(node) ]
- else No_loop numbering.forth.(node))
+ then Has_loop [ numbering.forth.(node) ]
+ else No_loop numbering.forth.(node))
, component_edges.(component) )
(let open Memo.O in
- let+ w = Dune_rules.Workspace.workspace () in
- Dune_engine.Execution_parameters.builtin_default
- |> Dune_rules.Workspace.update_execution_parameters w);
+ let+ w = Dune_rules.Workspace.workspace () in
+ Dune_engine.Execution_parameters.builtin_default
+ |> Dune_rules.Workspace.update_execution_parameters w);
- module Sel = (val if is_osx () then (module Mac)
- else if Sys.unix then (module Unix)
- else (module Fail) : Unix_socket)
+ module Sel =
+ (val if is_osx () then (module Mac)
+ else if Sys.unix then (module Unix)
+ else (module Fail)
+ : Unix_socket)
max-indent option is not set (#2131, @hhugo, @gpetiot)enable/disable floating attributes (#2156, @gpetiot).ocamlformat-ignore under Windows (#2206, @nojb)initializer keyword (#2145, @gpetiot)(struct end) vs ()) (#2135, #2146, @trefis, @gpetiot)((module X) : (module Y)) vs (module X : Y)) (#2136, @trefis, @gpetiot)if carrying attributes (#2167, @trefis, @gpetiot)ocamlformat package now only contains the binary, the library is available through the ocamlformat-lib package (#2230, @gpetiot)break-colon option to decide whether to break before or after the : symbol in value binding declarations and type constraints. This behavior is no longer ensured by ocp-indent-compat. (#2149, @gpetiot).mld files as odoc documentation files (#2008, @gpetiot)vertical for option if-then-else (#2174, @gpetiot)vertical for option break-cases (#2176, @gpetiot)wrap-or-vertical for option break-infix that only wraps high precedence infix ops (#1865, @gpetiot)We are pleased to announce the release of Merlin 4.8 for OCaml 4.14.1 and 5.0.
This maintenance release brings multiple bug fixes and improvements to document fetching, jump-to-definition and type-on-hover for records' labels.
OCamlFormat 0.25.0 is now available with expanded formatting capabilities!
This release addresses numerous inconsistencies and bugs, particularly around comment positioning, parentheses handling, and alignment issues. Key fixes include proper indentation when OCamlFormat is disabled on expressions, correct formatting of chunks with enable/disable attributes, and improved handling of comments around variant identifiers, type aliases, and constructor records. The release also resolves several platform-specific issues, including Windows build automation and glob pattern interpretation in .ocamlformat-ignore files.
New formatting options provide developers with more control over code layout. The break-colon option allows customization of line breaks around colons in value bindings and type constraints. Both if-then-else and break-cases options now support a vertical value for consistent vertical formatting. Additionally, OCamlFormat can now format .mld files as odoc documentation, and a new wrap-or-vertical value for break-infix provides more nuanced control over high-precedence infix operator wrapping.
max-indent option is not set (#2131, @hhugo, @gpetiot)enable/disable floating attributes (#2156, @gpetiot).ocamlformat-ignore under Windows (#2206, @nojb)initializer keyword (#2145, @gpetiot)(struct end) vs ()) (#2135, #2146, @trefis, @gpetiot)((module X) : (module Y)) vs (module X : Y)) (#2136, @trefis, @gpetiot)if carrying attributes (#2167, @trefis, @gpetiot)ocamlformat package now only contains the binary, the library is available through the ocamlformat-lib package (#2230, @gpetiot)break-colon option to decide whether to break before or after the : symbol in value binding declarations and type constraints. This behavior is no longer ensured by ocp-indent-compat. (#2149, @gpetiot).mld files as odoc documentation files (#2008, @gpetiot)vertical for option if-then-else (#2174, @gpetiot)vertical for option break-cases (#2176, @gpetiot)wrap-or-vertical for option break-infix that only wraps high precedence infix ops (#1865, @gpetiot)The dune team is pleased to announce the release of Dune 3.7.0.
As in the previous announce, here is a changelog split in several parts: changes to the dune executable itself (new commands or options, etc) and changes to the dune language. Most of the changes to the latter are only enabled when you opt-in to the new version by specifying (lang dune 3.7) in the corresponding dune-project file. In other words, it should always be safe to upgrade the dune package.
Dune 3.7 now supports watch mode for executables! 🎉
It works just as you'd expect, if you define an executable, you can run it with
dune exec -w my-executable
It will interrupt the process when a file change and re-start the application.
For a practical example of the workflows enabled by watch-mode, check this demo of a live reload for web development:
Starting from Dune 3.7, Dune watch mode is now available on Windows!
@yams-yams and @nojb
from Lexifi have been working on integrating Windows native polling API with
Dune to supplement the support for fswatch, which is unavailable on Windows.
Windows users can now run dune build -w out of the box!
It's quite common to organise your code into subdirectories to separate
components. Until now, you could do this by including
(include_subdirs unqualified) in your dune files, but this wasn't completely
satisfying since all of your modules were available in the top-level. If you
wanted to expose modules in subdirectories under another module, you had to
create a separate library, which was.. quite the overhead.
Dune 3.7 brings support for the highly-anticipated qualified sub-directories.
You can now write (include_subdirs qualified) in your dune file, and modules
in your subdirectories will be exposed under a module with the name of the
directory.

Allow running $ dune exec in watch mode (with the -w flag). In watch mode,
$ dune exec the executed binary whenever it is recompiled. (#6966,
@gridbugs)
Add a dune cache size command for displaying the size of the cache (#6638,
@Alizter)
Allow $ dune ocaml dump-dot-merlin to run in watch mode. Also this command
shouldn't print "Entering Directory" mesages. (#6497, @rgrinberg)
Add native support for polling mode on Windows (#7010, @yams-yams, @nojb, review by @Rucikir and @jbeckford)
Auto-detect dune-workspace files as dune files in Emacs (#7061,
@ilankri)
Allow $ dune utop to load libraries defined in data only directories
defined using (subdir ..) (#6631, @rgrinberg)
Make dune describe workspace return consistent dependencies for
executables and for libraries. By default, compile-time dependencies
towards PPX-rewriters are from now not taken into account (but
runtime dependencies always are). Compile-time dependencies towards
PPX-rewriters can be taken into account by providing the
--with-pps flag. (#6727, fixes #6486, @esope)
Use colored output with MDX when Dune colors are enabled. (#6462, @MisterDA)
Use colored output with GCC and Clang when compiling C stubs. The
flag -fdiagnostics-color=always is added to the :standard set of
flags. (#4083, @MisterDA)
Move $ dune ocaml-merlin -dump-config=$dir to $ dune ocaml merlin dump-config $dir. (#6547, @rgrinberg)
Fix parsing of OCaml errors that contain code excerpts with ... in them.
(#7008, @rgrinberg)
Fix --trace-file output. Dune now emits a single complete event for every
executed process. Unterminated async events are no longer written. (#6892,
@rgrinberg)
Print missing newline after $ dune exec. (#6821, fixes #6700, @rgrinberg,
@Alizter)
Fix binary corruption when installing or promoting in parallel (#6669, fixes #6668, @edwintorok)
Report an error if dune init ... would create a "dune" file in a location
which already contains a "dune" directory (#6705, @gridbugs)
Fix the parsing of alerts. They will now show up in diagnostics correctly. (#6678, @rginberg)
Print "Leaving Directory" whenever "Entering Directory" is printed. (#6419, fixes #138, @cpitclaudel, @rgrinberg)
Remove "Entering Directory" messages for $ dune install. (#6513,
@rgrinberg)
dune clean should no longer fail under Windows due to the inability to
remove the .lock file. Also, bring the implementation of the global lock
under Windows closer to that of Unix. (#6523, @nojb)
Fix missing dependencies when detecting the kind of C compiler we're using (#6610, fixes #6415, @emillon)
Remove spurious build dir created when running dune init proj ... (#6707,
fixes #5429, @gridbugs)
Validate the command line arguments for $ dune ocaml top-module. This
command requires one positional argument (#6796, fixes #6793, @rgrinberg)
Fix dependency cycle when installing files to the bin section with
glob_files (#6764, fixes #6708, @gridbugs)
Handle "Too many links" errors when using Dune cache on Windows (#6993, @nojb)
Pre-emptively clear screen in watch mode (#6987, fixes #6884, @rgrinberg)
Allow --sandbox to affect ocamldep invocations. Previously, they were
wrongly marked as incompatible (#6749, @rgrinberg)
Allow (include_subdirs qualified) for OCaml projects. (#6594, fixes #1084,
@rgrinberg)
Format dune files when they are named dune-file. This occurs when we enable
the alternative file names project option. (#6566, @rgrinberg)
Add map_workspace_root dune-project stanza to allow disabling of
mapping of workspace root to /workspace_root. (#6988, fixes #6929,
@richardlford)
Allow the cinaps stanza to set a custom alias. By default, if the alias is
not set then the cinaps actions will be attached to both @cinaps and
@runtest (#6991, @rgrinberg)
Add (using ctypes 0.3). When used, paths in (ctypes) are interpreted
relative to where the stanza is defined. (#6883, fixes #5325, @emillon)
Stop passing -q flag in dune coq top, which allows for .coqrc to be
loaded. (#6848, fixes #6847, @Alizter)
Coq native mode is now automatically detected by Dune starting with Coq lang
0.7. (mode native) has been deprecated in favour of detection from the
configuration of Coq. (#6409, @Alizter)
Accurately determine merlin configuration for all sources selected with
copy# and copy_files#. The old heuristic of looking for a module in
parent directories is removed (#6594, @rgrinberg)
Fix parsing of the <= operator in blang expressions of dune files.
Previously, the operator would be interpreted as <. (#6928, @tatchi)
Fix preprocessing with staged_pps (#6748, fixes #6644, @rgrinberg)
Fix the parsing of decimal and hexadecimal escape literals in dune,
dune-package, and other dune s-expression based files (#6710, @shym)
Fix cross compilation configuration when a context with targets is itself a host of another context (#6958, fixes #6843, @rgrinberg)
Allow compilation rules to be impacted by (env ..) stanzas that modify the
environment or set binaries. (#6527, @rgrinberg)
Fix handling of support files generated by odoc. (#6913, @jonludlam)
Fix the compilation of modules generated at link time when
implicit_transitive_deps is enabled (#6642, @rgrinberg)
Fix inline tests with js_of_ocaml and whole program compilation mode enabled (#6645, @hhugo)
Fix js_of_ocaml separate compilation rules when --enable=effects
,--enable=use-js-string or --toplevel is used. (#6714, #6828, #6920, @hhugo)
Fix js_of_ocaml separate compilation in presence of linkall (#6832, #6916, @hhugo)
coqdep is now called once per theory, instead of one time per Coq
file. This should significantly speed up some builds, as coqdep
startup time is often heavy (#7048, @Alizter, @ejgallego)