If a checksummed file is deleted, we should still use redo-oob.
We were giving up and rebuilding the toplevel object, which did eventually rebuild our checksummed file, but then the file turned out to be identical to what it was before, so that nobody *else* who depended on it ended up getting rebuilt. So the results were indeterminate. Now we treat it as if its dirtiness is unknown, so we build it using redo-oob before building any of its dependencies.
This commit is contained in:
parent
f702417ef3
commit
e7f7119f2e
5 changed files with 35 additions and 6 deletions
|
|
@ -28,9 +28,16 @@ def dirty_deps(f, depth, max_changed):
|
||||||
if not f.stamp:
|
if not f.stamp:
|
||||||
debug('%s-- DIRTY (no stamp)\n' % depth)
|
debug('%s-- DIRTY (no stamp)\n' % depth)
|
||||||
return DIRTY
|
return DIRTY
|
||||||
if f.stamp != f.read_stamp():
|
newstamp = f.read_stamp()
|
||||||
debug('%s-- DIRTY (mtime)\n' % depth)
|
if f.stamp != newstamp:
|
||||||
return DIRTY
|
if newstamp == state.STAMP_MISSING:
|
||||||
|
debug('%s-- DIRTY (missing)\n' % depth)
|
||||||
|
else:
|
||||||
|
debug('%s-- DIRTY (mtime)\n' % depth)
|
||||||
|
if f.csum:
|
||||||
|
return [f]
|
||||||
|
else:
|
||||||
|
return DIRTY
|
||||||
|
|
||||||
must_build = []
|
must_build = []
|
||||||
for mode,f2 in f.deps():
|
for mode,f2 in f.deps():
|
||||||
|
|
|
||||||
1
t/stamp/.gitignore
vendored
1
t/stamp/.gitignore
vendored
|
|
@ -3,3 +3,4 @@
|
||||||
/stampy
|
/stampy
|
||||||
/inp
|
/inp
|
||||||
/bob
|
/bob
|
||||||
|
/usestamp2
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
rm -f *.log usestamp stampy inp bob *~ .*~
|
rm -f *.log usestamp usestamp2 stampy inp bob *~ .*~
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
rm -f stampy usestamp stampy.log usestamp.log
|
rm -f stampy usestamp usestamp2 stampy.log usestamp.log usestamp2.log
|
||||||
echo one >inp
|
echo one >inp
|
||||||
|
|
||||||
../flush-cache.sh
|
../flush-cache.sh
|
||||||
redo stampy
|
redo stampy
|
||||||
[ "$(wc -l <stampy.log)" -eq 1 ] || exit 11
|
[ "$(wc -l <stampy.log)" -eq 1 ] || exit 11
|
||||||
|
|
||||||
|
# stampy already exists, so we won't generate it a second time, even though
|
||||||
|
# usestamp depends on it.
|
||||||
redo-ifchange usestamp
|
redo-ifchange usestamp
|
||||||
[ "$(wc -l <stampy.log)" -eq 1 ] || exit 21
|
[ "$(wc -l <stampy.log)" -eq 1 ] || exit 21
|
||||||
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 12
|
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 12
|
||||||
|
|
@ -14,27 +16,43 @@ redo stampy
|
||||||
[ "$(wc -l <stampy.log)" -eq 2 ] || exit 31
|
[ "$(wc -l <stampy.log)" -eq 2 ] || exit 31
|
||||||
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 32
|
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 32
|
||||||
|
|
||||||
|
# same as above: stampy is already up-to-date, so it won't be redone.
|
||||||
redo-ifchange usestamp
|
redo-ifchange usestamp
|
||||||
[ "$(wc -l <stampy.log)" -eq 2 ] || exit 41
|
[ "$(wc -l <stampy.log)" -eq 2 ] || exit 41
|
||||||
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 42
|
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 42
|
||||||
|
|
||||||
|
# stampy depends on bob, so we'll have to rebuild stampy automatically. But
|
||||||
|
# stampy's checksum will still be identical.
|
||||||
../flush-cache.sh
|
../flush-cache.sh
|
||||||
redo bob
|
redo bob
|
||||||
redo-ifchange usestamp
|
redo-ifchange usestamp
|
||||||
[ "$(wc -l <stampy.log)" -eq 3 ] || exit 43
|
[ "$(wc -l <stampy.log)" -eq 3 ] || exit 43
|
||||||
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 44
|
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 44
|
||||||
|
|
||||||
|
# Make sure the previous step correctly marked stampy and usestamp as up-to-date
|
||||||
|
# even though *neither* of them is newer than bob.
|
||||||
../flush-cache.sh
|
../flush-cache.sh
|
||||||
redo-ifchange usestamp
|
redo-ifchange usestamp
|
||||||
[ "$(wc -l <stampy.log)" -eq 3 ] || exit 45
|
[ "$(wc -l <stampy.log)" -eq 3 ] || exit 45
|
||||||
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 46
|
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 46
|
||||||
|
|
||||||
|
# now we're changing the contents of stampy.
|
||||||
../flush-cache.sh
|
../flush-cache.sh
|
||||||
echo two >inp
|
echo two >inp
|
||||||
redo stampy
|
redo stampy
|
||||||
[ "$(wc -l <stampy.log)" -eq 4 ] || exit 51
|
[ "$(wc -l <stampy.log)" -eq 4 ] || exit 51
|
||||||
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 52
|
[ "$(wc -l <usestamp.log)" -eq 1 ] || exit 52
|
||||||
|
|
||||||
redo-ifchange usestamp
|
redo-ifchange usestamp usestamp2
|
||||||
[ "$(wc -l <stampy.log)" -eq 4 ] || exit 61
|
[ "$(wc -l <stampy.log)" -eq 4 ] || exit 61
|
||||||
[ "$(wc -l <usestamp.log)" -eq 2 ] || exit 62
|
[ "$(wc -l <usestamp.log)" -eq 2 ] || exit 62
|
||||||
|
[ "$(wc -l <usestamp2.log)" -eq 1 ] || exit 62
|
||||||
|
|
||||||
|
# when we delete the file and it gets regenerated identically, it's as good as
|
||||||
|
# never having been deleted. So usestamp won't need to change.
|
||||||
|
../flush-cache.sh
|
||||||
|
rm -f stampy
|
||||||
|
redo-ifchange usestamp usestamp2
|
||||||
|
[ "$(wc -l <stampy.log)" -eq 5 ] || exit 71
|
||||||
|
[ "$(wc -l <usestamp.log)" -eq 2 ] || exit 72
|
||||||
|
[ "$(wc -l <usestamp2.log)" -eq 1 ] || exit 73
|
||||||
|
|
|
||||||
3
t/stamp/usestamp2.do
Normal file
3
t/stamp/usestamp2.do
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
redo-ifchange stampy
|
||||||
|
echo 2 $$ >>usestamp2.log
|
||||||
|
cat stampy
|
||||||
Loading…
Add table
Add a link
Reference in a new issue