Announcing the gup build tool
gup
is a software build tool. It is designed to be general purpose, and does not care:
- what kind of project you are building
- what language you are building
- what language you write your build scripts in
It has (almost) no syntax, instead it defines a simple protocol for where build scripts are located. Instead of declaring dependencies up-front, build scripts declare dependencies as they use them. This allows your dependencies to be enumerated at runtime, while building, rather than existing in some separate, statically-declared list which has to be manually updated if you wish your build to Not Be Wrong.
It’s similar to djb’s redo
, which has been implemented by Avery Pennarun. In fact, I even took a bunch of code from redo
. If you’ve used it before, gup
will seem pretty familiar.
Please check out the project on github
for more details and documentation. It’s still young, and it may change. But I’ve been using it for both work and person projects for a few months now, and it’s already proven much more solid than redo
in my own usage.
Why didn’t I just help make redo
better?
I tried, but I believe redo's
design is impossible (or at least very difficult) to implement in a way that does not Do The Wrong Thing silently (and somewhat often). That is absolutely not a property I want from my build system.
The core problem springs from the fact that redo
relies on local file state to determine whether a file is actually a target. The only difference between a build target and a source file is that a target is one which didn’t exist when you first tried to build it - i.e if something looks like a target but it already exists, then it is actually a source, and will never be built.
There is quite a bit of state locked up in the above definition, and it turns out that it’s perilously difficult to manage that state correctly. The end result in many cases is that redo
thinks a built file is actually a source file, and it silently ignores all requests to build it1. Remedying this situation is manual - it cannot easily be scripted, and the actions required depend entirely on the state of the local workspace.
gup
fixes this problem by requiring you to be more explicit about your targets. In gup
, something is a target if (and only if) you’ve told gup
how to build it. It also means that the set of targets is defined by the part of your project that’s tracked by source control, rather than the state of your local filesystem.
-
When updating from Fedora 19 -> 20 recently, this happened to every single file
redo
had ever built. This may not beredo
’s fault, but it shows how fragile the mechanism is. ↩