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

@ -95,7 +95,8 @@ def should_build(t):
f = state.File(name=t)
if f.is_failed():
raise builder.ImmediateReturn(32)
return dirty_deps(f, depth = '', max_changed = vars.RUNID)
dirty = dirty_deps(f, depth = '', max_changed = vars.RUNID)
return dirty==[f] and DIRTY or dirty
rv = 202