2016-07-26 18:52:17 +00:00
|
|
|
# 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 = [
|
2017-04-10 12:19:10 +00:00
|
|
|
'core',
|
2017-05-13 02:09:38 +00:00
|
|
|
'recipe_engine/context',
|
2017-04-10 12:19:10 +00:00
|
|
|
'recipe_engine/json',
|
2016-07-26 18:52:17 +00:00
|
|
|
'recipe_engine/path',
|
|
|
|
'recipe_engine/platform',
|
|
|
|
'recipe_engine/properties',
|
2017-04-10 12:19:10 +00:00
|
|
|
'recipe_engine/python',
|
|
|
|
'recipe_engine/step',
|
|
|
|
'flavor',
|
|
|
|
'run',
|
|
|
|
'vars',
|
2016-07-26 18:52:17 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
2017-04-10 12:19:10 +00:00
|
|
|
def build_targets_from_builder_dict(builder_dict):
|
|
|
|
"""Return a list of targets to build, depending on the builder type."""
|
|
|
|
return ['most']
|
|
|
|
|
|
|
|
|
2017-12-13 18:00:47 +00:00
|
|
|
def get_extra_env_vars(vars_api):
|
2017-04-10 12:19:10 +00:00
|
|
|
env = {}
|
2017-12-13 18:00:47 +00:00
|
|
|
if vars_api.builder_cfg.get('compiler') == 'Clang':
|
2017-04-10 12:19:10 +00:00
|
|
|
env['CC'] = '/usr/bin/clang'
|
|
|
|
env['CXX'] = '/usr/bin/clang++'
|
|
|
|
|
|
|
|
# SKNX_NO_SIMD, SK_USE_DISCARDABLE_SCALEDIMAGECACHE, etc.
|
2017-12-13 18:00:47 +00:00
|
|
|
# TODO(benjaminwagner): Same appears in gn_flavor.py to set extra_cflags. Are
|
|
|
|
# both needed?
|
|
|
|
if (len(vars_api.extra_tokens) == 1 and
|
|
|
|
vars_api.extra_tokens[0].startswith('SK')):
|
|
|
|
env['CPPFLAGS'] = '-D' + vars_api.extra_tokens[0]
|
2017-04-10 12:19:10 +00:00
|
|
|
|
|
|
|
return env
|
|
|
|
|
|
|
|
|
2016-07-26 18:52:17 +00:00
|
|
|
def RunSteps(api):
|
2018-02-22 15:03:56 +00:00
|
|
|
bot_update=True
|
|
|
|
if 'NoDEPS' in api.properties['buildername']:
|
|
|
|
bot_update = False
|
|
|
|
api.core.setup(bot_update=bot_update)
|
2017-04-10 12:19:10 +00:00
|
|
|
|
2017-12-13 18:00:47 +00:00
|
|
|
env = get_extra_env_vars(api.vars)
|
2017-04-10 12:19:10 +00:00
|
|
|
build_targets = build_targets_from_builder_dict(api.vars.builder_cfg)
|
|
|
|
|
|
|
|
try:
|
|
|
|
for target in build_targets:
|
2017-05-13 02:09:38 +00:00
|
|
|
with api.context(env=env):
|
2017-04-10 12:19:10 +00:00
|
|
|
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()
|
|
|
|
|
|
|
|
|
2017-04-10 13:56:10 +00:00
|
|
|
TEST_BUILDERS = [
|
2017-11-02 13:34:08 +00:00
|
|
|
'Build-Debian9-Clang-arm-Release-Chromebook_GLES',
|
2017-09-26 18:11:15 +00:00
|
|
|
'Build-Debian9-Clang-arm64-Release-Android',
|
|
|
|
'Build-Debian9-Clang-arm64-Release-Android_Vulkan',
|
2018-01-12 19:31:48 +00:00
|
|
|
'Build-Debian9-Clang-arm64-Release-Android_ASAN',
|
2017-09-26 18:11:15 +00:00
|
|
|
'Build-Debian9-Clang-x86_64-Debug',
|
|
|
|
'Build-Debian9-Clang-x86_64-Debug-ASAN',
|
2017-10-09 19:26:19 +00:00
|
|
|
'Build-Debian9-Clang-x86_64-Debug-Coverage',
|
2017-09-26 18:11:15 +00:00
|
|
|
'Build-Debian9-Clang-x86_64-Debug-MSAN',
|
2017-10-02 20:53:07 +00:00
|
|
|
'Build-Debian9-Clang-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE',
|
2017-11-02 13:34:08 +00:00
|
|
|
'Build-Debian9-Clang-x86_64-Release-Chromebook_GLES',
|
2017-09-26 18:11:15 +00:00
|
|
|
'Build-Debian9-Clang-x86_64-Release-Fast',
|
|
|
|
'Build-Debian9-Clang-x86_64-Release-Mini',
|
2018-02-22 15:03:56 +00:00
|
|
|
'Build-Debian9-Clang-x86_64-Release-NoDEPS',
|
2017-09-26 18:11:15 +00:00
|
|
|
'Build-Debian9-Clang-x86_64-Release-Vulkan',
|
2017-10-10 14:51:40 +00:00
|
|
|
'Build-Debian9-Clang-x86_64-Release-Vulkan_Coverage',
|
2017-09-26 18:11:15 +00:00
|
|
|
'Build-Debian9-EMCC-wasm-Release',
|
|
|
|
'Build-Debian9-GCC-arm-Release-Chromecast',
|
|
|
|
'Build-Debian9-GCC-x86-Debug',
|
|
|
|
'Build-Debian9-GCC-x86_64-Debug-NoGPU',
|
|
|
|
'Build-Debian9-GCC-x86_64-Release-ANGLE',
|
|
|
|
'Build-Debian9-GCC-x86_64-Release-Flutter_Android',
|
|
|
|
'Build-Debian9-GCC-x86_64-Release-PDFium',
|
|
|
|
'Build-Debian9-GCC-x86_64-Release-PDFium_SkiaPaths',
|
|
|
|
'Build-Debian9-GCC-x86_64-Release-Shared',
|
2017-04-12 12:31:48 +00:00
|
|
|
'Build-Mac-Clang-arm64-Debug-Android',
|
2017-04-10 13:56:10 +00:00
|
|
|
'Build-Mac-Clang-arm64-Debug-iOS',
|
|
|
|
'Build-Mac-Clang-x64-Release-iOS',
|
|
|
|
'Build-Mac-Clang-x86_64-Debug-CommandBuffer',
|
2017-04-12 12:31:48 +00:00
|
|
|
'Build-Mac-Clang-x86_64-Release',
|
|
|
|
'Build-Win-Clang-arm64-Release-Android',
|
2018-03-20 21:13:32 +00:00
|
|
|
'Build-Win-Clang-x86-Debug',
|
2018-03-20 20:36:16 +00:00
|
|
|
'Build-Win-Clang-x86-Debug-Exceptions',
|
2018-03-20 21:13:32 +00:00
|
|
|
'Build-Win-Clang-x86_64-Debug-ANGLE',
|
2017-10-11 04:23:58 +00:00
|
|
|
'Build-Win-Clang-x86_64-Release-Vulkan',
|
2017-04-10 13:56:10 +00:00
|
|
|
]
|
2016-07-26 18:52:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
def GenTests(api):
|
2017-04-10 13:56:10 +00:00
|
|
|
for builder in TEST_BUILDERS:
|
|
|
|
test = (
|
|
|
|
api.test(builder) +
|
|
|
|
api.properties(buildername=builder,
|
2017-04-10 12:19:10 +00:00
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
2017-04-10 13:56:10 +00:00
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]') +
|
2017-04-10 12:19:10 +00:00
|
|
|
api.path.exists(
|
|
|
|
api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
|
2017-04-10 13:56:10 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
if 'Win' in builder:
|
|
|
|
test += api.platform('win', 64)
|
|
|
|
elif 'Mac' in builder:
|
|
|
|
test += api.platform('mac', 64)
|
|
|
|
else:
|
|
|
|
test += api.platform('linux', 64)
|
2017-04-12 12:31:48 +00:00
|
|
|
|
|
|
|
yield test
|
|
|
|
|
|
|
|
|
2017-10-11 04:23:58 +00:00
|
|
|
buildername = 'Build-Win-Clang-x86_64-Release-Vulkan'
|
2017-04-12 12:31:48 +00:00
|
|
|
yield (
|
2017-09-26 18:11:15 +00:00
|
|
|
api.test('trybot') +
|
2017-04-12 12:31:48 +00:00
|
|
|
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,
|
2017-04-10 12:19:10 +00:00
|
|
|
gerrit_project='skia',
|
|
|
|
gerrit_url='https://skia-review.googlesource.com/',
|
2017-04-10 13:56:10 +00:00
|
|
|
)
|
2017-04-12 12:31:48 +00:00
|
|
|
)
|
2017-04-10 12:19:10 +00:00
|
|
|
|
|
|
|
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')
|
|
|
|
)
|
2017-01-12 13:46:20 +00:00
|
|
|
)
|
2017-04-10 12:19:10 +00:00
|
|
|
|
2017-09-26 18:11:15 +00:00
|
|
|
buildername = 'Build-Debian9-GCC-x86_64-Release-PDFium'
|
2017-04-10 12:19:10 +00:00
|
|
|
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,
|
2017-04-21 13:37:37 +00:00
|
|
|
patch_repo='https://skia.googlesource.com/skia.git',
|
2017-04-10 12:19:10 +00:00
|
|
|
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')
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2017-09-26 18:11:15 +00:00
|
|
|
buildername = 'Build-Debian9-GCC-x86_64-Release-Flutter_Android'
|
2017-04-10 12:19:10 +00:00
|
|
|
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,
|
2017-04-21 13:37:37 +00:00
|
|
|
patch_repo='https://skia.googlesource.com/skia.git',
|
2017-04-10 12:19:10 +00:00
|
|
|
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')
|
|
|
|
)
|
2016-10-13 13:23:45 +00:00
|
|
|
)
|