Certain redo post-build failures would still mark a target as built.
If we failed because: - target dir doesn't exist - failed to copy from stdout - failed to rename $3 We would correctly return error 209, but the target would still be marked as having been built, so redo-ifchange would not try to build it next time, beause we forgot to call sf.set_failed() in those cases. minimal/do worked correctly. Added a test to catch this in the future.
This commit is contained in:
parent
8a0effa5b3
commit
8100aa4973
6 changed files with 29 additions and 1 deletions
|
|
@ -419,7 +419,8 @@ class _BuildJob(object):
|
|||
sf.csum = None
|
||||
sf.update_stamp()
|
||||
sf.set_changed()
|
||||
else:
|
||||
# rv might have changed up above
|
||||
if rv:
|
||||
helpers.unlink(self.tmpname)
|
||||
sf = self.sf
|
||||
sf.set_failed()
|
||||
|
|
|
|||
1
t/122-defaults-parent/.gitignore
vendored
Normal file
1
t/122-defaults-parent/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/*.log
|
||||
22
t/122-defaults-parent/all.do
Normal file
22
t/122-defaults-parent/all.do
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
rm -f x/shouldfail
|
||||
|
||||
log=$PWD/$1.log
|
||||
rm -f "$log"
|
||||
|
||||
expect_fail() {
|
||||
local rv=$1
|
||||
shift
|
||||
if ("$@") >>$log 2>&1; then
|
||||
cat "$log" >&2
|
||||
echo "unexpected success:" "$@" >&2
|
||||
return $rv
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
cd inner
|
||||
expect_fail 11 redo ../x/shouldfail # should fail
|
||||
expect_fail 12 redo-ifchange ../x/shouldfail # should fail again
|
||||
|
||||
exit 0
|
||||
2
t/122-defaults-parent/clean.do
Normal file
2
t/122-defaults-parent/clean.do
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
rm -f *~ .*~ */*~ */.*~ *.tmp */*.tmp x/shouldfail *.log */*.log
|
||||
|
||||
2
t/122-defaults-parent/inner/default.do
Normal file
2
t/122-defaults-parent/inner/default.do
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
echo "inner/default.do: PWD=$PWD '$1' '$2' '$3'" >&2
|
||||
echo SUSPICIOUS
|
||||
0
t/122-defaults-parent/x/file
Normal file
0
t/122-defaults-parent/x/file
Normal file
Loading…
Add table
Add a link
Reference in a new issue