Skip to content

OCaml 4.14.0 compatibility

Kim Nguyễn requested to merge ocaml-compat-refactor into dev

This MR adds compatibility with OCaml 4.14.0. It performs three main changes :

  1. 779e3185 changes the way the compatibility layer with various version of OCaml is compiled. Prior to this commit, we used to have mlcompat_407.ml, mlcompat_408_9.ml, …, mlcompat_413.ml for all supported version. Each contained the same set of 20 or so compatibility functions acting as proxies for the compiler libs functions (whose signature had changed between version). This was an unholy mess as e.g. a could change say between OCaml 4.10 and 4.11 and we would have 3 copies of each version of the function (4.07, 4.08/9 and 4.10 on one hand, and 4.11, 4.12, 4.13 on the other hand). With this change, we have a single file, mlcompat.cpp.ml where bits are optionally compiled with cpp (the C preprocessor). This is not entirely satisfactory, since it adds a silent dependency on cpp (there is no conf-cpp in opam) but since a cc compiler is mandatory for opam this is not too bad. The alternatives are not great :
  • cppo makes ocamlformat/merlin choke since it's not OCaml syntax
  • ppx_optcomp almost fits the bill but introduce a build dependency on janestreet some libraries (base and stdio)
  1. 16a27f7c implements the compatibility with OCaml 4.14 proper. It silences the deprecation warnings around uses of the Stream module and fixes two new incompatibilities in the CDuce-OCaml interface
  2. 3c9a3169 adds 4.14.0 to the CI.

Merge request reports