thierry-martinez / stdcompat

Stdcompat: compatibility module for OCaml standard library
BSD 2-Clause "Simplified" License
31 stars 13 forks source link

Use dune as build system in the OPAM file #20

Closed Leonidas-from-XIV closed 2 years ago

Leonidas-from-XIV commented 2 years ago

Thanks Thierry for accepting and improving the dune port, your improvements to the targets are very sinsible. I've been contemplating how to make the build a bit simpler and not require giant dune files. One option could be to replace autotools (which, if I see correctly is mainly used for the compiler version switches, something that cppo should be able to do, without requiring users to have autotools installed) and then just call cppo directly.

For now this PR changes the build to use dune instead of the autotools based system. The advantage is that it allows to use the dune cache and be used with opam-monorepo out of the box.

Let me know what your thoughts are!

thierry-martinez commented 2 years ago

Merged. Thank you for your contributions to stdcompat! First versions of stdcompat use cppo instead, but I switched to autotools to remove a dependency: autotools are not really a dependency since once the configure file has been generated, it can be shipped with the release and the user does not need to have it to build stdcompat (and, indeed, the released tarballs ship the configure file). Moreover, autotools are a development dependency too for OCaml itself as far as I know; and cppo requires OCaml 4.02, whereas stdcompat tries to support OCaml versions from 3.07 (ok, it is perhaps not that useful to maintain such a scope of supported versions!).

However, relying on autotools or cppo only for preprocessing is somehow overkill: I would be in favor of an internal tool to make this preprocessing task instead. One of the difficulties is that this internal tool should be compilable with all supported versions of OCaml, and without preprocessing!