See full changelog
Fixed
- Undid the change to the pipe code to restore compatibility with Windows (#403, @MisterDA)
Official stable release announcements and updates from the OCaml compiler, OCaml infrastructure and the OCaml Platform Tools.
Normal syntax to Markdown to better explain what the syntax is
and moved it to Mdx.Syntax (#412, @Leonidas-from-XIV)part-end MDX directive in
the output, before that line would've been dropped (#374, #387,
@Leonidas-from-XIV)On behalf of the ocaml-lsp team, I’m pleased to announce ocaml-lsp-server versions 1.15.0-4.14 and 1.15.0-5.0 for OCaml 4.14 and 5.0, respectively. This is the first time we release ocaml-lsp supporting two compiler versions. We look forward to your feedback.
Enable semantic highlighting support by default (#933)
Support connecting over pipes and socket. Pipes on Windows aren't yet supported (#946)
More about communication channels in LSP specification.
Re-enable ocamlformat-rpc for formatting code snippets (but not files and
not on Windows) (#920, #939)
One needs to have installed either ocamlformat package version > 0.21.0 or,
otherwise, ocamlformat-rpc package. Note that previously ocamlformat-rpc
came in a standalone OPAM package, but since ocamlformat version > 0.21.0,
it comes within ocamlformat package.
Add custom ocamllsp/hoverExtended request (#561)
Support utf-8 position encoding clients (#919)
More about position encoding in LSP specification.
Show unwrapped module alias types on hovering over module names. This is due
to upgrading to merlin 4.7 and using merlin's verbosity=smart by default
(#942)
Respect the client's completion item resolve and preSelect capabilities (#925, #936)
Disable polling for dune's watch mode on Windows and OCaml 4.14.0 (#935)
Fix semantic highlighting of "long identifiers," e.g., Foo.Bar.x (#932)
Fix syncing of document contents:
@toplevel_printer annotated printers for functors (#378 @metavinek)We have the pleasure of celebrating the birthday of Oronce Finé by announcing the release of OCaml version 4.14.1.
This release is a collection of safe bug fixes, cherry-picked from the OCaml 5.0.0 release. If you were using OCaml 4.14.0 and cannot yet upgrade to OCaml 5, this release is for you.
The 4.14 branch is expected to receive more backported fixes during the maturation of OCaml 5. Thus don't hesitate to report any bugs on the OCaml issue tracker.
See the list of changes below for more details.
The base compiler can be installed as an opam switch with the following commands:
opam update
opam switch create 4.14.1
The source code for the release candidate is also directly available on:
ranlib on created / installed libraries
(Sébastien Hinderer and Xavier Leroy, review by the same)#11370, #11373: Don't pass CFLAGS to flexlink during configure. (David Allsopp, report by William Hu, review by Xavier Leroy and Sébastien Hinderer)
#11487: Thwart FMA test optimisation during configure (William Hu, review by David Allsopp and Sébastien Hinderer)
#10768, #11340: Fix typechecking regression when combining first class modules and GADTs. (Jacques Garrigue, report by François Thiré, review by Matthew Ryan)
#11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when calling virtual methods introduced by constraining the self type from within the class definition. (Nicolás Ojeda Bär, review by Leo White)
#11263, #11267: caml/{memory,misc}.h: Check whether _MSC_VER is defined
before using it to ensure that the headers can always be used in code which
turns on -Wundef (or equivalent).
(David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and
Sébastien Hinderer)
#11314, #11416: Fix non-informative error message for module inclusion (Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer)
#11358, #11379: Refactor the initialisation of bytecode threading, This avoids a "dangling pointer" warning of GCC 12.1. (Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer)
#11387: Module type with constraints no longer crash the compiler in presence
of both shadowing warnings and the -bin-annot compiler flag.
(Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer)
#11392, #11392: Assertion failure with -rectypes and external definitions
(Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)
#11417: Fix a regression which allowed virtual methods in non-virtual classes. (Leo White, review by Florian Angeletti)
#11468: Fix regression from #10186 (OCaml 4.13) detecting IPv6 on Windows for Mingw-w64 i686 port. (David Allsopp, review by Xavier Leroy and Sébastien Hinderer)
#11489, #11496: More prudent deallocation of alternate signal stack (Xavier Leroy, report by @rajdakin, review by Florian Angeletti)
#11516, #11524: Fix the deprecated_mutable attribute.
(Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti)
#11194, #11609: Fix inconsistent type variable names in "unbound type var" messages (Ulysse Gérard and Florian Angeletti, review Florian Angeletti and Gabriel Scherer)
#11622: Prevent stack overflow when printing a constructor or record mismatch error involving recursive types. (Florian Angeletti, review by Gabriel Scherer)
#11732: Ensure that types from packed modules are always generalised (Stephen Dolan and Leo White, review by Jacques Garrigue)
#11737: Fix segfault condition in Unix.stat under Windows in the presence of
multiple threads.
(Marc Lasson, Nicolás Ojeda Bär, review by Gabriel Scherer and David Allsopp)
#11776: Extend environment with functor parameters in strengthen_lazy.
(Chris Casinghino and Luke Maurer, review by Gabriel Scherer)
#11533, #11534: Follow synonyms again in #show_module_type
(this had stopped working in 4.14.0)
(Gabriel Scherer, review by Jacques Garrigue, report by Yaron Minsky)
#11768, #11788: Fix crash at start-up of bytecode programs in
no-naked-pointers mode caused by wrong initialisation of caml_global_data
(Xavier Leroy, report by Etienne Millon, review by Gabriel Scherer)
#11803, #11808: On x86, the destination of an integer comparison must be a register; it cannot be a stack slot. (Vincent Laviron, review by Xavier Leroy, report by Emilio Jesús Gallego Arias)
We have the pleasure of celebrating the birthdays of Jane Austen and Arthur C. Clarke by announcing the release of OCaml version 5.0.0.
The highlight of this new major version of OCaml is the long-awaited runtime support for shared memory parallelism and effect handlers.
This multicore support is the culmination of more than 8 years of effort, and required a full rewrite of the OCaml runtime environment. Consequently, OCaml 5.0.0 is expected to be a more experimental version of OCaml than the usual OCaml releases.
In this release, the native compiler only supports the x86-64 and arm64 architectures. In terms of operating systems, Linux, the BSDs, macOS and mingw64 on Windows are supported.
We are planning to restore the support for most previously supported architectures and operating systems, and address remaining known issues over the course of the next year.
Don't let those words of caution hinder your experimentation with OCaml 5: OCaml 5 as a language is fully compatible with OCaml 4 down to the performance characteristics of your programs. In other words, any code that works with OCaml 4 should work the same with OCaml 5.
The currently known exceptions to this rule are:
Please report any unexpected behaviours on the OCaml issue tracker and post any questions or comments you might have on our discussion forums.
During the maturing period for OCaml 5, the OCaml 4.14 branch will be maintained by backporting bug fixes from the OCaml 5 branch at regular intervals. The next release on the OCaml 4.14 branch, OCaml 4.14.1, should soon follow this release.
The full list of changes can be found in the changelog below.
The base compiler can be installed as an opam switch with the following commands:
opam update
opam switch create 5.0.0
It might be also interesting to check the new support for parallelism by installing the domainslib library with
opam install domainslib
The source code for the release candidate is also directly available on:
If you want to tweak the configuration of the compiler, you can switch to the option variant with:
opam update
opam switch create <switch_name> ocaml-variants.5.0.0+options <option_list>
where <option_list> is a comma-separated list of ocaml-option-* packages. For instance, for a flambda and no-flat-float-array switch:
opam switch create 5.0.0+flambda+nffa ocaml-variants.5.0.0+options ocaml-option-flambda ocaml-option-no-flat-float-array
The command line above is slightly more complicated for opam versions before 2.1:
opam update
opam switch create <switch_name> --packages=ocaml-variants.5.0.0+options,<option_list>
In both cases, all available options can be listed with opam search ocaml-option.
#11400: Runtime events counters fixes Fixes mismatch between OCaml and C APIs, removes events from 4.x that are not present in the 5.0 GC and adds some missing probes. (Sadiq Jaffer, review by Gabriel Scherer, Florian Angeletti)
#11368: Runtime events buffer size OCAMLRUNPARAMS fix The runtime events buffer size can now be set via the 'e' OCAMLRUNPARAM. This is previously mistakenly enabled/disabled tracing instead. (Sadiq Jaffer, review by KC Sivaramakrishnan, David Allsopp, Damien Doligez)
#11308: Add environment variable to preserve runtime_events after exit If the environment variable OCAML_RUNTIME_EVENTS_PRESERVE exists then the runtime will not remove the runtime events ring buffers at exit. This makes tracing very short running programs more reliable. (Sadiq Jaffer, review by KC Sivaramakrishnan)
#10964: Ring-buffer based runtime tracing (runtime_events) Runtime_events is a very low overhead runtime tracing system designed for continuous monitoring of OCaml applications. (Sadiq Jaffer, review by Anil Madhavapeddy, Enguerrand Decorne, Richard Warburton, Gabriel Scherer, Sabine Schmaltz, Florian Angeletti, Patrick Ferris, Tom Kelly)
(breaking change) #10723: do not use -flat-namespace linking for macOS.
(Carlo Cabrera, review by Damien Doligez)
(breaking change) #10863, #10933: Remove support for old, unprefixed C runtime function names
such as alloc. The new names prefixed with caml_ must be used instead,
such as caml_alloc. Consequently, it is no longer needed to define
CAML_NAME_SPACE to avoid bringing unprefixed names into scope: this is now
the default behavior.
(Nicolás Ojeda Bär, review by Xavier Leroy)
#10902: Do not register empty code fragments in natdynlink. (David Allsopp, review by Xavier Leroy and Damien Doligez)
#10965: caml_fatal_error_hook, GC timing hooks, and
caml_scan_roots_hook are now atomic variables. Restore GC timing
hooks in multicore.
(Guillaume Munch-Maccagnoni, review by Enguerrand Decorne, Xavier
Leroy, Gabriel Scherer, and KC Sivaramakrishnan)
#11209: Add a public and thread-safe timing hook running at domain
termination, after this domain has stopped running any OCaml code:
caml_domain_terminated_hook. This can be useful for implementing
domain-local state in C.
(Guillaume Munch-Maccagnoni, review by Xavier Leroy and Gabriel
Scherer)
#10875, #11731: Add option to allocate fiber stacks and sigaltstacks with mmap(MAP_STACK) instead of malloc. This is exposed via a configure --enable-mmap-map-stack option, and is enabled by default on OpenBSD where it is mandatory. (Anil Madhavapeddy, review by Gabriel Scherer, Tom Kelly, Michael Hendricks and KC Sivaramakrishnan).
#10950: Do not use mmap to allocate Caml_state. In order to reduce virtual memory usage, we dynamically allocate the domain_state structure. (Enguerrand Decorne, KC Sivaramakrishnan and Tom Kelly, review by Anil Madhavapeddy and Gabriel Scherer)
#11010: Use strerror_r for reentrant error string conversion. (Anil Madhavapeddy and Xavier Leroy, review by same and Edwin Török)
#11002, #11066, #11086: Do not use Begin_roots/End_roots macros in the runtime system. Also fix a missing root registration in the implementation of Unix.write on Windows. (Nicolás Ojeda Bär, Daniel Bünzli and Antonin Décimo, review by Xavier Leroy and David Allsopp)
#11022: Track GC work for all managed bigarray allocations (Stephen Dolan, report by Andrew Hunter, review by Damien Doligez)
#10802: Use 4.12 value macros and helpers in C code (Antonin Décimo, review by Gabriel Scherer)
#11105: Fix handling of fiber stack cache with multiple domains (Jon Ludlam, KC Sivaramakrishnan and Tom Kelly)
#11054: Respect user provided maximum stack space Make sure the stack we initially request is sized accordingly to the user provided settings. tmc/stack_space is also updated by this PR in order to account for this change. (Enguerrand Decorne, report by Jon Ludlam, review by Tom Kelly, KC Sivaramakrishnan and Gabriel Scherer)
#11238: Increase the default limit for the stack size to 128 Mi words, i.e. 1 Gib for 64-bit platforms and 512 Mib for 32-bit platforms. (Xavier Leroy, review by Sébastien Hinderer)
#10915, #11039, #11057, #11095, #11190: Implement quality treatment for
asynchronous actions in multicore. Reimplement the old behaviour of
caml_process_pending* for multicore.
(Guillaume Munch-Maccagnoni, review by Sadiq Jaffer and Gabriel Scherer)
#11303: Ensure that GC is not invoked from bounds check failures (Stephen Dolan, review by Sadiq Jaffer and Xavier Leroy)
#11304: Fix data race on Windows file descriptors (Olivier Nicole and Xavier Leroy, review by Xavier Leroy, David Allsopp, and Sadiq Jaffer)
&Field(v, i) now has type volatile value *
instead of value * in OCaml 4. This makes the memory model
for mixed OCaml/C code better defined, but can cause warnings or type
errors in user C code.
(KC Sivaramakrishnan, review by Xavier Leroy, Gabriel Scherer and
Guillaume Munch-Maccagnoni, additional discussions with Stephen
Dolan and Luc Maranget)#5299, #4787, #11138, #11272, #11506: To help debugging, Caml_state
now dynamically checks that the domain lock is held, and fails
otherwise (with a fatal error at most entry points of the C API, or
systematically in debug mode). A new variable Caml_state_opt is
introduced, and is NULL when the domain lock is not held. This
allows to test from C code if the current thread holds the lock of
its domain.
(Guillaume Munch-Maccagnoni, review by Florian Angeletti, Damien
Doligez, Sadiq Jaffer, Xavier Leroy, and Gabriel Scherer)
#11223: The serialization format of custom blocks changed in 4.08, but the deserializer would still support the pre-4.08 format. OCaml 5.x removed support for this old format; provide a clear error message in this case. (Hugo Heuzard, review by Gabriel Scherer)
#11504, #11522: Use static allocation in caml_make_float_vect in
no-flat-float-array mode, it's more efficient and avoids a a race condition
(Xavier Leroy, report by Guillaume Munch-Maccagnoni, review by David Allsopp)
#11652: Fix benign off-by-one error in Windows implementation of caml_mem_map. (David Allsopp, review by Gabriel Scherer)
#11669, #11704: Fix construction of Effect.Unhandled exceptions in the bytecode interpreter. (David Allsopp and Xavier Leroy, report by Samuel Hym, review by Xavier Leroy and Gabriel Scherer)
Random.State.split and Random.split to "split" a PRNG off
another PRNG.
(Xavier Leroy, review by Gabriel Scherer and Hugo Heuzard)(breaking change) #10867, #11345: Remove deprecated values: Array.create, Array.make_float, Array.create_matrix, Bytes.uppercase, Bytes.lowercase, Bytes.capitalize, Bytes.uncapitalize, Char.lowercase, Char.uppercase, Filename.temp_dir_name, Int32.format, Int64.format, Nativeint.format, Format.bprintf, Format.kprintf, Format.set_all_formatter_output_functions, Format.get_all_formatter_output_functions, Format.pp_set_all_formatter_output_functions, Format.pp_get_all_formatter_output_functions, Format.pp_open_tag, Format.pp_close_tag, Format.open_tag, Format.close_tag, Format.formatter_tag_functions, Format.pp_set_formatter_tag_functions, Format.pp_get_formatter_tag_functions, Format.set_formatter_tag_functions, Format.get_formatter_tag_functions, Gc (mutability of the fields of type Gc.control), Lazy.lazy_from_fun, Lazy.lazy_from_val, Lazy.lazy_is_val, Obj.set_tag, Obj.truncate, Obj.final_tag, Obj.extension_constructor, Obj.extension_name, Obj.extension_id, Scanf.stdib, Scanf.fscanf, Scanf.kfscanf, Stdlib.( & ), Stdlib.( or ), String.set, String.copy, String.fill, String.unsafe_set, String.unsafe_fill, String.uppercase, String.lowercase, String.capitalize, String.uncapitalize, Thread.kill, Thread.wait_write, Thread.wait_read, the whole ThreadUnix module, the infix operator (.[]<-). (Nicolás Ojeda Bär, review by Damien Doligez)
(breaking change) #10896: Remove Stream, Genlex and Pervasives. Also remove legacy standalone bigarray library (the Bigarray module is now part of the standard library). (Nicolás Ojeda Bär, review by Kate Deplaix and Anil Madhavapeddy)
Random.self_init
(Michael Hendricks, review by Gabriel Scherer, Xavier Leroy, and
Anil Madhavapeddy)Thread.exit() as raising the
exception Thread.Exit, and mark Thread.exit as deprecated.
The new implementation changes the behavior compared with
the OCaml 4 implementation. For example, the new implementation
causes Fun.finally finalizers to be run and catch-all exception
handlers to prevent termination.
(Jacques-Henri Jourdan and Xavier Leroy, review by Damien Doligez,
Guillaume Munch-Maccagnoni, Gabriel Scherer, and Enguerrand Decorne)#11034: Dynlink library, add a global lock to make dynlinking thread-safe. (Florian Angeletti, review by Gabriel Scherer)
#11087: deprecate Thread.wait_timed_read, Thread.wait_timed_write, Thread.select, Thread.wait_pid. The same functionality is available in the Unix module. (Nicolás Ojeda Bär, review by Anil Madhavapeddy)
#11309, #11424, #11427, #11545: Add Domain.recommended_domain_count. (Christiano Haesbaert, Konstantin Belousov, review by David Allsopp, KC Sivaramakrishnan, Gabriel Scherer, Nicolas Ojeda Bar)
#11461, #11466: Fix gethostbyaddr for IPv6 arguments and make it domain-safe (Olivier Nicole, Nicolás Ojeda Bär, David Allsopp and Xavier Leroy, review by the same)
#11479: Make Unix.symlink domain-safe on Windows (Olivier Nicole, review by Xavier Leroy and David Allsopp)
#11024: Handle alerts in ocamldoc.
The alert [@@alert deprecated] is handled specifically and it's no longer
needed to duplicate the deprecated annotation (the alert for the compiler and
the tag for the documentation). Every other alerts also appear in the
documentation.
(Jules Aguillon, review by Florian Angeletti)
#11065: Port the bytecode debugger to 5.0, adding support for effect handlers. (Damien Doligez and @fabbing, review by @fabbing and Xavier Leroy)
#11079: Add the -nobanners option to dumpobj. (Sébastien Hinderer, review by Gabriel Scherer and Vincent Laviron)
#11100: Fix ocamltest to make sure failed tests are not counted as "unexpected error". (Damien Doligez, review by Sébastien Hinderer)
#11245: Merge the common code of ocamlcp and ocamloptp into a single module. (David Allsopp, review by Sébastien Hinderer)
#11382: OCamlmktop use a new initialization module "OCamlmktop_init" to preserve backward-compatibility with user-module provided modules that install toplevel printers. (Florian Angeletti, review by Gabriel Scherer and David Allsopp)
#11058: runtime/HACKING.adoc tips on debugging the runtime (Gabriel Scherer, review by Enguerrand Decorne and Nicolás Ojeda Bär)
#11093: Add an effect handlers tutorial (KC Sivaramakrishnan, review by François Pottier, Gabriel Scherer, François Bobot and Wiktor Kuchta)
#11192: Better documentation for condition variables. (François Pottier, review by Luc Maranget, Xavier Leroy, and Wiktor Kuchta)
#11093: Add tutorials on parallelism features and the relaxed memory model (KC Sivaramakrishnan, review by Damien Doligez, Anil Madhavapeddy, Gabriel Scherer, Thomas Leonard, Tom Ridge, Xavier Leroy, Luc Maranget, Fabrice Buoro, Olivier Nicole, Guillaume Munch-Maccagnoni, Jacques-Henri Jourdan)
#11640: Add Flambda commonly-used options to the ocamlopt manpage (Amandine Nangah, review by David Allsopp, Florian Angeletti, Sébastien Hinderer, and Vincent Laviron)
#11676: Fix missing since annotation in the Sys and Format modules
(Github user Bukolab99, review by Florian Angeletti)
#11813: Make new multicore chapters easier to discover, and emphasize impact on C bindings. (Edwin Török, review by KC Sivaramakrishnan, and Florian Angeletti)
#9140, #11131: New command-line flag -nocwd to not include implicit the current directory to the load path. (Thomas Roglin, review by Gabriel Scherer and Nicolás Ojeda Bär)
#11089: Add 'since
#10909: Disable warning 59 (assignment to immutable blocks) unless flambda invariant checks are enabled. (Vincent Laviron, review by Gabriel Scherer)
#10981, #11276: Implement a -cmi-file option for ocamlc and ocamlopt. (Sébastien Hinderer, review by Damien Doligez, Daniel Bünzli and Florian Angeletti)
#11184, #11670: Stop calling ranlib on created / installed libraries (Sébastien Hinderer and Xavier Leroy, review by the same)
#11253: Deprecate ocaml script and ocamlnat script where script has no
extension and is an implicit basename.
(David Allsopp, review by Florian Angeletti and Sébastien Hinderer)
#10878, #10909: restore flambda after the Multicore merge. (Vincent Laviron, review by Gabriel Scherer and Xavier Leroy)
#10864, #10888: restore afl-fuzz mode for sequential programs. (Jan Midtgaard, review by Xavier Leroy and Gabriel Scherer)
#11008, #11047: rework GC statistics in the Multicore runtime (Gabriel Scherer, review by Enguerrand Decorne)
#11058: basic debugging documentation in runtime/HACKING.adoc (Gabriel Scherer, review by Enguerrand Decorne and Nicolás Ojeda Bär)
#11199: Stop installing topdirs.cmi twice. The toplevel now reads topdirs.cmi from +compiler-libs, as the debugger does. (David Allsopp, review by Sébastien Hinderer)
#11007, #11399: META files for the stdlib, compiler-libs and other libraries (unix, dynlink, str, runtime_events, threads, ocamldoc) are now installed along with the compiler. (David Allsopp, Florian Angeletti, Nicolás Ojeda Bär and Sébastien Hinderer, review by Daniel Bünzli, Kate Deplaix, Anil Madhavapeddy and Gabriel Scherer)
#11092: Build native-code compilers on OpenBSD/aarch64. (Christopher Zimmermann, review by Anil Madhavapeddy)
#11126: Build system: make it possible to choose which ocamldep (and flags) to use when computing dependencies for the compiler. Add a -no-slash option to ocamldep to let users override -slash. (Sébastien Hinderer, review by David Allsopp)
#11147: Factorize the stdlib-related compilation flags. Make it possible to control them consistently through the STDLIBFLAGS build variable. Make sure ocamldoc and ocamllex get compiled and linked with debugging information (-g). (Sébastien Hinderer, review by Gabriel Scherer)
#11149: Make the bootstrap process reproducible on systems with non-big-endian floating point. If the boot/ artefacts are up-to-date, this means that running make bootstrap on any platform should not change the images in boot/ and paves the way for automated testing that the bootstrap is repeatable. (David Allsopp, review by Damien Doligez and Sébastien Hinderer)
#11160: otherlibs: merge win32unix into unix. (Sébastien Hinderer, review by David Allsopp, Nicolás Ojeda Bär, Xavier Leroy, Vincent Laviron and Antonin Décimo)
-I +lib if required, but display an alert.
(David Allsopp, review by Florian Angeletti, Nicolás Ojeda Bär,
Valentin Gatien-Baron and Sébastien Hinderer)#11200: Install ocamlprof's Profiling runtime module to a +profiling, removing it from the default namespace. (David Allsopp, review by Sébastien Hinderer)
#11294: Switch minimum required autoconf to 2.71. (David Allsopp, review by Xavier Leroy)
#11370, #11373: Don't pass CFLAGS to flexlink during configure. (David Allsopp, report by William Hu, review by Xavier Leroy and Sébastien Hinderer)
#11487: Thwart FMA test optimization during configure (William Hu, review by David Allsopp and Sébastien Hinderer)
#11097: Build native-code compilers on NetBSD/aarch64 (Kate Deplaix, review by Anil Madhavapeddy)
#10768, #11340: Fix typechecking regression when combining first class modules and GADTs. (Jacques Garrigue, report by François Thiré, review by Matthew Ryan)
#10790: don't drop variance and injectivity annotations when pretty printing
with constraints (for example, with type +!'a t = ...).
(Florian Angeletti, report by Luke Maurer, review by Matthew Ryan and
Gabriel Scherer)
#11167: Fix memory leak from signal stack. (Antoni Żewierżejew, review by Gabriel Scherer and Enguerrand Decorne)
#11112: harden -use-runtime against spaces or quotes in the provided path (Gabriel Scherer, report by Brahima Dibassi, review by David Allsopp)
#11068, #11070: Fix typo in function name given in Unix_error exception for Unix.readlink on Windows. (David Allsopp, report by Xia Li-yao)
#10807: Don't duplicate standard handles in the child process spawned by win32unix Unix.create_process if the handles were already inheritable. Fix broken signalling of EOF on standard handles if they were already inheritable. (Antonin Décimo, review by Xavier Leroy and Nicolás Ojeda Bär)
#10868: Fix off-by-1 bug when initializing frame hashtables (Jonah Beckford, review by Tom Kelly, Nicolás Ojeda Bär and KC Sivaramakrishnan)
#11077: Make dumpobj compatible with absence of naked pointer support (Olivier Nicole and Jan Midtgaard, review by Gabriel Scherer)
#11111: fix fork() usage in ocamltest C code. When calling fork() from C code with the Multicore runtime active, one needs to call caml_atfork_hook() on the forked child before it can use the OCaml runtime. (Gabriel Scherer, review by Xavier Leroy, report by Brahima Dibassi)
#10809: Use the WSA_FLAG_NO_HANDLE_INHERIT on Windows when creating sockets with WSASocket if the cloexec (non-inheritable) parameter is true. Fixes a race condition where a child process could inherit the socket and deadlock the parent. (Antonin Décimo, review by Xavier Leroy)
#11194, #11609: Fix inconsistent type variable names in "unbound type var" messages (Ulysse Gérard and Florian Angeletti, review Florian Angeletti and Gabriel Scherer)
#11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when calling virtual methods introduced by constraining the self type from within the class definition. (Nicolás Ojeda Bär, review by Leo White)
#11263, #11267: caml/misc.h: check whether _MSC_VER is defined before using
it to ensure that the headers can always be used in code which turns on
-Wundef (or equivalent).
(David Allsopp and Nicolás Ojeda Bär, review by Nicolás Ojeda Bär and
Sébastien Hinderer)
#11289, #11405: fix some leaks on systhread termination (Fabrice Buoro, Enguerrand Decorne, Gabriel Scherer, review by Xavier Leroy and Florian Angeletti, report by Romain Beauxis)
#11314, #11416: fix non-informative error message for module inclusion (Florian Angeletti, report by Thierry Martinez, review by Gabriel Scherer)
#11358, #11379: Refactor the initialization of bytecode threading, This avoids a "dangling pointer" warning of GCC 12.1. (Xavier Leroy, report by Armaël Guéneau, review by Gabriel Scherer)
#11387, module type with constraints no longer crash the compiler in presence
of both shadowing warnings and the -bin-annot compiler flag.
(Florian Angeletti, report by Christophe Raffalli, review by Gabriel Scherer)
#11392, #11392: assertion failure with -rectypes and external definitions (Gabriel Scherer, review by Florian Angeletti, report by Dmitrii Kosarev)
#11417: Fix regression allowing virtual methods in non-virtual classes. (Leo White, review by Florian Angeletti)
#11468: Fix regression from #10186 (OCaml 4.13) detecting IPv6 on Windows for mingw-w64 i686 port. (David Allsopp, review by Xavier Leroy and Sébastien Hinderer)
#11482, #11542: Fix random crash in large closure allocation (Damien Doligez, report by Thierry Martinez and Vincent Laviron, review by Xavier Leroy)
#11508, #11509: make Bytes.escaped domain-safe (Christiano Haesbaert and Gabriel Scherer, review by Xavier Leroy, report by Jan Midtgaard and Tom Kelly)
#11516, #11524: Fix the deprecated_mutable attribute.
(Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti)
#11576: Fix bug in Bigarray.Genarray.init in the the case of zero-dimensional arrays. (Nicolás Ojeda Bär, Jeremy Yallop, report by Masayuki Takeda, review by Jeremy Yallop and Florian Angeletti)
#11587: Prevent integer comparison from being used on pointers (Vincent Laviron, review by Gabriel Scherer)
#11622: Prevent stack overflow when printing a constructor or record mismatch error involving recursive types. (Florian Angeletti, review by Gabriel Scherer)
#11662, #11673: fix a memory leak when using Dynlink, the bug was only present in development version of OCaml 5. (Stephen Dolan, report by Andre Maroneze, review by Gabriel Scherer)
#11732: Ensure that types from packed modules are always generalised (Stephen Dolan and Leo White, review by Jacques Garrigue)
#11737: Fix segfault condition in Unix.stat under Windows in the presence of multiple threads. (Marc Lasson, Nicolás Ojeda Bär, review by Gabriel Scherer and David Allsopp)
#11776: Extend environment with functor parameters in strengthen_lazy.
(Chris Casinghino and Luke Maurer, review by Gabriel Scherer)
#11533, #11534: follow synonyms again in #show_module_type (this had stopped working in 4.14.0) (Gabriel Scherer, review by Jacques Garrigue, report by Yaron Minsky)
Feedback on this post is welcomed on Discuss!
We are pleased to announce the minor release of opam 2.1.4.
This opam release consists of backported fixes:
dose3 >= 6.1 and base64 >= 3.1.0 are now required (#5357)Opam installation instructions (unchanged):
From binaries: run
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh) --version 2.1.4"
or download manually from the Github "Releases" page to your PATH. In this case, don't forget to run opam init --reinit -ni to enable sandboxing if you had version 2.0.0~rc manually installed or to update you sandbox script.
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.
We are pleased to announce the minor release of opam-publish 2.2.0.
This opam-publish release consists of the following breaking change:
and the following fixes:
Additions
--as-json for the HTML renderer that emits HTML
fragments (preamble, content) together with metadata (table of contents,
breadcrumbs, whether katex is used) in JSON format. (@sabine, #908){m ... } and {math ... } tags. (@giltho, @gpetiot, #886)Bugfixes
Oops, we went looking but didn't find the changelog for this release 🙈
(??) custom prefix operator.
(#1507, fixes #1506)enclosing command result (#1512)verbosity=smart mode for type enclosing that only expand
modules' types (#1374, @ulugbekna)enclosing command (#1512)Fix status line enabled when ANSI colors are forced. (#6503, @MisterDA)
Fix build with MSVC compiler (#6517, @nojb)
Do not shadow library interface modules (#6549, fixes #6545, @rgrinberg)
Dear dune users, It is my pleasure to announce that dune 3.6.0 is now available on opam 🎉. Here's the changelog - I reused the same classification as in the previous announce for dune 3.5.0. Thanks again to all the contributors including bug reporters.
This lists features of the “dune” executable itself. Upgrading dune will bring in these changes. We consider these changes safe, but it is difficult to define what a breaking change is for a command-line tool (for example, some error messages change). It is important to note that just upgrading the dune executable is not supposed to change how dune interprets existing projects. If just upgrading dune breaks compilation, it is a bug in dune, please report it!
$ dune ocaml top-module subcommand to load modules directly without sealing them behind the signature. (#5940, @rgrinberg)$ dune external-lib-deps under $ dune describe external-lib-deps. (#6045, @moyodiallo)dune promotion group: dune promote is moved to dune promotion apply (the former still works) and the new dune promotion diff command can be used to just display the promotion without applying it. (#6160, fixes #5368, @emillon)subdir (#6404, fixes #3502, @rgrinberg)CLICOLOR and CLICOLOR_FORCE to enable/disable/force ANSI colors. (#6340, fixes #6323, @MisterDA)._build/.rpc/dune on windows to allow rpc clients to connect using the build directory. (#6329, @rgrinberg)This lists changes if you opt into the new (lang dune 3.6) version in your dune-project file. For this too, these are changes that we consider safe, but they can require changes to your dune files. For example, sandboxing is enabled in more places, which means that you might have to be more precise in expressing your dependencies. Please reach out on the issue tracker if you have trouble fixing your dune file or if something does not seem to be possible anymore.
(glob_files <glob>) and (glob_files_rec <glob>) terms to the files field of the install stanza (#6250, closes #6018, @gridbugs)Byte_complete binaries to be installable (#4837, @AltGr, @rgrinberg):standard in the (modules) field of the coq.pp stanza (#6229, fixes #2414, @Alizter)(deps %{bin:...}) (#6326, @anmonteiro)(package ..) set from depending on private libraries that don't belong to a package (#6385, fixes #6153, @rgrinberg)pkg-config because we aren't tracking its external dependencies (#6052, @rgrinberg)Fix random requests failing after switching documents (#904, fixes #898)
Do not offer related diagnostic information unless the user enables in client capabilities (#905)
Do not offer diagnostic tags unless the client supports them (#909)
Do not attach extra data to diagnostics unless the client supports this (#910)
Use /bin/sh instead of /bin/bash. This fixes ocamllsp on NixOS
Fix various server crashes when opening non OCaml/Reason files. Files such as dune, cram, etc. would cause the server to crash. (#884, fixes #871)
Ignore unknown tags in merlin configuration to improve forward compatibility with Dune. (#883)
I'd like to announce the release of dune 3.5.0 on opam. This release is packed with fixes and new features, that are described below with a description of what this means for project maintainers.
This lists features of the "dune" executable itself. Upgrading dune will bring in these changes. We consider these changes safe, but it is difficult to define what a breaking change is for a command-line tool (for example, some error messages change). It is important to note that just upgrading the dune executable is not supposed to change how dune interprets existing projects. If just upgrading dune breaks compilation, it is a bug in dune, please report it!
clear-on-rebuild-and-flush-history (#6065, @rgrinberg)(license) (#6114,
fixes #6103, @emillon)(promote (until-clean)) when
--ignore-promoted-rules (or -p) is passed. (#6010, fixes #4401, @emillon)dune ocaml. (#6038, @emillon,
#6169, @shonfeder)This is technically a subset of above section. For M1 mac users, dune 3.5.0 is the first version which will correctly support dune-build-info.
This lists changes if you opt into the new (lang dune 3.5) version in your dune-project file. For this too, these are changes that we consider safe, but they can require changes to your dune files. For example, sandboxing is enabled in more places, which means that you might have to be more precise in expressing your dependencies. Please reach out on the issue tracker if you have trouble fixing your dune file or if something does not seem to be possible anymore.
runtime_deps field in the cinaps stanza to specify runtime
dependencies for running the cinaps preprocessing action (#6175, @rgrinberg)dirs field in the install stanza to install entire
directories (#5097, fixes #5059, @rgrinberg)(include <file>) term to the include_dirs field for adding
directories to the include paths sourced from a file. (#6058, fixes #3993,
@gridbugs)(extra_objects ...) field in (executable ...) and (library ...) stanzas (#6084, fixes #4129, @gridbugs)mode_specific_stubs that allows the
specification of different flags and sources for foreign stubs depending on
the build mode (#5649, @voodoos)Foo__ when building a library Foo (#6126, @rgrinberg)ODOC_SYNTAX and will rerun accordingly (#6010, fixes
#1117, @emillon)These changes, associated with (lang dune 3.5), are specific to coq.
%{coq:...} macro for accessing data about the configuration about Coq.
For instance %{coq:version} (#6049, @Alizter)(stdlib no).
(#6165 #6164, fixes #6163, @ejgallego @Alizter @LasseBlaauwbroek)Findlib).(coq.theory ...) stanza will now ensure that for each declared (plugin ...), the META file for it is built before calling coqdep. This enables
the use of the new Findlib-based loading method in Coq 8.16; however as of
Coq 8.16.0, Coq itself has some bugs preventing this to work yet. (#6167 ,
workarounds #5767, @ejgallego)On behalf of the ocamllsp team, I'm pleased to announce version 1.14.0. This release contains a new code action to help you inline definitions thanks to @jfeser. We look forward to your feedback.
Code action for inlining let bindings within a module or expression. (#847)
Tag "unused code" and "deprecated" warnings, allowing clients to better display them. (#848)
Refresh merlin configuration after every dune build in watch mode (#853)
Respect showDocument capabilities. Do not offer commands or code actions
that rely on this request without client support. (#836)
Fix signatureHelp on .mll files: avoid "Document.dune" exceptions
esequence right-associative. (#366, @ceastlund)Deriving.Generator (#368, @sim642).ml, .mli, etc.) (#795)On behalf of the dune team, I’m pleased to announce the release of version 3.4.0.
Bug fixes, a couple new features, better hints and error messages - I won't restate what's in the changelog below. Thanks to everyone involved in this release!
Make dune describe correctly handle overlapping implementations
for virtual libraries (#5971, fixes #5747, @esope)
Building the @check alias should make sure the libraries and executables
don't have dependency cycles (#5892, @rgrinberg)
[ctypes] Add support for the errno parameter using the errno_policy field
in the ctypes settings. (#5827, @droyo)
Fix dune coq top when it is invoked on files from a subdirectory of the
directory containing the associated stanza (#5784, fixes #5552, @ejgallego,
@rlepigre, @Alizter)
Fix hint when an invalid module name is found. (#5922, fixes #5273, @emillon)
The (cat) action now supports several files. (#5928, fixes #5795, @emillon)
Dune no longer uses shimmed META files for OCaml 5.x, solely using the ones
installed by the compiler. (#5916, @dra27)
Fix handling of the (deps) field in (test) stanzas when there is an
.expected file. (#5952, #5951, fixes #5950, @emillon)
Ignore insignificant filesystem events. This stops RPC in watch mode from
flashing errors on insignificant file system events such as changes in the
.git/ directory. (#5953, @rgrinberg)
Fix parsing more error messages emitted by the OCaml compiler. In particular, messages where the excerpt line number started with a blank character were skipped. (#5981, @rgrinberg)
env stanza: warn if some rules are ignored because they appear after a wildcard rule. (#5898, fixes #5886, @emillon)
On Windows, XDG_CACHE_HOME is taken to be the FOLDERID_InternetCache if
unset, and XDG_CONFIG_HOME and XDG_DATA_HOME are both taken to be
FOLDERID_LocalAppData if unset. (#5943, fixes #5808, @nojb)
odoc-parser.2.0.0 (#2123, @gpetiot)
odoc-parser{m ...} available in doc-comments{math ...} available in doc-commentsAllow cancellation of workspace symbols requests (#777)
Fix unintentionally interleaved jsonrpc IO that would corrupt the session (#786)
Ignore SIGPIPE . (#788)
Fix a bad interaction between inferred interfaces and promotion code actions in watch mode (#753)
Fix URI parsing (#739 fixes #471 and #459)
bench binary is not distributed anymore to avoid name collisions (#2104, @gpetiot)indicate-multiline-delimiters (#2116, @gpetiot).ocp-indent files (#2103, @gpetiot)max-indent = 2 (#2099, @gpetiot)| under keyword instead of parenthesis (#2102, @gpetiot)Oops, we went looking but didn't find the changelog for this release 🙈
lwt_logsAdditions
Bugs fixed
val x : #c) (@jonludlam, #809)merlin-lib package that exposes merlin's internals and the merlin
package with the frontend. (#1448, #1455, #1457, #1497, @rgrinberg,
@tmattio, @kit-ty-kate)Seq-based API of Yojson 2.0, avoiding the need for the
deprecated Stream module (#1475 by @Leonidas-from-XIV)MERLIN_LOG (#1480 by @ulugbekna)type-enclosing results (#1483, fixes #1477)core_type (#1484)merlin-locate optional, both for
consistency with Emacs convention and for backwards compatibility. (#1476,
@antalsz)Fix preprocessing, ppx, and reason support (#735 fixes #696, #706)
Support include in folding ranges (#730)
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)
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.
Code_path.enclosing_value (#349, @ceastlund)Code_path.enclosing_module (#346, @ceastlund)~enclose_intf and ~enclose_impl (#345, @ceastlund)--check: Allow toplevel_printer attributes (#340, @pitag-ha)result instead (#329, @panglesd)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.
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).
CHANGES:
--add-opam-provided and --opam-provided to beCHANGES:
--minimal-update flag to lock to generate a lockfilex-opam-monorepo-*lock CLI arguments in x-opam-monorepo-cli-args when generating acompact and sparse are now removed (#2075, @gpetiot)align-cases, align-constructors-decl and align-variants-decl are now removed (#2076, @gpetiot)disable-outside-detected-project is now removed (#2077, @gpetiot)$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)ocaml-version to a fixed version (4.04.0) by default to avoid reproducibility issues and surprising behaviours (#2064, @kit-ty-kate)--numeric=X-Y into --range=X-Y and --numeric (flag). For now --range can only be used with --numeric. (#2073, #2082, @gpetiot)(*= ... *) for verbatim comments (#2028, @gpetiot)--print-config displays a warning when an .ocamlformat file defines redundant options (already defined by a profile) (#2084, @gpetiot)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)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.
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)
CHANGES:
opam-provided packages into pin-depends and duniverseFix 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)
Fix bug with large buffers being resized incorrectly in Lev
Add folding ranges for more AST types (#680)