I did promise Lance that I would blog more on Bongo, and I’m going to try to stick to a post a week at least – however, this first one will only tangentially be about Bongo.

Since the project was initially released, the autotools build system was what you needed to create Bongo. There are a variety of benefits to using autotools, and it’s an extremely well-tested and mature system. However, it’s also relatively difficult to understand and not particularly quick. Over time we accreted more and more things into our build which no-one understood fully and that would occasionally blow up in our face.

Now, a little while ago I started a new branch of Bongo, called “memmgr-glib”. This was mainly to replace the memory allocator – maybe Pat can blog a bit more about this, but the short story is that this change has highlighted a variety of bugs in Bongo. The branch version of Bongo therefore seems extremely unstable – actually, it’s just a lot less bug-tolerant, which is overall a good thing – but we used that as a cue to make some other changes.

One of which was a switch from autotools to CMake as our build system. Just to give one really obvious stat:

autotools cmake
Configure 52 seconds 3 seconds
Initial compile 47 seconds 21 seconds
Install 1m 15 seconds(!) 2 seconds

Clearly, there is a big difference in each category: it must be said that the build systems aren’t doing quite the same things at this point, and I haven’t done these tests properly as benchmarks, but fundamentally the times are extremely different. I expect eventually that the compile time will even out – the difference will become minimal, and is already of the same order. Configure and install are clearly quicker though, and there aren’t any amazing short-cuts being taken on the cmake side.

The huge difference this makes for developers is the compile-test cycle. A re-compile with either system is basically pretty quick – something like a few seconds each. However, “make install” with both systems is quite different. To do a proper update, it’s much quicker with cmake, which means the testing cycle is really quick.

One other thing that is also big, for me at least: with CMake, we can finally do out-of-source builds. It’s possible with autotools, but our system never quite got it right. With CMake, you can check out Bongo from svn and then do something like ‘mkdir build/; cd build/; cmake ../; make’. The source we checked out isn’t touched, and nothing gets built in the source tree – it all happens in another directory. Not only does it feel cleaner, but it means that you’re not likely to commit any files which shouldn’t be there and if something goes wrong you can just nuke the build directory and start again easily.

I’ve yet to teach the bongo-build bot on IRC about this new system, but I expect that it will make building there a lot quicker too – mainly because it goes through the cycle above more than once (it configures twice, for example). It will be interesting to see what a difference it makes!