From b41f13b3a07fd0da0bffa9794d0fe7e5a2eb2ce4 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Tue, 8 Dec 2020 22:00:52 +0100 Subject: [PATCH] Exclude wafcache symlink handling - Exclude classes having folder or symlinks - Exclude well-known Task classes from wafcache processing - Remove stale 'waflib.Task.Task.chmod' processing --- waflib/Tools/wafcache.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/waflib/Tools/wafcache.py b/waflib/Tools/wafcache.py index 73e4cb62..7c028226 100644 --- a/waflib/Tools/wafcache.py +++ b/waflib/Tools/wafcache.py @@ -105,11 +105,17 @@ def put_files_cache(self): if WAFCACHE_NO_PUSH or getattr(self, 'cached', None) or not self.outputs: return + files_from = [] + for node in self.outputs: + path = node.abspath() + if not os.path.isfile(path): + return + files_from.append(path) + bld = self.generator.bld sig = self.signature() ssig = Utils.to_hex(self.uid() + sig) - files_from = [node.abspath() for node in self.outputs] err = cache_command(ssig, files_from, []) if err.startswith(OK): @@ -181,6 +187,10 @@ def make_cached(cls): if getattr(cls, 'nocache', None) or getattr(cls, 'has_cache', False): return + full_name = "%s.%s" % (cls.__module__, cls.__name__) + if full_name in ('waflib.Tools.ccroot.vnum', 'waflib.Build.inst'): + return + m1 = getattr(cls, 'run', None) def run(self): if getattr(self, 'nocache', False): @@ -196,9 +206,6 @@ def make_cached(cls): return m2(self) ret = m2(self) self.put_files_cache() - if hasattr(self, 'chmod'): - for node in self.outputs: - os.chmod(node.abspath(), self.chmod) return ret cls.post_run = post_run cls.has_cache = True