ocaml.org
ocaml.org copied to clipboard
Build on OCaml 5 (ocamlnet -safe-string workaround)
With this PR, it is possible to build and run OCaml.org on OCaml 5 with
make deps
make start
The build was failing due to problems with a configuration script in ocamlnet, a transitive dependency of OCaml.org, through package River. For details on the problem in ocamlnet, see https://github.com/aantron/ocamlnet/commit/7ef255a0a994ef2721f3359077b36bcdd0428ee4:
Work around broken
HAVE_BYTESdetection
configureusesocamlc -safe-stringto determine whether the compiler has thebytestype. However, on OCaml 5, this command, without input files, exits with a non-zero exit code and printsNo input files. This causesconfigureto wrongly believe that-safe-stringis not supported, which then triggers a multitude of compilation errors.This commit (in ocamlnet) changes the code to unconditionally assume that
bytesis available. A better way is probably to adapt OASIS, or what generated theconfigurescript.
The code in ocamlnet's configure script is here. cc @gerdstolpmann
This PR pins ocamlnet to a fork with the above workaround, until ocamlnet is fixed upstream and released. See the OCaml 5 compatibility MR in ocamlnet.
This PR points package ocamlnet to my own fork on GitHub, which could become a problem for git bisect or other purposes in the future, if the fork were to become inaccessible. However, I see that OCaml.org already has dependencies pointed to other repos, so perhaps this is fine. Please let me know if you'd like me to put the ocamlnet patch somewhere else.