[ocaml-platform] [Caml-list] Package compilation and debug mode

Daniel Bünzli daniel.buenzli at erratique.ch
Wed Mar 23 10:23:12 GMT 2016

Le mercredi, 23 mars 2016 à 11:02, Thomas Gazagnaire a écrit :

> > By default all my packages are released with -g disabled. It seems easy enough to have an opam switch (even the official one) that automatically enables the flag.
> How do you envision such a global debug flag? As far as I know, there is no configuration-time option to enable that option in the compiler (which would be the cleaner option IMHO). I'd rather avoid using OCAMLPARAM for this.

I don't know, I think a decent scheme should be figured out by the compiler dev team. It seems there's more than one way of doing this at the moment, see e.g.  

> A new opam variable can be created and used in the opam file to pass the debug command (or not) explicitly to the build system, but this will require adapting all the build systems (and ideally a new release of opam, but we can work-around that by setting OPAMVAR_debug in the .comp file).

I don't think this is a reasonable approach. Debug/profile seems rather a property of your switch than an individual package property. Though one could argue that this should still be added so that packages using other tools than the ocaml compilers can abide to the switch property.  


More information about the Platform mailing list