OCaml 5.1.1 : incoming breaking change in the `Marshal` module

Some time after the release of OCaml 5.1.0, we discovered that there in a packaging bug in the 5.1.0 compiler distribution: the new support for compressed compiler artefacts in the compiler made all OCaml executable program depends on the zstdlib library (if compression support was enabled).

There is already an opam configuration option -ocaml-option-no-compression to disable this support and this dependency.

Nevertheless, having a compiler dependency affects all OCaml end-users is far from ideal. Thus we have been trying to find alternatives to remove this dependency. Unfortunately, our current conclusion is that there are no robust and OS-independent solutions to remove this dependency in end-user programs while preserving the current Marshal api with its new Compression flag.

Therefore, we are currently planning to remove this flag in the upcoming 5.1.1 patch release. The compiler will still support compression using an internal library, but the standard library will be free from any dependency on zstdlib. Support for compressed marshalling might be proposed in a separate library at a later point.

This means that there will a breaking change in a patch release, but this breach of policy seemed a better option than leaving a disabled flag in a single version of the Marshall api.

If we have any comments on this unfortunate solution, I am all ears .

16 Likes