Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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.
  • Loading branch information...
commit b937e62d890d8076391252555ed891bf8d4b5066 1 parent 660e26c
@apenwarr authored
Showing with 11 additions and 3 deletions.
  1. +5 −1 builder.py
  2. +5 −2 redo.py
  3. +1 −0  vars.py
View
6 builder.py
@@ -116,7 +116,7 @@ def main(targets, buildfunc):
def done(t, rv):
if rv:
- err('%s: exit code was %r\n' % (t, rv))
+ #err('%s: exit code was %r\n' % (t, rv))
retcode[0] = 1
for i in range(len(targets)):
@@ -127,6 +127,8 @@ def done(t, rv):
for t in targets:
jwack.get_token(t)
+ if retcode[0] and not vars.KEEP_GOING:
+ break
lock = state.Lock(t)
lock.trylock()
if not lock.owned:
@@ -139,6 +141,8 @@ def done(t, rv):
while locked or jwack.running():
jwack.wait_all()
+ if retcode[0] and not vars.KEEP_GOING:
+ break
if locked:
t = locked.pop(0)
lock = state.Lock(t)
View
7 redo.py
@@ -9,6 +9,7 @@
d,debug print dependency checks as they happen
v,verbose print commands as they are read from .do files (variables intact)
x,xtrace print commands as they are executed (variables expanded)
+k,keep-going keep going as long as possible even if some targets fail
shuffle randomize the build order to find dependency bugs
debug-locks print messages about file locking (useful for debugging)
"""
@@ -23,6 +24,8 @@
os.environ['REDO_VERBOSE'] = '1'
if opt.xtrace:
os.environ['REDO_XTRACE'] = '1'
+if opt.keep_going:
+ os.environ['REDO_KEEP_GOING'] = '1'
if opt.shuffle:
os.environ['REDO_SHUFFLE'] = '1'
if opt.debug_locks:
@@ -67,8 +70,8 @@
retcode = builder.main(targets, builder.build)
finally:
jwack.force_return_tokens()
- if retcode:
- err('exiting: %d\n' % retcode)
+ #if retcode:
+ # err('exiting: %d\n' % retcode)
sys.exit(retcode)
except KeyboardInterrupt:
sys.exit(200)
View
1  vars.py
@@ -8,6 +8,7 @@
DEBUG_LOCKS = os.environ.get('REDO_DEBUG_LOCKS', '') and 1 or 0
VERBOSE = os.environ.get('REDO_VERBOSE', '') and 1 or 0
XTRACE = os.environ.get('REDO_XTRACE', '') and 1 or 0
+KEEP_GOING = os.environ.get('REDO_KEEP_GOING', '') and 1 or 0
SHUFFLE = os.environ.get('REDO_SHUFFLE', '') and 1 or 0
STARTDIR = os.environ['REDO_STARTDIR']
BASE = os.environ['REDO_BASE']
Please sign in to comment.
Something went wrong with that request. Please try again.