From 31fc16ed8bef28086ac1374784ffd4a6b5dc8279 Mon Sep 17 00:00:00 2001 From: Gabriel Russell Date: Fri, 11 May 2018 13:29:09 -0400 Subject: [PATCH] SERVER-34957 remove unused libdeps_exploring tracking from dagger.py --- site_scons/site_tools/dagger/dagger.py | 37 +++----------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/site_scons/site_tools/dagger/dagger.py b/site_scons/site_tools/dagger/dagger.py index 1eeefe1ea37..bace834783b 100644 --- a/site_scons/site_tools/dagger/dagger.py +++ b/site_scons/site_tools/dagger/dagger.py @@ -48,19 +48,6 @@ LIB_DB = [] # Stores every SCons library nodes OBJ_DB = [] # Stores every SCons object file node EXE_DB = {} # Stores every SCons executable node, with the object files that build into it {Executable: [object files]} - -class DependencyCycleError(SCons.Errors.UserError): - """Exception representing a cycle discovered in library dependencies.""" - - def __init__(self, first_node): - super(DependencyCycleError, self).__init__() - self.cycle_nodes = [first_node] - - def __str__(self): - return "Library dependency cycle detected: " + " => ".join( - str(n) for n in self.cycle_nodes) - - def list_process(items): """From WIL, converts lists generated from an NM command with unicode strings to lists with ascii strings @@ -146,28 +133,12 @@ def __compute_libdeps(node): the attribute that it uses is populated by the Libdeps.py script """ - if getattr(node.attributes, 'libdeps_exploring', False): - raise DependencyCycleError(node) - env = node.get_env() deps = set() - node.attributes.libdeps_exploring = True - try: - try: - for child in env.Flatten(getattr(node.attributes, 'libdeps_direct', - [])): - if not child: - continue - deps.add(child) - - except DependencyCycleError as e: - if len(e.cycle_nodes) == 1 or e.cycle_nodes[0] != e.cycle_nodes[ - -1]: - e.cycle_nodes.insert(0, node) - - logging.error("Found a dependency cycle" + str(e.cycle_nodes)) - finally: - node.attributes.libdeps_exploring = False + for child in env.Flatten(getattr(node.attributes, 'libdeps_direct', [])): + if not child: + continue + deps.add(child) return deps