Half-support for using file checksums instead of stamps.
A new redo-stamp program takes whatever you give it as stdin and uses it to calculate a checksum for the current target. If that checksum is the same as last time, then we consider the target to be unchanged, and we set checked_runid and stamp, but leave changed_runid alone. That will make future callers of redo-ifchange see this target as unmodified. However, this is only "half" support because by the time we run the .do script that calls redo-stamp, it's too late; the caller is a dependant of the stamped program, which is already being rebuilt, even if redo-stamp turns out to say that this target is unchanged. The other half is coming up.
This commit is contained in:
parent
ca67f5e71a
commit
22617d335c
12 changed files with 117 additions and 16 deletions
14
builder.py
14
builder.py
|
|
@ -1,6 +1,6 @@
|
|||
import sys, os, errno, stat
|
||||
import vars, jwack, state
|
||||
from helpers import log, log_, debug2, err, warn, unlink, close_on_exec
|
||||
from helpers import log, log_, debug, debug2, err, warn, unlink, close_on_exec
|
||||
|
||||
|
||||
def _possible_do_files(t):
|
||||
|
|
@ -187,9 +187,17 @@ class BuildJob:
|
|||
unlink(self.tmpname1)
|
||||
unlink(t)
|
||||
sf = self.sf
|
||||
sf.refresh()
|
||||
sf.is_generated = True
|
||||
sf.update_stamp()
|
||||
sf.set_changed()
|
||||
sf.is_override = False
|
||||
if sf.is_checked() or sf.is_changed():
|
||||
# it got checked during the run; someone ran redo-stamp.
|
||||
# update_stamp would call set_changed(); we don't want that
|
||||
sf.stamp = sf.read_stamp()
|
||||
else:
|
||||
sf.csum = None
|
||||
sf.update_stamp()
|
||||
sf.set_changed()
|
||||
sf.save()
|
||||
else:
|
||||
unlink(self.tmpname1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue