Monday, September 28, 2009

Moldy software build systems

James Hague points out that many software build systems are baroque, and used infrequently enough that only the truly hardcore ever become competent:

I'm pretty sure there's a standard old build system to do this kind of thing, but in a clunky way where you have to be careful whether you use spaces or tabs, remember arcane bits of syntax, remember what rules and macros are built-in, remember tricks involved in building nested projects, remember the differences between the versions that have gone down their own evolutionary paths. I use it rarely enough that I forget all of these details. There are modern variants, too, that trade all of that 1970s-era fiddling for different lists of things to remember. ...

Not to mention properly quoting pathnames that have spaces in them. Especially if there are wildcards involved.

But there's no need. ... It's easier and faster to put together custom, micro-build systems in the high-level language of your choice.

Hear, hear!

Lately I have been using ANTLR—a parser generator—to make a compiler for a new programming language. (Everybody needs their own programming language!) It appears to be a wonderful package ... but the build system uses Apache Maven.

Oh. Dear.

Somebody noticed that obtaining the prerequisites was a lot of work when building open source projects. Apparently that somebody decided to tackle the challenge by integrating the dependency tracker, package manager, and download tool into the build manager.

However, if you are operating under a restricted environment or behind a firewall, you might need to prepare to run Maven, as it requires write access to the home directory (~/.m2 on Unix/Mac OS X and C:\Documents and Settings\username\.m2 on Windows) and network access to download binary dependencies.

That's certainly reassuring. The build control file is written in XML:

<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                      http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.codehaus.mojo</groupId>
  <artifactId>my-project</artifactId>
  <version>1.0</version>
</project>

As a wise man once said, "As God is my witness, I thought turkeys could fly."

Update: fixed XML. And title. And fixed the XML again. This time for sure. No, this time for sure.


Comments:
For 20+ years I've been building software and it really hasn't changed that much in that time.

We just switched our multi-platform (Unix, Linux, OS X, Windows) build system to cmake from Qt's qmake. To speed it up we also use a parallel build server (icecream).
 
Post a Comment

Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?