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.
This commit is contained in:
parent
660e26c276
commit
b937e62d89
3 changed files with 11 additions and 3 deletions
|
|
@ -116,7 +116,7 @@ def main(targets, buildfunc):
|
||||||
|
|
||||||
def done(t, rv):
|
def done(t, rv):
|
||||||
if rv:
|
if rv:
|
||||||
err('%s: exit code was %r\n' % (t, rv))
|
#err('%s: exit code was %r\n' % (t, rv))
|
||||||
retcode[0] = 1
|
retcode[0] = 1
|
||||||
|
|
||||||
for i in range(len(targets)):
|
for i in range(len(targets)):
|
||||||
|
|
@ -127,6 +127,8 @@ def main(targets, buildfunc):
|
||||||
|
|
||||||
for t in targets:
|
for t in targets:
|
||||||
jwack.get_token(t)
|
jwack.get_token(t)
|
||||||
|
if retcode[0] and not vars.KEEP_GOING:
|
||||||
|
break
|
||||||
lock = state.Lock(t)
|
lock = state.Lock(t)
|
||||||
lock.trylock()
|
lock.trylock()
|
||||||
if not lock.owned:
|
if not lock.owned:
|
||||||
|
|
@ -139,6 +141,8 @@ def main(targets, buildfunc):
|
||||||
|
|
||||||
while locked or jwack.running():
|
while locked or jwack.running():
|
||||||
jwack.wait_all()
|
jwack.wait_all()
|
||||||
|
if retcode[0] and not vars.KEEP_GOING:
|
||||||
|
break
|
||||||
if locked:
|
if locked:
|
||||||
t = locked.pop(0)
|
t = locked.pop(0)
|
||||||
lock = state.Lock(t)
|
lock = state.Lock(t)
|
||||||
|
|
|
||||||
7
redo.py
7
redo.py
|
|
@ -9,6 +9,7 @@ j,jobs= maximum number of jobs to build at once
|
||||||
d,debug print dependency checks as they happen
|
d,debug print dependency checks as they happen
|
||||||
v,verbose print commands as they are read from .do files (variables intact)
|
v,verbose print commands as they are read from .do files (variables intact)
|
||||||
x,xtrace print commands as they are executed (variables expanded)
|
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
|
shuffle randomize the build order to find dependency bugs
|
||||||
debug-locks print messages about file locking (useful for debugging)
|
debug-locks print messages about file locking (useful for debugging)
|
||||||
"""
|
"""
|
||||||
|
|
@ -23,6 +24,8 @@ if opt.verbose:
|
||||||
os.environ['REDO_VERBOSE'] = '1'
|
os.environ['REDO_VERBOSE'] = '1'
|
||||||
if opt.xtrace:
|
if opt.xtrace:
|
||||||
os.environ['REDO_XTRACE'] = '1'
|
os.environ['REDO_XTRACE'] = '1'
|
||||||
|
if opt.keep_going:
|
||||||
|
os.environ['REDO_KEEP_GOING'] = '1'
|
||||||
if opt.shuffle:
|
if opt.shuffle:
|
||||||
os.environ['REDO_SHUFFLE'] = '1'
|
os.environ['REDO_SHUFFLE'] = '1'
|
||||||
if opt.debug_locks:
|
if opt.debug_locks:
|
||||||
|
|
@ -67,8 +70,8 @@ try:
|
||||||
retcode = builder.main(targets, builder.build)
|
retcode = builder.main(targets, builder.build)
|
||||||
finally:
|
finally:
|
||||||
jwack.force_return_tokens()
|
jwack.force_return_tokens()
|
||||||
if retcode:
|
#if retcode:
|
||||||
err('exiting: %d\n' % retcode)
|
# err('exiting: %d\n' % retcode)
|
||||||
sys.exit(retcode)
|
sys.exit(retcode)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
sys.exit(200)
|
sys.exit(200)
|
||||||
|
|
|
||||||
1
vars.py
1
vars.py
|
|
@ -8,6 +8,7 @@ DEBUG = atoi.atoi(os.environ.get('REDO_DEBUG', ''))
|
||||||
DEBUG_LOCKS = os.environ.get('REDO_DEBUG_LOCKS', '') and 1 or 0
|
DEBUG_LOCKS = os.environ.get('REDO_DEBUG_LOCKS', '') and 1 or 0
|
||||||
VERBOSE = os.environ.get('REDO_VERBOSE', '') and 1 or 0
|
VERBOSE = os.environ.get('REDO_VERBOSE', '') and 1 or 0
|
||||||
XTRACE = os.environ.get('REDO_XTRACE', '') 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
|
SHUFFLE = os.environ.get('REDO_SHUFFLE', '') and 1 or 0
|
||||||
STARTDIR = os.environ['REDO_STARTDIR']
|
STARTDIR = os.environ['REDO_STARTDIR']
|
||||||
BASE = os.environ['REDO_BASE']
|
BASE = os.environ['REDO_BASE']
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue