summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornyquist <nyquist@chromium.org>2015-03-05 15:10:24 -0800
committerCommit bot <commit-bot@chromium.org>2015-03-05 23:11:40 +0000
commit8fb598c1b7b9a6b944e2ec15e989e80cdf7522c0 (patch)
treee236b982329ce975ed5586dc13d36644b6753e01
parent25423bcb5d75a576bb0dde77c8bc511c0f1f9b5f (diff)
downloadchromium_src-8fb598c1b7b9a6b944e2ec15e989e80cdf7522c0.zip
chromium_src-8fb598c1b7b9a6b944e2ec15e989e80cdf7522c0.tar.gz
chromium_src-8fb598c1b7b9a6b944e2ec15e989e80cdf7522c0.tar.bz2
Add support for escaped target names in isolate driver.
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. BUG=462248 Review URL: https://codereview.chromium.org/970203003 Cr-Commit-Position: refs/heads/master@{#319356}
-rwxr-xr-xtools/isolate_driver.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/isolate_driver.py b/tools/isolate_driver.py
index 6c9f118..b81ca91 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 a space that is following a $.
+ return filter(using_blacklist, re.split('(?<!\$) ', item)[1:])
def collect_deps(target, build_steps, dependencies_added, rules_seen):