Commit graph

61 commits

Author SHA1 Message Date
Avery Pennarun
8d0eba9c44 builder.py: use os.exec() instead of subprocess.call().
This avoids a second fork altogether, which apparently doesn't matter all
that much (5.3s -> 5.15s).  However, simply not importing the subprocess
module reduces us further to 4.6s.

And 'ps axf' now looks prettier because we have fewer stupid intermediate
processes.
2010-11-22 00:15:29 -08:00
Avery Pennarun
dcc2edba0c builder.py: further refactoring to run more stuff in the parent process
instead of inside the fork.

Still doesn't seem to affect runtime.  Good.

One nice side effect is jwack.py no longer needs to know anything about our
locks.
2010-11-22 00:04:15 -08:00
Avery Pennarun
3209316856 builder.py: now the only exported function is main().
We can also avoid forking altogether if should_build() returns false.  This
doesn't seem to result in any noticeable speedup, but it's cleaner at least.
2010-11-21 23:36:29 -08:00
Avery Pennarun
547dbe550f builder.py: remove the build() wrapper function and BuildError.
The only thing we want to do on a build error is return a nonzero exit code,
so let's just do that, simplifying the code a bit.
2010-11-21 23:06:31 -08:00
Avery Pennarun
7aa7c41e38 builder,jwack: slight cleanup to token passing.
In rare cases, one process could end up holding onto more than one token.
2010-11-21 22:46:20 -08:00
Avery Pennarun
867402e803 Fixup the target name in "exit code: 1" lines. 2010-11-21 07:25:05 -08:00
Avery Pennarun
b937e62d89 Add a new -k (--keep-going) option, like make has.
Previously, the default was to *always* keep going, which is actually not
usually what you want.  Now we actually exit correctly after an error.  Of
course you still might have multiple errors before existing if you were
building in parallel.
2010-11-21 07:15:48 -08:00
Avery Pennarun
6b0da1fda0 Add a -x option that just passes -x to the subshell.
This is often more useful than -v, since it prints the actual commands being
executed, not just the lines being input from the script.
2010-11-21 06:36:15 -08:00
Avery Pennarun
03a054ca79 Add a --debug-locks option.
Get rid of the "locked..." and "...unlocked!" messages by default, since
they're not usually interesting.  But add a new option to bring them back in
case we end up with trouble debugging the locking stuff.  (I don't really
100% trust it yet, although I haven't had a problem for a while now.)
2010-11-21 06:23:41 -08:00
Avery Pennarun
f644f3bd04 Remove the need for relpath (and thus abspath) in builder.py. 2010-11-21 03:35:19 -08:00
Avery Pennarun
f7734c3b8d Split build functions into builder.py. 2010-11-19 07:32:04 -08:00