OCaml Changelog

RSS

Read the latest releases and updates from the OCaml ecosystem.

Odoc 2.1.1

See full changelog

Additions

  • New subcommand to resolve references (@panglesd, @lubegasimon, #812)
  • Improved rendering of long signatures (@panglesd, #782)
  • Handle comments attached to open statement as floating comment, instead of dropping them (@panglesd, #797)
  • Empty includes (containing entirely shadowed entries) are now hidden (@panglesd, #798)

Bugs fixed

  • Fix a missing Result constructor during compile. This will cause some functor arguments to have different filenames (@jonludlam, #795)
  • Better memory/disk space usage when handling module alias chains (@jonludlam, #799)
  • Resolving class-type paths (ie., val x : #c) (@jonludlam, #809)
  • Skip top-level attributes while extracting the top comment. Fix top-comment extraction with PPX preprocessing (@jorisgio, #819)
  • Better handling of @canonical tags (@jonludlam, #820)
  • css: improved layout (@jonludlam, @Julow, #822)

Merlin 4.6

See full changelog
  • merlin binary
    • make most library public and split merlin in two packages: the merlin-lib package that exposes merlin's internals and the merlin package with the frontend. (#1448, #1455, #1457, #1497, @rgrinberg, @tmattio, @kit-ty-kate)
    • Type printing: use best_module_path for paths from Mty_alias (#1470)
    • Attempt at finding the 'real' capitalization of files on windows (#1462 by @mlasson)
    • Use newer Seq-based API of Yojson 2.0, avoiding the need for the deprecated Stream module (#1475 by @Leonidas-from-XIV)
    • unify parsing of MERLIN_LOG (#1480 by @ulugbekna)
    • Fix type deduplication in type-enclosing results (#1483, fixes #1477)
    • Only weakly reduce the shapes to speed up the new Merlin locate implementation. (#1488)
    • Ignore unknown configuration tags from dune configuration provider but not from dot-merlin-reader (#1486)
    • typing recovery: recover at the granularity of core_type (#1484)
  • editor modes
    • add method imenu items for emacs (#1481, @mndrix)
    • emacs: Make the prefix argument to merlin-locate optional, both for consistency with Emacs convention and for backwards compatibility. (#1476, @antalsz)
    • emacs: fix duplicated prefix path in imenu entries (#1495, @bcc32)
See full changelog

Fixes

  • Fix preprocessing, ppx, and reason support (#735 fixes #696, #706)

  • Support include in folding ranges (#730)

See full changelog

Features

  • Fix cancellation mechanism for all requests (#707)

  • Allow cancellation of formatting requests (#707)

  • Add --fallback-read-dot-merlin to the LSP Server (#705). If ocamllsp is started with this new flag, it will fall back to looking for Merlin configuration in .merlin files rather than calling dune ocaml-merlin. (#705)

  • Support folding more ranges (#692)

Dune 3.3.1

See full changelog
  • Improve parsing of ocamlc errors. We now correctly strip excerpts and parse alerts (#5879, @rgrinberg)

  • The (libraries) field of the coq.theory stanza has been renamed to (plugins) and the Coq language version has been bumped to 0.5.

Dune 3.3.0

On behalf of the dune team, I’m pleased to announce the release of version 3.3.0. This is the first version that supports the upcoming OCaml 5.0. It also improves safety by sandboxing more rules and enabling more warnings, and there's a bunch of new features on the coq side too. Full changelog follows.

Note that as usual, dune works hard not to break existing packages. So even if it mentions that rules require precise dependencies, for example, this new safety net is only enabled for project that use (lang dune 3.3).

Happy hacking.

See full changelog
  • Sandbox preprocessing, lint, and dialect rules by default. All these rules now require precise dependency specifications (#5807, @rgrinberg)

  • Allow list expansion in the pps specification for preprocessing (#5820, @Firobe)

  • Add warnings 67-69 to dune's default set of warnings. These are warnings of the form "unused X.." (#5844, @rgrinberg)

  • Introduce project "composition" for coq theories. Coq theories in separate projects can now refer to each other when in the same workspace (#5784, @Alizter, @rgrinberg)

  • Fix hint message for data_only_dirs that wrongly mentions the unknown constructor data_only (#5803, @lambdaxdotx)

  • Fix creating sandbox directory trees by getting rid of buggy memoization (#5794, @rgrinberg, @snowleopard)

  • Handle directory dependencies in sandboxed rules. Previously, the parents of these directory dependencies weren't created. (#5754, @rgrinberg)

  • Set the exit code to 130 when dune is terminated with a signal (#5769, fixes #5757)

  • Support new locations of unix, str, dynlink in OCaml >= 5.0 (#5582, @dra27)

  • The coq.theory stanza now produces rules for running coqdoc. Given a theory named mytheory, the directory targets mytheory.html/ and mytheory.tex/ or additionally the aliases @doc and @doc-latex will build the HTML and LaTeX documentation repsectively. (#5695, fixes #3760, @Alizter)

  • Coq theories marked as (boot) cannot depend on other theories (#5867, @ejgallego)

  • Ignore bigarray in (libraries) with OCaml >= 5.0. (#5526, fixes #5494, @moyodiallo)

  • Start with :standard when building the ctypes generated foreign stubs so that we include important compiler flags, such as -fPIC (#5816, fixes #5809).

See full changelog

Removed

  • Profiles compact and sparse are now removed (#2075, @gpetiot)
  • Options align-cases, align-constructors-decl and align-variants-decl are now removed (#2076, @gpetiot)
  • Option disable-outside-detected-project is now removed (#2077, @gpetiot)

Deprecated

  • Cancel the deprecations of options that are not set by the preset profiles (#2074, @gpetiot)

Bug fixes

  • emacs: Remove temp files in the event of an error (#2003, @gpetiot)
  • Fix unstable comment formatting around prefix op (#2046, @gpetiot)

Changes

  • Qtest comments are not re-formatted (#2034, @gpetiot)
  • ocamlformat-rpc is now distributed through the ocamlformat package (#2035, @Julow)
  • Doc-comments code blocks with a language other than 'ocaml' (set in metadata) are not parsed as OCaml (#2037, @gpetiot)
  • More comprehensible error message in case of version mismatch (#2042, @gpetiot)
  • The global configuration file ($XDG_CONFIG_HOME or $HOME/.config) is only applied when no project is detected, --enable-outside-detected-project is set, and no applicable .ocamlformat file has been found. Global and local configurations are no longer used at the same time. (#2039, @gpetiot)
  • Set ocaml-version to a fixed version (4.04.0) by default to avoid reproducibility issues and surprising behaviours (#2064, @kit-ty-kate)
  • Split option --numeric=X-Y into --range=X-Y and --numeric (flag). For now --range can only be used with --numeric. (#2073, #2082, @gpetiot)

New features

  • New syntax (*= ... *) for verbatim comments (#2028, @gpetiot)
  • Preserve the begin-end construction in the AST (#1785, @hhugo, @gpetiot)
  • Preserve position of comments located after the semi-colon of the last element of lists/arrays/records (#2032, @gpetiot)
  • Option --print-config displays a warning when an .ocamlformat file defines redundant options (already defined by a profile) (#2084, @gpetiot)
See full changelog

Fixed

  • Fix project name detection from dune-project. The parser could get confused when opam file generation is used. Now it only considers the first (name X) in the file. (#445, #446, @emillon)

Dune 3.2.0

On behalf of the dune team, I'm pleased to announce the availability of version 3.2.0. This release contains few new features, but is packed with bug fixes and usability improvements. In particular, I'd like to point out that we've continued to improve the user experience with the watch mode. I encourage you all to try it out if you haven't already.

Happy Hacking.

See full changelog
  • Fixed dune describe workspace --with-deps so that it correctly handles Reason files, as well as files any other dialect. (#5701, @esope)

  • Disable alerts when compiling code in vendored directories (#5683, @NathanReb)

  • Fixed dune describe --with-deps, that crashed when some preprocessing was required in a dune file using per_module. (#5682, fixes #5680, @esope)

  • Add $ dune describe pp to print the preprocssed ast of sources. (#5615, fixes #4470, @cannorin)

  • Report dune file evaluation errors concurrently. In the same way we report build errors. (#5655, @rgrinberg)

  • Watch mode now default to clearing the terminal on rebuild (#5636, fixes, #5216, @rgrinberg)

  • The output of jobs that finished but were cancelled is now omitted. (#5631, fixes #5482, @rgrinberg)

  • Allows to configure all the default destination directories with ./configure (adds bin, sbin, data, libexec). Use OPAM_SWITCH_PREFIX instead of calling the opam binaries in dune install. Fix handling of multiple libdir in ./configure for handling /usr/lib/ocaml/ and /usr/local/lib/ocaml. In dune install forbid relative directories in libdir, docdir and others specific directory setting because their handling was inconsistent (#5516, fixes #3978 and #5455, @bobot)

  • --terminal-persistence=clear-on-rebuild will no longer destroy scrollback on some terminals (#5646, @rgrinberg)

  • Add a fmt command as a shortcut of dune build @fmt --auto-promote (#5574, @tmattio)

  • Watch mode now tracks copied external files, external directories for dependencies, dune files in OCaml syntax, files used by include stanzas, dune-project, opam files, libraries builtin with compiler, and foreign sources (#5627, #5645, #5652, #5656, #5672, #5691, #5722, fixes #5331, @rgrinberg)

  • Improve metrics for cram tests. Include test names in the event and add a category for cram tests (#5626, @rgrinberg)

  • Allow specifying multiple licenses in project file (#5579, fixes #5574, @liyishuai)

  • Match glob_files only against files in external directories (#5614, fixes #5540, @rgrinberg)

  • Add pid's to chrome trace output (#5617, @rgrinberg)

  • Fix race when creating local cache directory (#5613, fixes #5461, @rgrinberg)

  • Add not to boolean expressions (#5610, fix #5503, @rgrinberg)

  • Fix relative dependencies outside the workspace (#4035, fixes #5572, @bobot)

  • Allow to specify --prefix via the environment variable DUNE_INSTALL_PREFIX (#5589, @vapourismo)

  • Dune-site.plugin: add support for archive(native|byte, plugin) used in the wild before findlib documented plugin(native|byte) in 2015 (#5518, @bobot)

  • Fix a bug where Dune would not correctly interpret META files in alternative layout (ie when the META file is named META.$pkg). The Llvm bindings were affected by this issue. (#5619, fixes #5616, @nojb)

  • Support (binaries) in (env) in dune-workspace files (#5560, fix #5555, @emillon)

  • (mdx) stanza: add support for (locks). (#5628, fixes #5489, @emillon)

  • (mdx) stanza: support including files in different directories using relative paths, and provide better error messages when paths are invalid (#5703, #5704, fixes #5596, @emillon)

  • Fix ctypes rules for external lib names which aren't valid ocaml names (#5667, fixes #5511, @Khady)

See full changelog
  • Fix process termination. Once the lsp server is stepped, the process will gracefully terminate (#697, fixes #694)

  • Forward stderr from dune's merlin configuration to the lsp server's stderr (#697)

See full changelog
  • Fix bug with large buffers being resized incorrectly in Lev

  • Add folding ranges for more AST types (#680)

Dune 3.1.1

See full changelog
  • Fix build on Cygwin. (#5593, fixes 5577, @nojb)

  • Fix execution of (system ..) actions on Windows. (#5593, fixes #5523, @nojb)

Dune 3.1.0

On behalf of the dune team, I'm pleased to announce version 3.1.0. This release contains some small, but interesting features, and some important quality of life bug fixes. I encourage everyone to upgrade as soon as possible.

Happy Hacking.

See full changelog
  • Add sourcehut as an option for defining project sources in dune-project files. For example, (source (sourcehut user/repo)). (#5564, @rgrinberg)

  • Add dune coq top command for running a Coq toplevel (#5457, @rlepigre)

  • Fix dune exec dumping database in wrong directory (#5544, @bobot)

  • Always output absolute paths for locations in RPC reported diagnostics (#5539, @rgrinberg)

  • Add (deps <deps>) in ctype field (#5346, @bobot)

  • Add (include <file>) constructor to dependency specifications. This can be used to introduce dynamic dependencies (#5442, @anmonteiro)

  • Ensure that dune describe computes a transitively closed set of libraries (#5395, @esope)

  • Add direct dependencies to $ dune describe output (#5412, @esope)

  • Show auto-detected concurrency on Windows too (#5502, @MisterDA)

  • Fix operations that remove folders with absolute path. This happens when using esy (#5507, @EduardoRFS)

  • Dune will not fail if some directories are non-empty when uninstalling. (#5543, fixes #5542, @nojb)

  • coqdep now depends only on the filesystem layout of the .v files, and not on their contents (#5547, helps with #5100, @ejgallego)

  • The mdx stanza 0.2 can now be used with (implicit_transitive_deps false) (#5558, fixes #5499, @emillon)

  • Fix missing parenthesis in printing of corresponding terminal command for (with-outputs-to ) (#5551, fixes #5546, @Alizter)

On behalf of the ocamllsp team, I’m excited to announce the availability of version 1.11.0. This release is an important milestone for the project because it introduces integration with our favorite build system. When you run dune in watch mode, you will now be able to see build errors in the diagnostics panel of your editor. It’s all rather experimental for now, so your feedback and bug reports are appreciated.

As usual, the full change log is below.

Happy hacking.

See full changelog

Features

  • Add support for dune in watch mode. The lsp server will now display build errors in the diagnostics and offer promotion code actions.

  • Re-introduce ocamlformat-rpc (#599, fixes #495)

Fixes

  • Fix workspace symbols that could have a wrong path in some cases (#675)

Merlin 4.5

See full changelog
  • merlin binary
    • don't reset the environment when running merlin in single mode so that the parent environment is forwarded the the child processes (#1425)
    • filter dups in source paths (#1218)
    • improve load path performance (#1323)
    • fix handlink of ppx's under Windows (#1413)
    • locate: look for original source files before looking for preprocessed files (#1219 by @ddickstein, fixes #894)
    • handle = syntax in compiler flags (#1409)
    • expose all destruct exceptions in the api (#1437)
    • fix superfluous break in error reporting (#1432)
    • recognise binding operators in locate and occurrences (#1398, @mattiase)
    • remove dependency on Result (#1441, @kit-ty-kate)
    • use the new "shapes" generated by the compiler to perform precise jump-to-definition (#1431)
  • editor modes
    • fix an issue in Neovim where the current line jumps to the top of the window on repeated calls to MerlinTypeOf (#1433 by @ddickstein, fixes #1221)
    • add module, module type, and class imenu items for emacs (#1244, @ivg)
    • add prefix argument to force or prevent opening in a new buffer in locate command (#1426, @panglesd)
    • add type-on-hover functionality for vim (#1439, @nilsbecker)
    • add a dedicated buffer *merlin-errors* containing the last viewed error (#1414, @panglesd)
  • test suite
    • make merlin-wrapper create a default .merlin file only when there is no dune-project to let tests use dune ocaml-merlin reader. (#1425)
    • cover locate calls on module aliases with and without dune
    • Add a test expliciting the interaction between locate and Dune's generated source files (#1444)

Dune 3.0.3

See full changelog
  • Do not enable warnings 63-70 by default (#5476, fixes #5464, @rgrinberg)

  • Allow %{read-lines} to introduce dynamic dependencies like %{read}. (#5440, @anmonteiro)

  • Look up gmake before make (#5474, fixes #5470, @rgrinberg)

  • Handle empty output from getconf (#5473 fixes #5471, @mndrix)

  • Depend on any provided foreign_archives for ctypes stub generation (#5475, @mbacarella)

See full changelog

Bug fixes

  • Add missing parentheses around variant class arguments (#1967, @gpetiot)
  • Fix indentation of module binding RHS (#1969, @gpetiot)
  • Fix position of := when assignment-operator=end-line (#1985, @gpetiot)
  • Fix position of comments attached to constructor decl (#1986, @gpetiot)
  • Do not wrap docstrings, wrap-comments should only impact non-documentation comments, wrapping invalid docstrings would cause the whole file to not be formatted (#1988, @gpetiot)
  • Do not break between 2 module items when the first one has a comment attached on the same line. Only a comment on the next line should induce a break to make it clear to which element it is attached to (#1989, @gpetiot)
  • Preserve position of comments attached to the last node of a subtree (#1667, @gpetiot)
  • Do not override the values of the following non-formatting options when a profile is set: comment-check, disable, max-iters, ocaml-version, and quiet (#1995, @gpetiot).
  • Remove incorrect parentheses around polymorphic type constraint (#2002, @gpetiot)
  • Handle cases where an attribute is added to a bind expression, e.g. (x >>= (fun () -> ())) [@a] (#2013, @emillon)
  • Fix indentation of constraints of a package type pattern (#2025, @gpetiot)

Changes

  • More expressions are considered "simple" (not inducing a break e.g. as an argument of an application):
    • Variants with no argument (#1968, @gpetiot)
    • Empty or singleton arrays/lists (#1943, @gpetiot)
  • Print odoc code block delimiters on their own line (#1980, @gpetiot)
  • Make formatting of cons-list patterns consistent with cons-list expressions, (::) operators are aligned when possible, comments position also improved (#1983, @gpetiot)
  • Apply 'sequence-style' to add a space before ';;' between toplevel items, consistently with the formatting of ';' in sequences (#2004, @gpetiot)

New features

  • Format toplevel phrases and their output (#1941, @Julow, @gpetiot). This feature is enabled with the flag --parse-toplevel-phrases. Toplevel phrases are supported when they are located in doc-comments blocks and cinaps comments. Whole input files can also be formatted as toplevel phrases with the flag --repl-file.

RPC

  • ocamlformat-rpc-lib is now functorized over the IO (#1975, @gpetiot). Now handles Csexp.t types instead of Sexplib0.Sexp.t.
  • RPC v2 (#1935, @panglesd): Define a 'Format' command parameterized with optionnal arguments to set or override the config and path, to format in the style of a file.
  • Prevent RPC to crash on version mismatch with .ocamlformat (#2011, @panglesd, @Julow)
See full changelog

Fixed

  • Fix compatibility with Cmdliner 1.1.0. This also unfortunately means that the minimum OCaml version is 4.08 now. (#429, @NathanReb)

Dune 3.0.2

See full changelog
  • Fix compilation on MacOS SDK < 10.13. The native watch mode is disabled in such instances (#5431 fix #5430, @rgrinberg)

  • Do no add workspace_root to BUILD_PATH_PREFIX_MAP for projects before 3.0 (5448, @rgrinberg)

  • Fix performance regression in incremental builds (#5439, @snowleopard)

  • Fix digest computation bug introduced in 3.0.1 (#5451, @rgrinberg)

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