2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-25 19:30:04 +01:00

wafcache: skip uploads when inputs are modified while building

This commit is contained in:
Thomas Nagy 2022-10-02 01:20:59 +02:00
parent af9a1a249d
commit 698888f149

View File

@ -132,9 +132,19 @@ def put_files_cache(self):
files_from.append(path) files_from.append(path)
bld = self.generator.bld bld = self.generator.bld
sig = self.signature() old_sig = self.signature()
ssig = Utils.to_hex(self.uid() + sig)
for node in self.inputs:
try:
del node.ctx.cache_sig[node]
except KeyError:
pass
delattr(self, 'cache_sig')
sig = self.signature()
if old_sig == sig:
ssig = Utils.to_hex(self.uid() + sig)
err = cache_command(ssig, files_from, []) err = cache_command(ssig, files_from, [])
if err.startswith(OK): if err.startswith(OK):
@ -149,6 +159,9 @@ def put_files_cache(self):
Logs.pprint('RED', ' Error caching step results %s: %s' % (files_from, err)) Logs.pprint('RED', ' Error caching step results %s: %s' % (files_from, err))
else: else:
Logs.debug('wafcache: Error caching results %s: %s', files_from, err) Logs.debug('wafcache: Error caching results %s: %s', files_from, err)
else:
Logs.debug('wafcache: skipped %r upload due to late input modifications %r', self.outputs, self.inputs)
bld.task_sigs[self.uid()] = self.cache_sig bld.task_sigs[self.uid()] = self.cache_sig