Posts Tagged ‘build tool’

Why Tup build tool is great

I played with Tup build tool for a couple of weeks and I think that this is a really great build tool. And here is why:

  • It is god damn fast. Especially for incremental builds. With my 20K files project null build takes 6 millisecons. This differs from SCons –  for this size of project it will take an hour. Your build is not restricted by the build tool anymore.
  • Tupfile syntax is simple and very similar to make. Although I am not a big fan of make-like syntax in the most cases it is enough. Tup uses pretty much the same idea as make – “input files |> command |> output files”. It is easy to convert a build from make to Tup – in one day I converted 6 of my personal projects.
  • Tup provides strong build consistency. You can forget about “clean builds”. It does not matter from what state you started building your project – the final state is always the same. A detailed explanation you can find in this document page 8.
  • It is written in pure C. The code is clean and very readable. After just several hours of reading Tup sources I was able to understand its basics.

The main sell point is the speed of Tup and here is explanation why it is so fast:

  • Tup stores dependency graph in local database (sqlite), it means it does not need to reparse all Tupfiles on every run. Tup parses files only when they changed.
  • As tup has a disk storage it does not need to keep all graph in RAM. So its memory consumption is really low.
  • Tup has “file monitor” feature on some platforms. Monitor is an inotify daemon that listens all file changes. With it you don’t need to scan your project for changes every time you run build.
  • Tup finds nodes need to be rebuilt starting from leaves of the graph. It is a time saver in case of incremental builds as you need to visit only small part of the dependency graph.

Try this tool. I am sure you will love it!