Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: tools/isolate/trace_inputs.py

Issue 10019014: Convert isolate.py to exclusively use .isolate files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Do not read as binary Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/isolate/merge_isolate_test.py ('k') | tools/isolate/trace_inputs_smoke_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/isolate/trace_inputs.py
diff --git a/tools/isolate/trace_inputs.py b/tools/isolate/trace_inputs.py
index 7de92f74497ccc3e398cfa493b23614c2041b027..0ee69b4de9003c067a7a2c7155ccf4780a1f4a11 100755
--- a/tools/isolate/trace_inputs.py
+++ b/tools/isolate/trace_inputs.py
@@ -24,6 +24,9 @@ import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(os.path.dirname(BASE_DIR))
+KEY_TRACKED = 'isolate_dependency_tracked'
+KEY_UNTRACKED = 'isolate_dependency_untracked'
+
if sys.platform == 'win32':
from ctypes.wintypes import create_unicode_buffer
@@ -119,6 +122,16 @@ def isEnabledFor(level):
return logging.getLogger().isEnabledFor(level)
+def fix_python_path(cmd):
+ """Returns the fixed command line to call the right python executable."""
+ out = cmd[:]
+ if out[0] == 'python':
+ out[0] = sys.executable
+ elif out[0].endswith('.py'):
+ out.insert(0, sys.executable)
+ return out
+
+
class Strace(object):
"""strace implies linux."""
IGNORED = (
@@ -1161,11 +1174,13 @@ def trace_inputs(logfile, cmd, root_dir, cwd_dir, product_dir, force_trace):
# It is important to have unambiguous path.
assert os.path.isabs(root_dir), root_dir
assert os.path.isabs(logfile), logfile
+ assert not cwd_dir or not os.path.isabs(cwd_dir), cwd_dir
+ assert not product_dir or not os.path.isabs(product_dir), product_dir
+
+ cmd = fix_python_path(cmd)
assert (
(os.path.isfile(logfile) and not force_trace) or os.path.isabs(cmd[0])
), cmd[0]
- assert not cwd_dir or not os.path.isabs(cwd_dir), cwd_dir
- assert not product_dir or not os.path.isabs(product_dir), product_dir
# Resolve any symlink
root_dir = os.path.realpath(root_dir)
@@ -1268,9 +1283,9 @@ def trace_inputs(logfile, cmd, root_dir, cwd_dir, product_dir, force_trace):
dirs = [f for f in corrected if f.endswith('/')]
variables = {}
if files:
- variables['isolate_files'] = files
+ variables[KEY_TRACKED] = files
if dirs:
- variables['isolate_dirs'] = dirs
+ variables[KEY_UNTRACKED] = dirs
value = {
'conditions': [
['OS=="%s"' % flavor, {
« no previous file with comments | « tools/isolate/merge_isolate_test.py ('k') | tools/isolate/trace_inputs_smoke_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698