diff options
author | William Deegan <bill@baddogconsulting.com> | 2019-03-04 09:47:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-04 09:47:16 -0500 |
commit | d6f6ae54248286a4501f683654f1bc54a2ade591 (patch) | |
tree | 6e09642b68b346ea7531769a5e4d72808b9a9d66 /src/engine/SCons | |
parent | 54354a11e1b4273490cf0410bcd45837c2979aed (diff) | |
parent | 9fe21847c4c987792326d515a851b673d96af930 (diff) | |
download | scons-git-d6f6ae54248286a4501f683654f1bc54a2ade591.tar.gz |
Merge pull request #3317 from bdbaddog/fix_win_md5_decider_malfunction_on_fresh_build
MD5-Timestamp was causing build failures on windows only. (Mesa Project affected)
Diffstat (limited to 'src/engine/SCons')
-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: |