[Yhc] New Build System

Neil Mitchell ndmitchell at gmail.com
Fri Mar 2 23:49:16 EST 2007


Hi,

After hearing numerous complaints from lots of people about our build
system (esp Malcolm and Donald ;) ) - I took a look at the details. We
now have 1300 lines of Python in our build system, that seems like
quite a lot! The build system has evolved over time to keep up with
the users, but I was wondering if we'd have more success with
something written purely in Haskell.

It's not done yet, but I've pushed the first patch which has the basic
stuff done. I've made a couple of completely different decisions from
the scons method:

* All object files go under obj, clean is equal to deleting obj
* Use ghc --make, yhc make mode etc, where possible
* Everything should be able to be overiden, i.e. os=mac works just
fine on a windows box (great for cross compiling!)
* Everything is based on profiles, more on that once its done
* Compile C files with GHC everywhere (will this go wrong?)
* Install Haskell packages using Cabal
* No explicit library dependancies

It is not currently useable! The "Main configure" works and does the C
configure tests and searches for GHC etc. "Main push" works fine.
"Main yhc" will work if you have all the required packages
pre-installed by Cabal - likely to only be me - but it does work.

There are only 3 things left to do which might go wrong/take some time:

1) Download dependancies automatically and install them with Cabal.
Haskell's lack of a good wget/tar combo here may hurt us, but I'll see
what code I can find lying around.

2) Compile Yhi, which requires make-style knowledge about C. Scons had
this built in much more, I'll need to roll my own.

3) Compile the libraries. If this isn't trivially easy I'll extend Yhc
until it is.

So far I'm quite happy with it - it seems very flexible and very
modular. The disadvantage of moving to this (if it works) is that we'd
likely throw away some of the fixes we've made. The advantage is fewer
dependancies, and more people who know Haskell - provided the Haskell
stays simple and clean.

Anyone have any thoughts?

Thanks

Neil


More information about the Yhc mailing list