diff options
Diffstat (limited to 'src/engine/SCons/Node/FS.py')
-rw-r--r-- | src/engine/SCons/Node/FS.py | 58 |
1 files changed, 51 insertions, 7 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 77c340f2a..61054f319 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -61,6 +61,8 @@ from . import DeciderNeedsNode print_duplicate = 0 +MD5_TIMESTAMP_DEBUG = False + def sconsign_none(node): raise NotImplementedError @@ -3335,20 +3337,42 @@ class File(Base): List of csigs for provided list of children """ prev = [] + # MD5_TIMESTAMP_DEBUG = False + + if len(dmap) == 0: + if MD5_TIMESTAMP_DEBUG: print("Nothing dmap shortcutting") + return None + if MD5_TIMESTAMP_DEBUG: print("len(dmap):%d"%len(dmap)) # First try the simple name for node c_str = str(self) + if MD5_TIMESTAMP_DEBUG: print("Checking :%s"%c_str) + df = dmap.get(c_str, None) + if df: + return df + if os.altsep: c_str = c_str.replace(os.sep, os.altsep) - df = dmap.get(c_str, None) + df = dmap.get(c_str, None) + if MD5_TIMESTAMP_DEBUG: print("-->%s"%df) + if df: + return df + if not df: try: # this should yield a path which matches what's in the sconsign c_str = self.get_path() + df = dmap.get(c_str, None) + if MD5_TIMESTAMP_DEBUG: print("-->%s"%df) + if df: + return df + if os.altsep: c_str = c_str.replace(os.sep, os.altsep) - - df = dmap.get(c_str, None) + df = dmap.get(c_str, None) + if MD5_TIMESTAMP_DEBUG: print("-->%s"%df) + if df: + return df except AttributeError as e: raise FileBuildInfoFileToCsigMappingError("No mapping from file name to content signature for :%s"%c_str) @@ -3388,16 +3412,36 @@ class File(Base): dependency_map = self._build_dependency_map(bi) rebuilt = True - prev_ni = self._get_previous_signatures(dependency_map) + if len(dependency_map) == 0: + # If there's no dependency map, there's no need to find the + # prev_ni as there aren't any + # shortcut the rest of the logic + if MD5_TIMESTAMP_DEBUG: print("Skipping checks len(dmap)=0") + + # We still need to get the current file's csig + # This should be slightly faster than calling self.changed_content(target, new_prev_ni) + self.get_csig() + return True + + new_prev_ni = self._get_previous_signatures(dependency_map) + new = self.changed_timestamp_match(target, new_prev_ni) + + if MD5_TIMESTAMP_DEBUG: + old = self.changed_timestamp_match(target, prev_ni) + + if old != new: + print("Mismatch self.changed_timestamp_match(%s, prev_ni) old:%s new:%s"%(str(target), old, new)) + new_prev_ni = self._get_previous_signatures(dependency_map) + - if not self.changed_timestamp_match(target, prev_ni): + if not new: try: # NOTE: We're modifying the current node's csig in a query. - self.get_ninfo().csig = prev_ni.csig + self.get_ninfo().csig = new_prev_ni.csig except AttributeError: pass return False - return self.changed_content(target, prev_ni) + return self.changed_content(target, new_prev_ni) def changed_timestamp_newer(self, target, prev_ni): try: |