LWN.net Logo

KS2011: Afternoon topics

KS2011: Afternoon topics

Posted Oct 28, 2011 18:51 UTC (Fri) by anatolik (subscriber, #73797)
In reply to: KS2011: Afternoon topics by mathstuf
Parent article: KS2011: Afternoon topics

Most builds systems are work fine until you have a small project (less than 10K files), but all of them suck when the project grows. Basically all these build systems are not scalable.

I really like the idea of Tup build system http://github.com/gittup that stores graph into local sqlite database and reparses/rebuilds graph only when files are changed - this makes iterative development much more pleasant. Another cool feature is dependencies autodiscovering - under the hood it uses fuse (and fuse-like) library for that (this works on linux, macosx and windows). And the third feature that I like is "monitor" - inotify based daemon that updates graph of dependencies in background while you change files in your editor.

I made some experiments with my project (100K) and found that null build takes ~1.6 sec without monitor and 0.09 sec with monitor. Null build for my gmake based build system on the same project takes 42 secs (it parses makefiles files, builds graph of dependencies, scans files for modification, but does not run any commands).


(Log in to post comments)

KS2011: Afternoon topics

Posted Oct 28, 2011 20:13 UTC (Fri) by mathstuf (subscriber, #69389) [Link]

That actually looks to be close to what I'd like to see for the build system itself. The rules for "how to build" are declared in the top-level and then piped through later. It also appears to have very little in the way of hard-coded knowledge about C/C++ and extending it to also support things like latex pipelines, documentation builds, and more would be well-supported.

It doesn't support -B or -n make flags though. The percentage output is nice. However, it doesn't seem to support out-of-source builds (I sort of hacked bootstrap.sh to do the bootstrap successfully, but there's no further support to get a full build working). The code base looks clean, so maybe I can get a patch and convince the maintainer to accept out-of-source as an option.

KS2011: Afternoon topics

Posted Oct 28, 2011 20:38 UTC (Fri) by anatolik (subscriber, #73797) [Link]

> It doesn't support -B
One of the mottos of the project - "you'll never need to do clean build". Things like "clean" and -B are used in case if build is broken by incorrect dependency information (esp it happens often for recursive make). Tup provides "build consistency" - the output is always correct because dependencies are always correct.

> make -n
"tup todo"

> it doesn't seem to support out-of-source builds
AFAIK the tup author in favor of adding it. It is better to contact the maillist as I am not sure about his plans.

Oh, yeah, I remembered 4th thing that I like in tup - "buffered output". Output from commands is always printed atomically. No more interlaced output! The interlaced output is especially annoying if you have an error in one of widely used header files - this makes error messages really difficult to read.

KS2011: Afternoon topics

Posted Oct 28, 2011 21:00 UTC (Fri) by mathstuf (subscriber, #69389) [Link]

> One of the mottos of the project - "you'll never need to do clean build". Things like "clean" and -B are used in case if build is broken by incorrect dependency information (esp it happens often for recursive make). Tup provides "build consistency" - the output is always correct because dependencies are always correct.

So if I update a system library or header, it will relink the relevant parts? That's usually the corner case I've run into.

> AFAIK the tup author in favor of adding it. It is better to contact the maillist as I am not sure about his plans.

That's good.

> Oh, yeah, I remembered 4th thing that I like in tup - "buffered output". Output from commands is always printed atomically. No more interlaced output! The interlaced output is especially annoying if you have an error in one of widely used header files - this makes error messages really difficult to read.

I usually do `make -kj8` followed by `make` to do this, so this should help that. I rarely do parallel builds from vim however (<F8> is bound to "build", autodetecting CMake, make, pdflatex, cabal, rpmbuild, and a few others based on the current file) so interlaced output never really bothered me there.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds