Option DEF_OPT breaks some camlp4-based builds

Issue #9 resolved
Anil Madhavapeddy created an issue

The DEF_OPT patch that swaps out camlp4o.opt with camlp4o breaks a lot of OCaml builds, since camlp4 dynamically loads in syntax extension modules that are different in bytecode (.cma) and native code (.cmxs).

It would be safer to remove camlp4 from the MODOPT substitution list, or remove the entire option. Most build systems will look for the .opt version of the compiler these days anyway (such as OASIS).

I've had at least one user report a failure that turned out to be due to DEF_OPT; https://github.com/ocaml/opam/issues/1044

Comments (5)

  1. Michael Grünewald repo owner

    Hi Anil,

    Thank you for your report!

    I inherited the DEF_OPT option as I overtook lang/ocaml and I second you thinking that the choice of the compiler to use should be made by the build system, not by the package installation!

    There should not be any hard regression for the user forced to switch back from opt-compilers to the standard ones, so I will phase out the option and add a notice to UPDATING.

    I also opened a PR on FreeBSD's Gnats to track this issue.

    Reference: ports/189176

  2. Anil Madhavapeddy reporter

    Thanks Michael! (and great work on the port -- I'm currently in the throes of separating out the bytecode and native code compilers on the OpenBSD package, which is no fun :-)

  3. Michael Grünewald repo owner

    The build system used to produce the OCaml compiler suite is not very pleasant to work with, to say the least! It would be great to us, maintainers, if someone could improve it!

    Have fun — despite the throes!

  4. Michael Grünewald repo owner

    Remove OPT_DEF option

    The choice of using the optimised compiler should be left to the build system used by each individual OCaml project and not be enforced by the package installation.

    Closes #9

    → <<cset ca5b1bb2e0d4>>

  5. Log in to comment