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 = [
|
2018-05-14 16:50:38 +00:00
|
|
|
'build',
|
2018-05-24 13:14:18 +00:00
|
|
|
'checkout',
|
2017-05-13 02:09:38 +00:00
|
|
|
'recipe_engine/context',
|
2018-05-04 17:46:15 +00:00
|
|
|
'recipe_engine/file',
|
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',
|
|
|
|
'run',
|
|
|
|
'vars',
|
2016-07-26 18:52:17 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
def RunSteps(api):
|
2018-05-04 17:46:15 +00:00
|
|
|
api.vars.setup()
|
|
|
|
|
|
|
|
# Check out code.
|
2018-05-30 18:36:03 +00:00
|
|
|
bot_update = True
|
|
|
|
checkout_root = api.checkout.default_checkout_root
|
|
|
|
checkout_chromium = False
|
|
|
|
checkout_flutter = False
|
|
|
|
extra_gclient_env = {}
|
|
|
|
flutter_android = False
|
|
|
|
parent_rev = False
|
|
|
|
|
2018-02-22 15:03:56 +00:00
|
|
|
if 'NoDEPS' in api.properties['buildername']:
|
2018-05-30 18:36:03 +00:00
|
|
|
bot_update = False
|
2018-05-18 11:36:55 +00:00
|
|
|
checkout_root = api.path['start_dir']
|
2018-05-30 18:36:03 +00:00
|
|
|
if 'CommandBuffer' in api.vars.builder_name:
|
|
|
|
checkout_chromium = True
|
|
|
|
if 'Flutter' in api.vars.builder_name:
|
|
|
|
checkout_root = checkout_root.join('flutter')
|
|
|
|
checkout_flutter = True
|
|
|
|
if 'Android' in api.vars.builder_name:
|
|
|
|
flutter_android = True
|
|
|
|
if 'ParentRevision' in api.vars.builder_name:
|
|
|
|
parent_rev = True
|
|
|
|
|
|
|
|
if bot_update:
|
|
|
|
api.checkout.bot_update(
|
|
|
|
checkout_root=checkout_root,
|
|
|
|
checkout_chromium=checkout_chromium,
|
|
|
|
checkout_flutter=checkout_flutter,
|
|
|
|
extra_gclient_env=extra_gclient_env,
|
|
|
|
flutter_android=flutter_android,
|
|
|
|
parent_rev=parent_rev)
|
2018-05-04 17:46:15 +00:00
|
|
|
else:
|
2018-05-30 18:36:03 +00:00
|
|
|
api.checkout.git(checkout_root=checkout_root)
|
2018-05-18 11:36:55 +00:00
|
|
|
|
2018-05-04 17:46:15 +00:00
|
|
|
api.file.ensure_directory('makedirs tmp_dir', api.vars.tmp_dir)
|
2017-04-10 12:19:10 +00:00
|
|
|
|
2018-05-18 11:36:55 +00:00
|
|
|
out_dir = checkout_root.join(
|
|
|
|
'skia', 'out', api.vars.builder_name, api.vars.configuration)
|
|
|
|
if 'Flutter' in api.vars.builder_name:
|
|
|
|
out_dir = checkout_root.join('src', 'out', 'android_release')
|
|
|
|
|
2017-04-10 12:19:10 +00:00
|
|
|
try:
|
2018-05-18 11:36:55 +00:00
|
|
|
api.build(checkout_root=checkout_root, out_dir=out_dir)
|
|
|
|
|
|
|
|
# TODO(borenet): Move this out of the try/finally.
|
2018-06-01 14:08:53 +00:00
|
|
|
dst = api.vars.swarming_out_dir
|
2018-05-18 11:36:55 +00:00
|
|
|
if 'ParentRevision' in api.vars.builder_name:
|
2018-06-01 14:08:53 +00:00
|
|
|
dst = api.vars.swarming_out_dir.join('ParentRevision')
|
2018-05-18 11:36:55 +00:00
|
|
|
api.build.copy_build_products(out_dir=out_dir, dst=dst)
|
|
|
|
if 'SKQP' in api.vars.extra_tokens:
|
|
|
|
wlist = checkout_root.join(
|
|
|
|
'skia', 'infra','cts', 'whitelist_devices.json')
|
|
|
|
api.file.copy('copy whitelist', wlist, dst)
|
2017-04-10 12:19:10 +00:00
|
|
|
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.run.check_failure()
|
|
|
|
|
|
|
|
|
2017-04-10 13:56:10 +00:00
|
|
|
TEST_BUILDERS = [
|
2018-05-18 11:36:55 +00:00
|
|
|
'Build-Debian9-Clang-universal-devrel-Android_SKQP',
|
2018-02-22 15:03:56 +00:00
|
|
|
'Build-Debian9-Clang-x86_64-Release-NoDEPS',
|
2018-05-18 11:36:55 +00:00
|
|
|
'Build-Debian9-Clang-x86_64-Release-ParentRevision',
|
2017-09-26 18:11:15 +00:00
|
|
|
'Build-Debian9-GCC-x86_64-Release-Flutter_Android',
|
2018-05-30 18:36:03 +00:00
|
|
|
'Build-Mac-Clang-x86_64-Debug-CommandBuffer',
|
2018-03-20 21:13:32 +00:00
|
|
|
'Build-Win-Clang-x86-Debug',
|
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
|
|
|
)
|
|
|
|
)
|
2019-04-24 18:14:27 +00:00
|
|
|
if 'Win' in builder:
|
|
|
|
test += api.platform('win', 64)
|
2017-04-12 12:31:48 +00:00
|
|
|
yield test
|