51b2f1b64c
Remove #defines that lived in gn_to_bp.py and android_framework_defines.gni. These have been moved into a new file in Android, SkUserConfigManual.h, in https://googleplex-android-review.git.corp.google.com/#/c/2519600/ Update gn_to_bp.py to include SkUserConfigManual.h, so it will still result in using the same #defines. Lately, we've found it difficult to guard changes behind a flag. e.g. a change to drawing causes a CTS failure in Android, so we have to do the following: - put the change behind a flag, and add it to gn_to_bp.py or android_framework_defines.gni - generate new images on Android (by running CTS with external/skia modified to not define the flag) - create a CL in CTS that uses the new images - land a CL in Skia that stops defining the flag - when the Skia change lands, wait for the auto-roller to create a CL that includes the change, stop the auto-roller, add the topic to the CTS CL so the two can land at the same time - land both Android changes (with TreeHugger) - restart the Android auto-roller With SkUserConfigManual.h (which lives in Android), the process will be similar to Chromium: - land a CL in Android's external/skia that defines a flag e.g. SK_SUPPORT_LEGACY_FEATURE. Land without TreeHugger because it isn't used in Skia and does not do anything - land a change in Skia that changes behavior unless SK_SUPPORT_LEGACY_FEATURE is defined. This will safely go through the Android roll and not change any behavior for Android - create two Android CLs - one in CTS to use the new images, and one in external/skia to delete SK_SUPPORT_LEGACY_FEATURE. Set them to the same topic and land them with TreeHugger In the new process, there is no need to mess with the Android roll. A downside to the new process is that we cannot test the android framework defines without checking in to Android. But given how much we've progressed in automating Android testing, this is fine. Bug: b/63429612 Change-Id: Idfbaef2f4cae641a75fb6e7bf70428733a441336 Reviewed-on: https://skia-review.googlesource.com/22072 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Eric Boren <borenet@google.com>
216 lines
6.6 KiB
Python
216 lines
6.6 KiB
Python
# Copyright 2016 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
|
|
# Recipe module for Skia Swarming compile.
|
|
|
|
|
|
DEPS = [
|
|
'core',
|
|
'recipe_engine/context',
|
|
'recipe_engine/json',
|
|
'recipe_engine/path',
|
|
'recipe_engine/platform',
|
|
'recipe_engine/properties',
|
|
'recipe_engine/python',
|
|
'recipe_engine/step',
|
|
'flavor',
|
|
'run',
|
|
'vars',
|
|
]
|
|
|
|
|
|
def build_targets_from_builder_dict(builder_dict):
|
|
"""Return a list of targets to build, depending on the builder type."""
|
|
if builder_dict.get('extra_config') == 'iOS':
|
|
return ['iOSShell']
|
|
return ['most']
|
|
|
|
|
|
def get_extra_env_vars(builder_dict):
|
|
env = {}
|
|
if builder_dict.get('compiler') == 'Clang':
|
|
env['CC'] = '/usr/bin/clang'
|
|
env['CXX'] = '/usr/bin/clang++'
|
|
|
|
# SKNX_NO_SIMD, SK_USE_DISCARDABLE_SCALEDIMAGECACHE, etc.
|
|
extra_config = builder_dict.get('extra_config', '')
|
|
if extra_config.startswith('SK') and extra_config.isupper():
|
|
env['CPPFLAGS'] = '-D' + extra_config
|
|
|
|
return env
|
|
|
|
|
|
def RunSteps(api):
|
|
api.core.setup()
|
|
|
|
env = get_extra_env_vars(api.vars.builder_cfg)
|
|
build_targets = build_targets_from_builder_dict(api.vars.builder_cfg)
|
|
|
|
try:
|
|
for target in build_targets:
|
|
with api.context(env=env):
|
|
api.flavor.compile(target)
|
|
api.run.copy_build_products(
|
|
api.flavor.out_dir,
|
|
api.vars.swarming_out_dir.join(
|
|
'out', api.vars.configuration))
|
|
api.flavor.copy_extra_build_products(api.vars.swarming_out_dir)
|
|
finally:
|
|
if 'Win' in api.vars.builder_cfg.get('os', ''):
|
|
api.python.inline(
|
|
name='cleanup',
|
|
program='''import psutil
|
|
for p in psutil.process_iter():
|
|
try:
|
|
if p.name in ('mspdbsrv.exe', 'vctip.exe', 'cl.exe', 'link.exe'):
|
|
p.kill()
|
|
except psutil._error.AccessDenied:
|
|
pass
|
|
''',
|
|
infra_step=True)
|
|
|
|
api.flavor.cleanup_steps()
|
|
api.run.check_failure()
|
|
|
|
|
|
TEST_BUILDERS = [
|
|
'Build-Mac-Clang-arm64-Debug-Android',
|
|
'Build-Mac-Clang-arm64-Debug-iOS',
|
|
'Build-Mac-Clang-x64-Release-iOS',
|
|
'Build-Mac-Clang-x86_64-Debug-CommandBuffer',
|
|
'Build-Mac-Clang-x86_64-Release',
|
|
'Build-Ubuntu-Clang-arm-Release-Chromebook_C100p',
|
|
'Build-Ubuntu-Clang-arm64-Release-Android',
|
|
'Build-Ubuntu-Clang-arm64-Release-Android_Vulkan',
|
|
'Build-Ubuntu-Clang-mipsel-Debug-Android',
|
|
'Build-Ubuntu-Clang-x86_64-Debug',
|
|
'Build-Ubuntu-Clang-x86_64-Debug-ASAN',
|
|
'Build-Ubuntu-Clang-x86_64-Debug-MSAN',
|
|
'Build-Ubuntu-Clang-x86_64-Release-Mini',
|
|
'Build-Ubuntu-Clang-x86_64-Release-Vulkan',
|
|
'Build-Ubuntu-GCC-arm-Release-Chromecast',
|
|
'Build-Ubuntu-GCC-x86-Debug',
|
|
'Build-Ubuntu-GCC-x86_64-Debug-GN',
|
|
'Build-Ubuntu-GCC-x86_64-Debug-MSAN',
|
|
'Build-Ubuntu-GCC-x86_64-Debug-NoGPU',
|
|
'Build-Ubuntu-GCC-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE',
|
|
'Build-Ubuntu-GCC-x86_64-Release-ANGLE',
|
|
'Build-Ubuntu-GCC-x86_64-Release-Fast',
|
|
'Build-Ubuntu-GCC-x86_64-Release-Flutter_Android',
|
|
'Build-Ubuntu-GCC-x86_64-Release-Mesa',
|
|
'Build-Ubuntu-GCC-x86_64-Release-PDFium',
|
|
'Build-Ubuntu-GCC-x86_64-Release-PDFium_SkiaPaths',
|
|
'Build-Ubuntu-GCC-x86_64-Release-Shared',
|
|
'Build-Win-Clang-arm64-Release-Android',
|
|
'Build-Win-MSVC-x86-Debug',
|
|
'Build-Win-MSVC-x86-Debug-ANGLE',
|
|
'Build-Win-MSVC-x86-Debug-Exceptions',
|
|
'Build-Win-MSVC-x86-Release-GDI',
|
|
'Build-Win-MSVC-x86-Release-GN',
|
|
'Build-Win-MSVC-x86_64-Release-Vulkan',
|
|
]
|
|
|
|
|
|
def GenTests(api):
|
|
for builder in TEST_BUILDERS:
|
|
test = (
|
|
api.test(builder) +
|
|
api.properties(buildername=builder,
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
revision='abc123',
|
|
path_config='kitchen',
|
|
swarm_out_dir='[SWARM_OUT_DIR]') +
|
|
api.path.exists(
|
|
api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
|
|
)
|
|
)
|
|
if 'Win' in builder:
|
|
test += api.platform('win', 64)
|
|
elif 'Mac' in builder:
|
|
test += api.platform('mac', 64)
|
|
else:
|
|
test += api.platform('linux', 64)
|
|
|
|
yield test
|
|
|
|
|
|
buildername = 'Build-Win-MSVC-x86_64-Release-Vulkan'
|
|
yield (
|
|
api.test("trybot") +
|
|
api.properties(buildername=buildername,
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
revision='abc123',
|
|
path_config='kitchen',
|
|
swarm_out_dir='[SWARM_OUT_DIR]') +
|
|
api.path.exists(
|
|
api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
|
|
) +
|
|
api.properties(patch_storage='gerrit') +
|
|
api.properties.tryserver(
|
|
buildername=buildername,
|
|
gerrit_project='skia',
|
|
gerrit_url='https://skia-review.googlesource.com/',
|
|
)
|
|
)
|
|
|
|
buildername = 'Build-Win-MSVC-x86_64-Release-Vulkan'
|
|
yield (
|
|
api.test('alternate_repo') +
|
|
api.properties(buildername=buildername,
|
|
repository='https://skia.googlesource.com/other_repo.git',
|
|
revision='abc123',
|
|
path_config='kitchen',
|
|
swarm_out_dir='[SWARM_OUT_DIR]') +
|
|
api.path.exists(
|
|
api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
|
|
)
|
|
)
|
|
|
|
buildername = 'Build-Ubuntu-GCC-x86_64-Release-PDFium'
|
|
yield (
|
|
api.test('pdfium_trybot') +
|
|
api.properties(
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
buildername=buildername,
|
|
path_config='kitchen',
|
|
swarm_out_dir='[SWARM_OUT_DIR]',
|
|
revision='abc123',
|
|
patch_issue=500,
|
|
patch_repo='https://skia.googlesource.com/skia.git',
|
|
patch_set=1,
|
|
patch_storage='gerrit') +
|
|
api.properties.tryserver(
|
|
buildername=buildername,
|
|
gerrit_project='skia',
|
|
gerrit_url='https://skia-review.googlesource.com/',
|
|
) +
|
|
api.path.exists(
|
|
api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
|
|
)
|
|
)
|
|
|
|
buildername = 'Build-Ubuntu-GCC-x86_64-Release-Flutter_Android'
|
|
yield (
|
|
api.test('flutter_trybot') +
|
|
api.properties(
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
buildername=buildername,
|
|
path_config='kitchen',
|
|
swarm_out_dir='[SWARM_OUT_DIR]',
|
|
revision='abc123',
|
|
patch_issue=500,
|
|
patch_repo='https://skia.googlesource.com/skia.git',
|
|
patch_set=1,
|
|
patch_storage='gerrit') +
|
|
api.properties.tryserver(
|
|
buildername=buildername,
|
|
gerrit_project='skia',
|
|
gerrit_url='https://skia-review.googlesource.com/',
|
|
) +
|
|
api.path.exists(
|
|
api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
|
|
)
|
|
)
|