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
Cstruct
module.
A newCstruct_sexp
module has been introduced with the serialiser
functions, contained within thecstruct-sexp
opam package.To convert old code, simply use
Cstruct_sexp.t
instead of
Cstruct.t
in a record type for which you are using[@@deriving sexp]
.
This is a type alias toCstruct.t
but also has the right
sexp-conversion functions in scope. There is an example of this
in theppx_test/with-sexp
directory 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