Commit 128e3e93 authored by aberent@chromium.org's avatar aberent@chromium.org

Enable manual bisects on Chrome for Android.

This patch fixes various problems in the bisect scripts that were
preventing their use for Chrome for Android. I have only tried these
using run-manual-bisect-test, and there could potentially be
further problems with bisect wrapper scripts.

Also fixes the --use-goma option to actually use Goma, rather than
simply increasing the number of threads.

BUG=none

Review URL: https://codereview.chromium.org/331593007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278082 0039d316-1c4b-4281-b951-d872f2087c98
parent d7ecdef3
......@@ -637,7 +637,7 @@ def CheckRunGit(command, cwd=None):
return output
def SetBuildSystemDefault(build_system):
def SetBuildSystemDefault(build_system, use_goma):
"""Sets up any environment variables needed to build with the specified build
system.
......@@ -657,11 +657,16 @@ def SetBuildSystemDefault(build_system):
os.environ['GYP_DEFINES'] = 'component=shared_library '\
'incremental_chrome_dll=1 disable_nacl=1 fastbuild=1 '\
'chromium_win_pch=0'
elif build_system == 'make':
os.environ['GYP_GENERATORS'] = 'make'
else:
raise RuntimeError('%s build not supported.' % build_system)
if use_goma:
os.environ['GYP_DEFINES'] = '%s %s' % (os.getenv('GYP_DEFINES', ''),
'use_goma=1')
def BuildWithMake(threads, targets, build_type='Release'):
cmd = ['make', 'BUILDTYPE=%s' % build_type]
......@@ -749,7 +754,7 @@ class Builder(object):
raise RuntimeError(
'Path to visual studio could not be determined.')
else:
SetBuildSystemDefault(opts.build_preference)
SetBuildSystemDefault(opts.build_preference, opts.use_goma)
else:
if not opts.build_preference:
if 'ninja' in os.getenv('GYP_GENERATORS'):
......@@ -757,7 +762,7 @@ class Builder(object):
else:
opts.build_preference = 'make'
SetBuildSystemDefault(opts.build_preference)
SetBuildSystemDefault(opts.build_preference, opts.use_goma)
if not bisect_utils.SetupPlatformBuildEnvironment(opts):
raise RuntimeError('Failed to set platform environment.')
......@@ -2372,16 +2377,21 @@ class BisectPerformanceMetrics(object):
Returns:
True if successful.
"""
if depot == 'chromium':
if depot == 'chromium' or depot == 'android-chrome':
# Removes third_party/libjingle. At some point, libjingle was causing
# issues syncing when using the git workflow (crbug.com/266324).
os.chdir(self.src_cwd)
if not bisect_utils.RemoveThirdPartyDirectory('libjingle'):
return False
# Removes third_party/skia. At some point, skia was causing
# issues syncing when using the git workflow (crbug.com/377951).
if not bisect_utils.RemoveThirdPartyDirectory('skia'):
return False
return self.PerformWebkitDirectoryCleanup(revision)
if depot == 'chromium':
# The fast webkit cleanup doesn't work for android_chrome
# The switch from Webkit to Blink that this deals with now happened
# quite a long time ago so this is unlikely to be a problem.
return self.PerformWebkitDirectoryCleanup(revision)
elif depot == 'cros':
return self.PerformCrosChrootCleanup()
return True
......@@ -3769,7 +3779,8 @@ class BisectOptions(object):
help='The remote machine to image to.')
group.add_option('--use_goma',
action="store_true",
help='Add a bunch of extra threads for goma.')
help='Add a bunch of extra threads for goma, and enable '
'goma')
group.add_option('--output_buildbot_annotations',
action="store_true",
help='Add extra annotation output for buildbot.')
......
......@@ -458,6 +458,9 @@ def SetupAndroidBuildEnvironment(opts, path_to_src=None):
except KeyError:
os.environ['GYP_DEFINES'] = 'OS=android'
if opts.use_goma:
os.environ['GYP_DEFINES'] = '%s %s' % (os.environ['GYP_DEFINES'],
'use_goma=1')
return not proc.returncode
......
......@@ -48,11 +48,13 @@ def _RunBisectionScript(options):
'-m', 'manual_test/manual_test',
'-r', '1',
'--working_directory', options.working_directory,
'--target_build_type', options.browser_type.title(),
'--build_preference', 'ninja',
'--use_goma',
'--no_custom_deps']
if options.extra_src:
cmd.extend(['--extra_src', options.extra_src])
if 'cros' in options.browser_type:
cmd.extend(['--target_platform', 'cros'])
......@@ -64,8 +66,16 @@ def _RunBisectionScript(options):
'BISECT_CROS_BOARD undefined.'
print
return 1
elif 'android-chrome' in options.browser_type:
cmd.extend(['--target_platform', 'android-chrome'])
elif 'android' in options.browser_type:
cmd.extend(['--target_platform', 'android'])
elif not options.target_build_type:
cmd.extend(['--target_build_type', options.browser_type.title()])
if options.target_build_type:
cmd.extend(['--target_build_type', options.target_build_type])
cmd = [str(c) for c in cmd]
......@@ -102,7 +112,15 @@ def main():
help='A working directory to supply to the bisection '
'script, which will use it as the location to checkout '
'a copy of the chromium depot.')
parser.add_option('--extra_src',
type='str',
help='Path to extra source file. If this is supplied, '
'bisect script will use this to override default behavior.')
parser.add_option('--target_build_type',
type='choice',
choices=['Release', 'Debug'],
help='The target build type. Choices are "Release" '
'or "Debug".')
options, args = parser.parse_args()
error_msg = ''
if not options.good_revision:
......
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