diff options
author | nyquist <nyquist@chromium.org> | 2015-07-10 17:01:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-11 00:01:51 +0000 |
commit | c58992cc880b5bff5813276ee9d20a79be70b31f (patch) | |
tree | 6cf9cc711df951aa3009e885a7725c3c2dd5aaff /tools/isolate_driver.py | |
parent | 1389abf29e75c80041b80dbbf7a2f7e6bb8233fb (diff) | |
download | chromium_src-c58992cc880b5bff5813276ee9d20a79be70b31f.zip chromium_src-c58992cc880b5bff5813276ee9d20a79be70b31f.tar.gz chromium_src-c58992cc880b5bff5813276ee9d20a79be70b31f.tar.bz2 |
Add support for escaped target names in isolate driver (4th try)
Currently the isolate_driver.py which creates the dependency files
used by the isolate system, does a simple split on all spaces when
trying to identify targets.
This can fail if the target name contains a space in the name. In
ninja, spaces are escaped with a $-prefix. An example would be
'Content$ Shell$ Helper.app'.
This CL adds support for such target names and ensures that they
stay as one item. Doing this uncovered a few missing dependencies
and a missing file in some .isolate-files for the component build
on Mac.
1st try: https://codereview.chromium.org/970203003/
1st revert: https://codereview.chromium.org/985753002/
2nd try: https://codereview.chromium.org/1103793002/
2nd revert: https://codereview.chromium.org/1129493003/
3rd try: https://codereview.chromium.org/1130523003/
3rd revert: https://codereview.chromium.org/1131363003/
BUG=462248
Review URL: https://codereview.chromium.org/1221333013
Cr-Commit-Position: refs/heads/master@{#338402}
Diffstat (limited to 'tools/isolate_driver.py')
-rwxr-xr-x | tools/isolate_driver.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/isolate_driver.py b/tools/isolate_driver.py index 6c9f118..f51b824 100755 --- a/tools/isolate_driver.py +++ b/tools/isolate_driver.py @@ -24,6 +24,7 @@ import json import logging import os import posixpath +import re import StringIO import subprocess import sys @@ -141,7 +142,9 @@ def raw_build_to_deps(item): # TODO(maruel): Use a whitelist instead? .stamp, .so.TOC, .dylib.TOC, # .dll.lib, .exe and empty. # The first item is the build rule, e.g. 'link', 'cxx', 'phony', etc. - return filter(using_blacklist, item.split(' ')[1:]) + # In ninja build files, spaces in targets are escaped with a $-prefix. + # Use a negative lookbehind to not split on '$ '. + return filter(using_blacklist, re.split('(?<!\$) ', item)[1:]) def collect_deps(target, build_steps, dependencies_added, rules_seen): |