Zarith
Zarith copied to clipboard
[build] [wip] Support for the dune build system.
This is a preliminary draft PR for building zarith with dune; my motivation was to be able to compose zarith with other developments, so far seems to work well!
If developers like this, I could finish the TODO:
- configuration
- fix warnings
- run all tests
- opam generation?
- CI?
This needs rebasing. fact, fib and tak do not exist anymore.
is this planned to be rebased & merged & zarith to be released (with the very nice other changes that are so far only in trunk)? thanks.
I'd be happy to do more progress on this, once I get feedback from the developers as whether this would be considered.
I have no strong opinion. I think that the main complexity of the build system for Zarith lies in the configure script. The Makefile is rather simple, we have few files and directories. 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, as well as some incentive (what is the concrete benefit of switching to dune ?).
My Cryptokit library recently moved to using Dune: https://github.com/xavierleroy/cryptokit/pull/24 . On the one hand, the previous build system (based on Oasis) had issues, so Dune was an improvement. On the other hand, Dune's support for autoconfiguration is rather primitive, to the point that I'd rather stick with a handwritten configure shell script.
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, as well as some incentive (what is the concrete benefit of switching to dune ?).
My main motivation to write this was to be able to debug zarith and a client [in this case Coq] at the same time, with Dune you only need to drop zarith inside Coq's build scope and things work out of the box. This was very useful but don't expect to have a need for it again soon.
Dune also provides some other advantages and extra tooling such as documentation, dune-release, etc... YMMV.
On the other hand, Dune's support for autoconfiguration is rather primitive, to the point that I'd rather stick with a handwritten configure shell script.
I don't think that the configure script would be replaced, only adapted to output files that can be :include'd from dune's build rules.
I would also like to have it using dune + autoconf, like opam itself does it. It simplifies a lot when cross compiling zarith to other platforms.
FYI, I've rebased and updated this PR in https://github.com/hhugo/zarith/tree/dune.
- adding back most tests
- adapting the configure script to emit sexp files consumed by dune
(:include ...)stanza.
Great @hhugo , please feel free to take over / close this PR, it is unlikely I can put any cycles on this any time soon.
I have no strong opinion. I think that the main complexity of the build system for Zarith lies in the configure script. The Makefile is rather simple, we have few files and directories. 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, as well as some incentive (what is the concrete benefit of switching to dune ?).
I've updated https://github.com/hhugo/zarith/tree/dune to demonstrate what a near complete dune-based build system would look like for zarith.
Thanks a lot @hhugo , I'm closing this PR in favor of #143