The Cstruct is a library to make handling “C-like” binary structures easier from within OCaml code. We use it fairly heavily within the MirageOS unikernel framework.

We have just released Cstruct 3.0 which significantly changes the ocamlfind packaging format, to make it easier to only depend on the specific library functionality that is needed. In older versions, there were multiple optional dependencies in the OPAM package that activated functionality such as Lwt, Async and PPX syntax extensions if the relevant support libraries were also installed. Since the advent of tools such as Jbuilder and Topkg, it is now easier for users to eliminate such implicit optional dependencies and turn them into explicit, separate OPAM packages instead.

OPAM repository PR#9154 did this for Cstruct and so we now have separate ocamlfind package for:

cstruct - basic library

- basic library cstruct-async - Core/Async cooperatively threaded library interface

- Core/Async cooperatively threaded library interface cstruct-lwt - cooperatively threaded Lwt library interface

- cooperatively threaded Lwt library interface cstruct-unix - synchronous Unix library interface

- synchronous Unix library interface ppx_cstruct - the PPX syntax extension

Transitional findlib packages with the old scheme are available, but now packages should migrate to using cstruct-async instead of cstruct.async for example. This has the added benefit of the OPAM package names now matching the findlib names.

If you spot any breakage related to this in OPAM, please drop me a note. It’s a large PR, but we’ve been doing extensive testing of reverse dependencies using DataKit-CI to hopefully avoid breakage in the stable package repository.

PS: This release also ports the build to use Jbuilder as well.