solvuu / phat

Strongly typed file path and file system operations.
ISC License
26 stars 4 forks source link

fix build system #16

Closed agarwal closed 8 years ago

agarwal commented 8 years ago

Our build doesn't succeed on initial invocations, so can't do a release with it as-is. Let's fix it. Perhaps replace with one based on ocamlbuild.

pveber commented 8 years ago

I have just pushed a simple build system based on ocamlbuild [0]. It is admittedly a lot less sophisticated than the one on master, as you have to give the list of modules for each library, does not generate .merlin nor META files. It does not handle install/uninstall either, so it really only compiles the code.

The addition is pretty simple and does not require much ocamlbuild hackery. What striked me first is that it's fast:

$ time ocamlbuild app/run_ounit_tests.native
Finished, 1 target (0 cached) in 00:00:00.
Finished, 36 targets (0 cached) in 00:00:07.

real    0m7.381s
user    0m5.864s
sys 0m1.088s

while:

$ time omake _build/app/run-ounit-tests.native 
*** omake: reading OMakefiles
*** omake: finished reading OMakefiles (3.03 sec)
*** omake: done (30.21 sec, 0/0 scans, 23/33 rules, 37/132 digests)                                                                                                           

real    0m30.218s
user    0m26.636s
sys 0m3.008s

I'm not sure what the reason is, but at least it is encouraging. 32354d13010d introduces compilation files for ocamlbuild, 5940ec99e5 shows how to compile m4 files. @agarwal how does it look to you?

[0] https://github.com/solvuu/phat/tree/ocamlbuild

agarwal commented 8 years ago

Let's do it. We can switch to ocamlbuild and add some files manually for now as needed. Please take note in this issue or a new one which things we lose, so we can remember to add them later.

pveber commented 8 years ago

Things lost or missing with this simple use of ocamlbuild

agarwal commented 8 years ago

Mostly done in 1cd0c86469bf5f187b36468e83c6b2f602007d9e, but still a little more to do.

agarwal commented 8 years ago

Everything mentioned above is done, except automatically deriving the mlpack file. I'll keep working on that, but it isn't an obstacle to doing a release.

agarwal commented 8 years ago

We now have a new ocamlbuild plugin that handles almost everything we want.