Skip syncing V8_bleeding_edge unless bisecting V8.

BUG=249038
NOTRY=true

Review URL: https://chromiumcodereview.appspot.com/16950022

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207873 0039d316-1c4b-4281-b951-d872f2087c98
parent 1be0b458
......@@ -80,7 +80,8 @@ DEPOT_DEPS_NAME = {
"recurse" : True,
"depends" : None,
"build_with": 'v8_bleeding_edge',
"from" : 'chromium'
"from" : 'chromium',
"custom_deps": bisect_utils.GCLIENT_CUSTOM_DEPS_V8
},
'v8_bleeding_edge' : {
"src" : "src/v8_bleeding_edge",
......@@ -1326,7 +1327,9 @@ class BisectPerformanceMetrics(object):
def PrepareToBisectOnDepot(self,
current_depot,
end_revision,
start_revision):
start_revision,
previous_depot,
previous_revision):
"""Changes to the appropriate directory and gathers a list of revisions
to bisect between |start_revision| and |end_revision|.
......@@ -1334,6 +1337,8 @@ class BisectPerformanceMetrics(object):
current_depot: The depot we want to bisect.
end_revision: End of the revision range.
start_revision: Start of the revision range.
previous_depot: The depot we were previously bisecting.
previous_revision: The last revision we synced to on |previous_depot|.
Returns:
A list containing the revisions between |start_revision| and
......@@ -1347,6 +1352,16 @@ class BisectPerformanceMetrics(object):
# V8 (and possibly others) is merged in periodically. Bisecting
# this directory directly won't give much good info.
if DEPOT_DEPS_NAME[current_depot].has_key('build_with'):
if (DEPOT_DEPS_NAME[current_depot].has_key('custom_deps') and
previous_depot == 'chromium'):
config_path = os.path.join(self.src_cwd, '..')
if bisect_utils.RunGClientAndCreateConfig(self.opts,
DEPOT_DEPS_NAME[current_depot]['custom_deps'], cwd=config_path):
return []
if bisect_utils.RunGClient(
['sync', '--revision', previous_revision], cwd=self.src_cwd):
return []
new_depot = DEPOT_DEPS_NAME[current_depot]['build_with']
svn_start_revision = self.source_control.SVNFindRev(start_revision)
......@@ -1651,6 +1666,8 @@ class BisectPerformanceMetrics(object):
good_revision_data['passed'] = 1
good_revision_data['value'] = known_good_value
next_revision_depot = target_depot
while True:
if not revision_list:
break
......@@ -1676,7 +1693,6 @@ class BisectPerformanceMetrics(object):
if min_revision_data['external'][current_depot] !=\
max_revision_data['external'][current_depot]:
external_depot = current_depot
break
# If there was no change in any of the external depots, the search
......@@ -1684,12 +1700,16 @@ class BisectPerformanceMetrics(object):
if not external_depot:
break
earliest_revision = max_revision_data['external'][current_depot]
latest_revision = min_revision_data['external'][current_depot]
previous_revision = revision_list[min_revision]
earliest_revision = max_revision_data['external'][external_depot]
latest_revision = min_revision_data['external'][external_depot]
new_revision_list = self.PrepareToBisectOnDepot(external_depot,
latest_revision,
earliest_revision)
earliest_revision,
next_revision_depot,
previous_revision)
if not new_revision_list:
results['error'] = 'An error occurred attempting to retrieve'\
......@@ -1710,7 +1730,7 @@ class BisectPerformanceMetrics(object):
sort_key_ids += len(revision_list)
print 'Regression in metric:%s appears to be the result of changes'\
' in [%s].' % (metric, current_depot)
' in [%s].' % (metric, external_depot)
self.PrintRevisionsToBisectMessage(revision_list, external_depot)
......
......@@ -12,28 +12,24 @@ import shutil
import subprocess
import sys
GCLIENT_SPEC = """
solutions = [
GCLIENT_SPEC_DATA = [
{ "name" : "src",
"url" : "https://chromium.googlesource.com/chromium/src.git",
"deps_file" : ".DEPS.git",
"managed" : True,
"custom_deps" : {
"src/data/page_cycler": "https://chrome-internal.googlesource.com/" +
"src/data/page_cycler": "https://chrome-internal.googlesource.com/"
"chrome/data/page_cycler/.git",
"src/data/dom_perf": "https://chrome-internal.googlesource.com/" +
"src/data/dom_perf": "https://chrome-internal.googlesource.com/"
"chrome/data/dom_perf/.git",
"src/tools/perf/data": "https://chrome-internal.googlesource.com/" +
"src/tools/perf/data": "https://chrome-internal.googlesource.com/"
"chrome/tools/perf/data/.git",
"src/v8_bleeding_edge": "git://github.com/v8/v8.git",
},
"safesync_url": "",
},
]
"""
GCLIENT_SPEC = ''.join([l for l in GCLIENT_SPEC.splitlines()])
GCLIENT_SPEC_ANDROID = GCLIENT_SPEC + "\ntarget_os = ['android']"
GCLIENT_ANDROID = "\ntarget_os = ['android']"
GCLIENT_CUSTOM_DEPS_V8 = {"src/v8_bleeding_edge": "git://github.com/v8/v8.git"}
FILE_DEPS_GIT = '.DEPS.git'
REPO_PARAMS = [
......@@ -86,11 +82,12 @@ def CreateAndChangeToSourceDirectory(working_directory):
return True
def SubprocessCall(cmd):
def SubprocessCall(cmd, cwd=None):
"""Runs a subprocess with specified parameters.
Args:
params: A list of parameters to pass to gclient.
cwd: Working directory to run from.
Returns:
The return code of the call.
......@@ -101,21 +98,22 @@ def SubprocessCall(cmd):
if not os.getenv('HOME'):
os.environ['HOME'] = os.environ['USERPROFILE']
shell = os.name == 'nt'
return subprocess.call(cmd, shell=shell)
return subprocess.call(cmd, shell=shell, cwd=cwd)
def RunGClient(params):
def RunGClient(params, cwd=None):
"""Runs gclient with the specified parameters.
Args:
params: A list of parameters to pass to gclient.
cwd: Working directory to run from.
Returns:
The return code of the call.
"""
cmd = ['gclient'] + params
return SubprocessCall(cmd)
return SubprocessCall(cmd, cwd=cwd)
def RunRepo(params):
......@@ -146,21 +144,32 @@ def RunRepoSyncAtTimestamp(timestamp):
return RunRepo(cmd)
def RunGClientAndCreateConfig(opts):
def RunGClientAndCreateConfig(opts, custom_deps=None, cwd=None):
"""Runs gclient and creates a config containing both src and src-internal.
Args:
opts: The options parsed from the command line through parse_args().
custom_deps: A dictionary of additional dependencies to add to .gclient.
cwd: Working directory to run from.
Returns:
The return code of the call.
"""
spec = GCLIENT_SPEC
spec = GCLIENT_SPEC_DATA
if custom_deps:
for k, v in custom_deps.iteritems():
spec[0]['custom_deps'][k] = v
# Cannot have newlines in string on windows
spec = 'solutions =' + str(spec)
spec = ''.join([l for l in spec.splitlines()])
if opts.target_platform == 'android':
spec = GCLIENT_SPEC_ANDROID
spec += GCLIENT_SPEC_ANDROID
return_code = RunGClient(
['config', '--spec=%s' % spec, '--git-deps'])
['config', '--spec=%s' % spec, '--git-deps'], cwd=cwd)
return return_code
......@@ -192,11 +201,12 @@ def RemoveThirdPartyWebkitDirectory():
return True
def RunGClientAndSync(reset):
def RunGClientAndSync(reset, cwd=None):
"""Runs gclient and does a normal sync.
Args:
reset: Whether to reset any changes to the depot.
cwd: Working directory to run from.
Returns:
The return code of the call.
......@@ -204,7 +214,7 @@ def RunGClientAndSync(reset):
params = ['sync', '--verbose', '--nohooks']
if reset:
params.extend(['--reset', '--force', '--delete_unversioned_trees'])
return RunGClient(params)
return RunGClient(params, cwd=cwd)
def SetupGitDepot(opts, reset):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment