summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-31 04:40:31 +0000
committerkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-31 04:40:31 +0000
commit6322bdb57320cf5164441b2c17bbeb6a234d86c3 (patch)
treecd5dfbc4d3f16334e7bc58eaa5a9b53c0f38b07e
parent4492db768d3c3504b5e88df88fb1df8f3e7eecfa (diff)
downloadchromium_src-6322bdb57320cf5164441b2c17bbeb6a234d86c3.zip
chromium_src-6322bdb57320cf5164441b2c17bbeb6a234d86c3.tar.gz
chromium_src-6322bdb57320cf5164441b2c17bbeb6a234d86c3.tar.bz2
Fixed bug in dependency recursion in isolate_driver.py.
When run in a component build, isolate_driver recursively descends the dependency graph to discover implicit shared library dependencies. A bug in the recursion caused dependencies at certain depths in the graph to be missed. Also changed the recursion to use a set to record newly added dependencies to avoid adding them to the isolate multiple times. Expanded the ignored set of suffixes slightly. BUG=378021 TEST=GLES2 conformance tests run via isolate in component build on Mac OS R=maruel@chromium.org,vadimsh@chromium.org,csharp@chromium.org Review URL: https://codereview.chromium.org/304993006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274023 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xtools/isolate_driver.py32
1 files changed, 15 insertions, 17 deletions
diff --git a/tools/isolate_driver.py b/tools/isolate_driver.py
index 4db823e..192de2c 100755
--- a/tools/isolate_driver.py
+++ b/tools/isolate_driver.py
@@ -113,8 +113,9 @@ def using_blacklist(item):
this list. This is simply an optimization.
"""
IGNORED = (
- '.a', '.cc', '.css', '.def', '.h', '.html', '.js', '.json', '.manifest',
- '.o', '.obj', '.pak', '.png', '.pdb', '.strings', '.txt',
+ '.a', '.cc', '.css', '.def', '.frag', '.h', '.html', '.js', '.json',
+ '.manifest', '.o', '.obj', '.pak', '.png', '.pdb', '.strings', '.test',
+ '.txt', '.vert',
)
# ninja files use native path format.
ext = os.path.splitext(item)[1]
@@ -138,31 +139,26 @@ def raw_build_to_deps(item):
return filter(using_blacklist, item.split(' ')[1:])
-def recurse(target, build_steps, rules_seen):
- """Recursively returns all the interesting dependencies for root_item."""
- out = []
+def collect_deps(target, build_steps, dependencies_added, rules_seen):
+ """Recursively adds all the interesting dependencies for |target|
+ into |dependencies_added|.
+ """
if rules_seen is None:
rules_seen = set()
if target in rules_seen:
# TODO(maruel): Figure out how it happens.
logging.warning('Circular dependency for %s!', target)
- return []
+ return
rules_seen.add(target)
try:
dependencies = raw_build_to_deps(build_steps[target])
except KeyError:
logging.info('Failed to find a build step to generate: %s', target)
- return []
- logging.debug('recurse(%s) -> %s', target, dependencies)
+ return
+ logging.debug('collect_deps(%s) -> %s', target, dependencies)
for dependency in dependencies:
- out.append(dependency)
- dependency_raw_dependencies = build_steps.get(dependency)
- if dependency_raw_dependencies:
- for i in raw_build_to_deps(dependency_raw_dependencies):
- out.extend(recurse(i, build_steps, rules_seen))
- else:
- logging.info('Failed to find a build step to generate: %s', dependency)
- return out
+ dependencies_added.add(dependency)
+ collect_deps(dependency, build_steps, dependencies_added, rules_seen)
def post_process_deps(build_dir, dependencies):
@@ -219,7 +215,9 @@ def create_wrapper(args, isolate_index, isolated_index):
# complain to maruel@.
target = isolate[:-len('.isolate')] + '_run'
build_steps = load_ninja(build_dir)
- binary_deps = post_process_deps(build_dir, recurse(target, build_steps, None))
+ binary_deps = set()
+ collect_deps(target, build_steps, binary_deps, None)
+ binary_deps = post_process_deps(build_dir, binary_deps)
logging.debug(
'Binary dependencies:%s', ''.join('\n ' + i for i in binary_deps))