The quest for build systems

02 Apr 2006

Ahh, at last I found a permanent place to stay here in Barcelona. The prices for renting flats here are rather high. I guess one reason is that people expect to have no more than a 15 minute walk to work. Well, now I found a flat with a 15 minute walk to work. Nice to have that off my mind.

The new company is an interesting place, as it is a small growing company with talented people. I'm working on a new project, and this means investingating new technology, techniques and methodologies. I've spent some time figuring out what build system to use. This article by Noel LLopis gave some good information.

First I gave Jam a quick try, but got the feeling that it's a bit too "clever" and complicated, at least when after reading 10-15 pages of documentation, I still didn't know how to do the relatively simple things I wanted to do with it. (This is a common problem with documentation, especially in open source projects. The writers are so enamoured with their technology that they want to describe every single detail of it, instead of just explaining how to use it. The JBoss books come to mind, explaining esoteric inner workings of the server in the early chapters where they should concentrate on more basic stuff, like how to configure the server to actually get it running in the first place.

I also looked at SCons, which seemed simple to learn since the build scripts are Python programs. It also has good documentation and some clever and useful solutions. Unfortunately it has a problem in common with Jam: While it seems to be very good for building the same code using different supported compilers, it becomes more complicated when you need to use it for building on an unsupported compiler or toolset.

In the end I thought, "better the devil you know", and settled for Ant. The problem I've had with Ant is that XML is an inconvenient format for the build scripts. Also, while Ant has a good collection of useful build tasks, when you need to do something it doesn't support it is suddenly not so simple anymore. The old solution was to write new tasks in Java, or executing external scripts. Both are a bit awkward. Newer versions of Ant has scripting support which I haven't tried. Perhaps the solution is to embed Python code in the Ant scripts, and let that code perform the tasks that Ant can't perform with its standard set of tasks. One thing I might add this way is depency checking for C++ source files, so that the C++ file is recompiled if any header file it depends on has been changed. This is really a requirement for C++ development.

But now I'll go out to get some afternoon sun. See you!

blog comments powered by Disqus