OCaml Weekly News

Previous Week Up Next Week

Hello

Here is the latest OCaml Weekly News, for the week of October 29 to November 05, 2024.

Table of Contents

GPTar 1.0.0

Reynir Björnsson announced

I am pleased to announce GPTar 1.0.0!

GPTar is a small library to create a tartition table, that is, a tar archive that also contains a valid GUID partition table (GPT).

It exploits the fact that the important areas of a protective MBR in GPT and a tar header are mostly disjoint. The tar header fits almost exactly in the boot strap code of a master boot record (MBR) with the last 54 bytes of the tar header overlapping with the partition table of the (protective) MBR. Thakfully, those are the 54 last bytes of the 155 byte long NUL terminated "filename prefix" of the tar header. So as long as we put a NUL byte before the partition table tar will happily ignore the partition table data.

To further hide the actual GPT header & partition table from tar utilities the first tar header uses the GNU volume header extension with the GPT header & partition table as the "file contents". This makes GNU tar list the volume header but when extracting files the volume header is skipped. For released versions of bsdtar this unfortunately results in a "bad archive" error - however, the as-yet unreleased libarchive/bsdtar fixes this "bug" and allows for this abuse of volume headers (see the "update" blog post).

For more in depth details you may be interested in reading the following two blog articles:

Why!?

Great question. At Robur we developed an opam-mirror unikernel that acts as an opam repository and package source archive cache similar to https://opam.ocaml.org/. There we use tar as a filesystem for the package source archive cache. Later, we started using the end of the block device to cache data such as git state and computed package source archive checksums.

The neat feature is we could use regular old bsdtar or GNU tar in the host system to inspect the tar filesystem data. The downside was the lack of a partition table using offsets provided by boot arguments for where to find the cached data. With GPTar we can have both! Inspect the tar filesystem data while being more robust with a partition table.

Also, it was very fun to develop.

opam 2.3.0~rc1

Kate announced

We're happy to announce the first and hopefully only release candidate of opam 2.3.0.

This version does not have any significant change compared to the previous 2.3.0~beta2 release and we hope the final release to also have no significant change. Regardless, we invite users to test this version to make sure there isn't any regressions.

Unless a regression is spotted or another problem arises, we hope to have the final release of 2.3.0 out on the 12th of November.

Try it!

The upgrade instructions are pretty much the same:

For Unix systems

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

or from PowerShell for Windows systems

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

Please report any issues to the bug-tracker.

Call for Contributions: BOB 2025 (Berlin, March 14 - Deadline Nov 15)

Later in this thread, Michael Sperber announced

OCaml content is most welcome at BOB - send us your proposal!

First beta release for OCaml 5.3.0

octachron announced

One month and half after the release of the first alpha for OCaml 5.3.0, the release of OCaml 5.3.0 is drawing near.

The internal API of the compiler libraries has been frozen, and most core developer tools support (or will support soon) the new version of the compiler.

We have thus released a first beta version of OCaml 5.3.0 to help you update your software and libraries ahead of the release (see below for the installation instructions). More information about the whole release process is now available in the compiler repository.

Compared to the first alpha release, this beta contains a few runtime or typechecker fixes, a handful of fixes for the runtime event library and other miscellaneous fixes.

Exceptionally, this beta release also introduces a new flag `-keywords` for the compiler. This backward compatibility flag aims to help compiling old code that are using `effect` as a normal identifier, now that `effect` is a keyword in the new effect handler syntax.

The progresses on stabilising the ecosystem are tracked on the opam readiness for 5.3.0 meta-issue.

The full release is expected in the end of November or beginning of December, see the new prospective calendar for more information.

If you find any bugs, please report them on OCaml's issue tracker.

If you are interested in full list of features and bug fixes of the new OCaml version, the updated change log for OCaml 5.3.0 is available on GitHub and a short list of the changes since the last alpha is available below.

Installation Instructions

The base compiler can be installed as an opam switch with the following commands on opam 2.1 and later:

opam update
opam switch create 5.3.0~beta1

The source code for the beta is also available at these addresses:

  • Fine-Tuned Compiler Configuration

    If you want to tweak the configuration of the compiler, you can switch to the option variant with:

    opam update
    opam switch create <switch_name> ocaml-variants.5.3.0~beta1+options <option_list>
    

    where option_list is a space separated list of ocaml-option-* packages. For instance, for a flambda and no-flat-float-array switch:

    opam
    

    switch create 5.3.0~beta1+flambda+nffa ocaml-variants.5.3.0~beta1+options ocaml-option-flambda ocaml-option-no-flat-float-array

    All available options can be listed with opam search ocaml-option.

Changes since the first alpha

  • Runtime fixes
    • #13502: Fix misindexing related to Gc.finalise_last that could prevent finalisers from being run. (Nick Roberts, review by Mark Shinwell)
    • #13402, #13512, #13549, #13553: Revise bytecode implementation of callbacks so that it no longer produces dangling registered bytecode fragments. (Xavier Leroy, report by Jan Midtgaard, analysis by Stephen Dolan, review by Miod Vallat)
    • #13520: Fix compilation of native-code version of systhreads. Bytecode fields were being included in the thread descriptors. (David Allsopp, review by Sébastien Hinderer and Miod Vallat)
  • Typechecker fixes
    • #13579, #13583: Unsoundness involving non-injective types + gadts (Jacques Garrigue, report by @v-gb, review by Richard Eisenberg and Florian Angeletti)
    • #13388, #13540: raises an error message (and not an internal compiler error) when two local substitutions are incompatible (for instance module type S:=sig end type t:=(module S)) (Florian Angeletti, report by Nailen Matschke, review by Gabriel Scherer, and Leo White)
  • Compiler flag
    • #13471: add -keywords <version?+list> flag to define the list of keywords recognized by the lexer, for instance -keywords 5.2 disable the effect keyword. (Florian Angeletti, review by Gabriel Scherer)
  • Runtime event library fixes
    • #13419: Fix memory bugs in runtime events system. (B. Szilvasy and Nick Barnes, review by Miod Vallat, Nick Barnes, Tim McGilchrist, and Gabriel Scherer)
    • #13407: Add Runtime_events.EV_EMPTY_MINOR (Thomas Leonard)
    • #13522: Confirm runtime events ring is still active after callback. (KC Sivaramakrishnan, review by Sadiq Jaffer and Miod Vallat)
    • #13529: Do not write to event ring after going out of stw participant set. (KC Sivaramakrishnan, review by Sadiq Jaffer)
  • Documentation
    • #13424: Fix Gc.quick_stat documentation to clarify that returned fields live_words, live_blocks, free_words, and fragments are not zero. (Jan Midtgaard, review by Damien Doligez and KC Sivaramakrishnan)
    • #13440: Update documentation of Gc.{control,get,set} to reflect fields not currently supported on OCaml 5. (Jan Midtgaard, review by Gabriel Scherer)
    • #13469, #13474, #13535: Document that [Hashtbl.create n] creates a hash table with a default minimal size, even if [n] is very small or negative. (Antonin Décimo, Nick Bares, report by Nikolaus Huber and Jan Midtgaard, review by Florian Angeletti, Anil Madhavapeddy, Gabriel Scherer, and Miod Vallat)
  • Standard library internal fix
    • #13543: Remove some String-Bytes conversion from the stdlib to behave better with js_of_ocaml (Hugo Heuzard, review by Gabriel Scherer)
  • Toplevel fix
    • #13263, #13560: fix printing true and false in toplevel and error messages (no more unexpected #true) (Florian Angeletti, report by Samuel Vivien, review by Gabriel Scherer)
  • Compiler internals
    • #13391, #13551: fix a printing bug with -dsource when using raw literal inside a locally abstract type constraint (i.e. let f: type #for. ...) (Florian Angeletti, report by Nick Roberts, review by Richard Eisenberg)

dune 3.16

Etienne Marais announced

We have release 3.16.1. This is a minor release of Dune to correct a bug related to the C++ compile. It comes with the following changes:

3.16.1 (2024-10-30)

  • Fixed
    • Call the C++ compiler with -std=c++11 when using OCaml >= 5.0 (#10962, @kit-ty-kate)

Other OCaml News

Old CWN

If you happen to miss a CWN, you can send me a message and I'll mail it to you, or go take a look at the archive or the RSS feed of the archives.

If you also wish to receive it every week by mail, you may subscribe to the caml-list.