A headsup about a forthcoming backwards incompatible change to the cstruct 4.0.0 release. We’ve been reducing the required dependencies of the core Mirage libraries to make the ‘hello world’ unikernels as small as possible. As part of that, cstruct (along with its good friends ipaddr and uri) have moved sexplib into a separate optional module.
From the changes file:
-
Sexplib is now an optional library for the base
Cstructmodule.
A newCstruct_sexpmodule has been introduced with the serialiser
functions, contained within thecstruct-sexpopam package.To convert old code, simply use
Cstruct_sexp.tinstead of
Cstruct.tin a record type for which you are using[@@deriving sexp].
This is a type alias toCstruct.tbut also has the right
sexp-conversion functions in scope. There is an example of this
in theppx_test/with-sexpdirectory in the source repo.When you have converted and released your library, add an
opam constraint ofcstruct {>="4.0.0"}to your own opam
packages to ensure that they pick up this version of the library.
The opam repository PR with the full changeset is at : https://github.com/ocaml/opam-repository/pull/13748