Fix a deadlock with redo-oob.

If a checksummed target A used to exist but is now missing, and we tried to
redo-ifchange that exact file, we would unnecessarily run 'redo-oob A A';
that is, we have to build A in order to determine if A needs to be built.

The sub-targets of redo-oob aren't run with REDO_UNLOCKED, so this would
deadlock instantly.

Add an assertion to redo-oob to ensure we never try to redo-ifchange the
primary target (thus converting the deadlock into an exception).  And skip
doing redo-oob when the target is already the same as the thing we have to
check.
This commit is contained in:
Avery Pennarun 2010-12-11 06:16:32 -08:00
commit 1d26d99e0c
4 changed files with 12 additions and 1 deletions

View file

@ -10,6 +10,9 @@ if len(sys.argv[1:]) < 2:
target = sys.argv[1]
deps = sys.argv[2:]
for d in deps:
assert(d != target)
me = state.File(name=target)
os.environ['REDO_NO_OOB'] = '1'