Add a --shuffle option to let you enable dependency randomization.
Previously, for testing, we were *always* randomizing the build order of dependencies. That's annoying since it'll make build logs differ randomly from one run to the next, which could make comparisons harder. However, the feature is still useful for uncovering hidden dependencies between objects.
This commit is contained in:
parent
93ab32d0f9
commit
b25e79f353
2 changed files with 6 additions and 1 deletions
6
redo.py
6
redo.py
|
|
@ -8,6 +8,7 @@ redo [targets...]
|
|||
j,jobs= maximum number of jobs to build at once
|
||||
d,debug print dependency checks as they happen
|
||||
v,verbose print commands as they are run
|
||||
shuffle randomize the build order to find dependency bugs
|
||||
"""
|
||||
o = options.Options('redo', optspec)
|
||||
(opt, flags, extra) = o.parse(sys.argv[1:])
|
||||
|
|
@ -18,6 +19,8 @@ if opt.debug:
|
|||
os.environ['REDO_DEBUG'] = '1'
|
||||
if opt.verbose:
|
||||
os.environ['REDO_VERBOSE'] = '1'
|
||||
if opt.shuffle:
|
||||
os.environ['REDO_SHUFFLE'] = '1'
|
||||
|
||||
if not os.environ.get('REDO_BASE', ''):
|
||||
base = os.path.commonprefix([os.path.abspath(os.path.dirname(t))
|
||||
|
|
@ -147,7 +150,8 @@ def main():
|
|||
retcode = 0
|
||||
locked = {}
|
||||
waits = {}
|
||||
random.shuffle(targets) # make it unpredictable for better testing
|
||||
if vars.SHUFFLE:
|
||||
random.shuffle(targets)
|
||||
for t in targets:
|
||||
if os.path.exists('%s/all.do' % t):
|
||||
# t is a directory, but it has a default target
|
||||
|
|
|
|||
1
vars.py
1
vars.py
|
|
@ -4,6 +4,7 @@ TARGET = os.environ.get('REDO_TARGET', '')
|
|||
DEPTH = os.environ.get('REDO_DEPTH', '')
|
||||
DEBUG = os.environ.get('REDO_DEBUG', '') and 1 or 0
|
||||
VERBOSE = os.environ.get('REDO_VERBOSE', '') and 1 or 0
|
||||
SHUFFLE = os.environ.get('REDO_SHUFFLE', '') and 1 or 0
|
||||
STARTDIR = os.environ.get('REDO_STARTDIR', '')
|
||||
BASE = os.environ.get('REDO_BASE', '')
|
||||
if BASE:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue