summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2018-08-03 19:48:05 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2018-11-12 16:46:36 (GMT)
commit5b8630a68bcf38a7375904be2d4415151ea7e950 (patch)
treedd4cbf5d1d77fea9deba38657e4bea86b30cdb70
parent8c588f8baf76c0cd491e0589e9d2122787ef2512 (diff)
downloadSCons-5b8630a68bcf38a7375904be2d4415151ea7e950.zip
SCons-5b8630a68bcf38a7375904be2d4415151ea7e950.tar.gz
SCons-5b8630a68bcf38a7375904be2d4415151ea7e950.tar.bz2
Change logic to ensure we only build the dependency map once per target file.
-rw-r--r--src/engine/SCons/Node/FS.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index e39d5d6..7d8191c 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -2485,7 +2485,7 @@ class FileNodeInfo(SCons.Node.NodeInfoBase):
class FileBuildInfo(SCons.Node.BuildInfoBase):
- __slots__ = ()
+ __slots__ = ('dependency_map')
current_version_id = 2
def convert_to_sconsign(self):
@@ -3261,6 +3261,9 @@ class File(Base):
"""
Build mapping from file -> signature
+ This method also updates binfo.dependency_map to avoid rebuilding
+ the map for every dependency of the node we're workingon.
+
Args:
self - self
binfo - buildinfo from node being considered
@@ -3286,6 +3289,9 @@ class File(Base):
for child, signature in zip(children, signatures):
schild = str(child)
m[schild] = signature
+
+ # store this info so we can avoid regenerating it.
+ binfo.dependency_map = m
return m
def _get_previous_signatures(self, dmap):
@@ -3358,8 +3364,13 @@ class File(Base):
# Now get sconsign name -> csig map and then get proper prev_ni if possible
bi = node.get_stored_info().binfo
- dmap = self._build_dependency_map(bi)
- prev_ni = self._get_previous_signatures(dmap)
+ try:
+ dependency_map = bi.dependency_map
+ except AttributeError as e:
+ dependency_map = self._build_dependency_map(bi)
+
+
+ prev_ni = self._get_previous_signatures(dependency_map)
if not self.changed_timestamp_match(target, prev_ni):
try: