Print a better message when detecting pre-existing cyclic dependencies.
We already printed an error at build time, but added the broken dependency anyway. If the .do script decided to succeed despite redo-ifchange aborting, the target would be successfully created and we'd end up with an infinite loop when running isdirty() later. The result was still "correct", because python helpfully aborted the infinite loop after the recursion got too deep. But let's explicitly detect it and print a better error message. (Thanks to Nils Dagsson Moskopp's redo-testcases repo for exposing this problem. If you put a #!/bin/sh header on your .do script means you need to run 'set -e' yourself if you want .do scripts to abort after an error, which you almost always do, and those testcases don't, which exposed this bug if you ran the tests twice.)
This commit is contained in:
parent
d143cca7da
commit
711b05766f
5 changed files with 17 additions and 3 deletions
2
state.py
2
state.py
|
|
@ -365,7 +365,7 @@ class Lock:
|
|||
assert(not self.owned)
|
||||
if str(self.fid) in vars.get_locks():
|
||||
# Lock already held by parent: cyclic dependence
|
||||
raise CyclicDependencyError
|
||||
raise CyclicDependencyError()
|
||||
fcntl.lockf(self.lockfile, fcntl.LOCK_EX, 0, 0)
|
||||
self.owned = True
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue