Rename redo-oob to redo-unlocked, to more accurately represent its use.

It's still undocumented.  Because you shouldn't run it by hand.  So don't!
It's dangerous!
This commit is contained in:
Avery Pennarun 2010-12-19 01:19:52 -08:00
commit db4c4fc17a
5 changed files with 22 additions and 13 deletions

View file

@ -77,7 +77,7 @@ class BuildJob:
if vars.NO_OOB or dirty == True: if vars.NO_OOB or dirty == True:
self._start_do() self._start_do()
else: else:
self._start_oob(dirty) self._start_unlocked(dirty)
def _start_do(self): def _start_do(self):
assert(self.lock.owned) assert(self.lock.owned)
@ -142,15 +142,18 @@ class BuildJob:
state.commit() state.commit()
jwack.start_job(t, self._do_subproc, self._after) jwack.start_job(t, self._do_subproc, self._after)
def _start_oob(self, dirty): def _start_unlocked(self, dirty):
# out-of-band redo of some sub-objects. This happens when we're not # out-of-band redo of some sub-objects. This happens when we're not
# quite sure if t needs to be built or not (because some children look # quite sure if t needs to be built or not (because some children
# dirty, but might turn out to be clean thanks to checksums). We have # look dirty, but might turn out to be clean thanks to checksums).
# to call redo-oob to figure it all out. # We have to call redo-unlocked to figure it all out.
# #
# Note: redo-oob will handle all the updating of sf, so we don't have # Note: redo-unlocked will handle all the updating of sf, so we
# to do it here, nor call _after1. # don't have to do it here, nor call _after1. However, we have to
argv = ['redo-oob', self.sf.name] + [d.name for d in dirty] # hold onto the lock because otherwise we would introduce a race
# condition; that's why it's called redo-unlocked, because it doesn't
# grab a lock.
argv = ['redo-unlocked', self.sf.name] + [d.name for d in dirty]
log('(%s)\n' % _nice(self.t)) log('(%s)\n' % _nice(self.t))
state.commit() state.commit()
def run(): def run():

View file

@ -29,8 +29,9 @@ done
python -mcompileall $LIBDIR python -mcompileall $LIBDIR
# binaries # binaries
for d in redo redo-ifchange redo-ifcreate redo-always redo-stamp redo-oob; do for dd in redo*.py; do
fix=$(echo $d | sed 's,-,_,g') d=$(basename $dd .py)
fix=$(echo $d | sed -e 's,-,_,g')
cat >install.wrapper <<-EOF cat >install.wrapper <<-EOF
#!/usr/bin/python #!/usr/bin/python
import sys, os; import sys, os;

View file

@ -1 +0,0 @@
redo-oob.py

1
redo-unlocked Symbolic link
View file

@ -0,0 +1 @@
redo-unlocked.py

View file

@ -15,14 +15,19 @@ for d in deps:
me = state.File(name=target) me = state.File(name=target)
# Build the known dependencies of our primary target. This *does* require
# grabbing locks.
os.environ['REDO_NO_OOB'] = '1' os.environ['REDO_NO_OOB'] = '1'
argv = ['redo-ifchange'] + deps argv = ['redo-ifchange'] + deps
rv = os.spawnvp(os.P_WAIT, argv[0], argv) rv = os.spawnvp(os.P_WAIT, argv[0], argv)
if rv: if rv:
sys.exit(rv) sys.exit(rv)
# we know our caller already owns the lock on target, so we don't have to # We know our caller already owns the lock on target, so we don't have to
# acquire another one. # acquire another one; tell redo-ifchange about that. Also, REDO_NO_OOB
# persists from up above, because we don't want to do OOB now either.
# (Actually it's most important for the primary target, since it's the one
# who initiated the OOB in the first place.)
os.environ['REDO_UNLOCKED'] = '1' os.environ['REDO_UNLOCKED'] = '1'
argv = ['redo-ifchange', target] argv = ['redo-ifchange', target]
rv = os.spawnvp(os.P_WAIT, argv[0], argv) rv = os.spawnvp(os.P_WAIT, argv[0], argv)