Zarith icon indicating copy to clipboard operation
Zarith copied to clipboard

[build] [wip] Support for the dune build system v2

Open hhugo opened this issue 2 years ago • 3 comments

Continue the effort started in https://github.com/ocaml/Zarith/pull/73.

In particular, it tries to address the following comment

To get a more decisive opinion and be excited about this, it would help to see a complete dune-based build system with the configure phase working on all the platforms currently supported by the Makefile

It's rebased on top of the recently merged new CI jobs.

List of changes:

  • move sources in sub directories
    • src/ : source of zarith library
    • src/top/ : source of the toplevel printers
    • config/ : dune-configurator executable to compute flags used by the c compiler
  • The meta and opam file is now generated by dune
  • config/discover.ml replaces the configure script

hhugo avatar Jul 18 '23 14:07 hhugo

Is there anything else that needs to be done in this PR? It looks good to me.

rgrinberg avatar Oct 12 '23 18:10 rgrinberg

Is there anything else that needs to be done in this PR? It looks good to me.

First, the PR should not be marked Draft if you want me to look at it.

Second, I still don't understand what we have to gain by switching to a Dune build. This is a trivial project as far as OCaml sources are concerned, but it has a C side with non-trivial configuration and dependencies. That's precisely the kind of project where Dune does not shine. Why insisting on using Dune here?

xavierleroy avatar Nov 03 '23 18:11 xavierleroy

Second, I still don't understand what we have to gain by switching to a Dune build. This is a trivial project as far as OCaml sources are concerned, but it has a C side with non-trivial configuration and dependencies. That's precisely the kind of project where Dune does not shine. Why insisting on using Dune here?

Hi @xavierleroy , the main reason I wrote #73 was to be able to compose the build of Coq and ZArith.

This was essential in order to have a reasonable setup to track a zarith bug we were seeing in Coq more efficiently, but indeed, it may not be a common developer setup.

I guess the main feature ZArith users could benefit given a Dunerization would be build caching, when that is working for opam packages; some other minor features that are convenient are odoc support, dune-release support, hygienic builds, sound incremental builds, etc...

ejgallego avatar Sep 10 '24 17:09 ejgallego