diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/CHANGES.txt | 16 | ||||
| -rw-r--r-- | src/engine/SCons/Node/__init__.py | 22 |
2 files changed, 20 insertions, 18 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 0bac28f..8c185c8 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -6,16 +6,20 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - From John Doe: - - - Whatever John Doe did. - From Daniel Holth: - Add basic support for PyPy (by deleting __slots__ from Node with a metaclass on PyPy); wrap most-used open() calls in 'with' statements to avoid too many open files. - Add __main__.py for `python -m SCons` in case it is on PYTHONPATH. + From Alexey Klimkin: + - Use memoization to optimize PATH evaluation across all dependencies per + node. (PR #345) + + From M. Limber: + - Fixed msvs.py for Visual Studio Express editions that would report + "Error : ValueError: invalid literal for float(): 10.0Exp". + From Paweł Tomulik: - Fixed the issue with LDMODULEVERSIONFLAGS reported by Tim Jennes (https://pairlist4.pair.net/pipermail/scons-users/2016-May/004893.html). @@ -25,10 +29,6 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Added LoadableModule to the list of global functions (DefaultEnvironment builders). - From M. Limber: - - Fixed msvs.py for Visual Studio Express editions that would report - "Error : ValueError: invalid literal for float(): 10.0Exp". - RELEASE 2.5.0 - Mon, 09 Apr 2016 11:27:42 -0700 From Dirk Baechle: diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 51762a3..00ddf2f 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -930,9 +930,9 @@ class Node(object, with_metaclass(NoSlotsPyPy)): scanner's recursive flag says that we should. """ nodes = [self] - seen = {} - seen[self] = 1 + seen = set(nodes) dependencies = [] + path_memo = {} root_node_scanner = self._get_scanner(env, initial_scanner, None, kw) @@ -940,30 +940,32 @@ class Node(object, with_metaclass(NoSlotsPyPy)): node = nodes.pop(0) scanner = node._get_scanner(env, initial_scanner, root_node_scanner, kw) - if not scanner: continue - path = path_func(scanner) + try: + path = path_memo[scanner] + except KeyError: + path = path_func(scanner) + path_memo[scanner] = path included_deps = [x for x in node.get_found_includes(env, scanner, path) if x not in seen] if included_deps: dependencies.extend(included_deps) - for dep in included_deps: - seen[dep] = 1 + seen.update(included_deps) nodes.extend(scanner.recurse_nodes(included_deps)) return dependencies def _get_scanner(self, env, initial_scanner, root_node_scanner, kw): - if not initial_scanner: + if initial_scanner: + # handle explicit scanner case + scanner = initial_scanner.select(self) + else: # handle implicit scanner case scanner = self.get_env_scanner(env, kw) if scanner: scanner = scanner.select(self) - else: - # handle explicit scanner case - scanner = initial_scanner.select(self) if not scanner: # no scanner could be found for the given node's scanner key; |
