blob: 81da2eb1fef24497ec3caa5d91b2f408ed12f6d8 [file] [log] [blame]
borenet1ed2ae42016-07-26 11:52:17 -07001# Copyright 2016 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5
6# Recipe module for Skia Swarming compile.
7
8
9DEPS = [
Eric Boren9030b942018-05-14 12:50:38 -040010 'build',
Eric Boren90f05032018-05-24 09:14:18 -040011 'checkout',
Robert Iannucci297a7ef2017-05-12 19:09:38 -070012 'recipe_engine/context',
Eric Borenb7023162018-05-04 13:46:15 -040013 'recipe_engine/file',
Eric Boren4c7754c2017-04-10 08:19:10 -040014 'recipe_engine/json',
borenet1ed2ae42016-07-26 11:52:17 -070015 'recipe_engine/path',
16 'recipe_engine/platform',
17 'recipe_engine/properties',
Eric Boren4c7754c2017-04-10 08:19:10 -040018 'recipe_engine/python',
19 'recipe_engine/step',
Eric Boren4c7754c2017-04-10 08:19:10 -040020 'run',
21 'vars',
borenet1ed2ae42016-07-26 11:52:17 -070022]
23
24
borenet1ed2ae42016-07-26 11:52:17 -070025def RunSteps(api):
Eric Borenb7023162018-05-04 13:46:15 -040026 api.vars.setup()
27
Eric Boren58d1f762019-07-19 08:07:44 -040028 checkout_root = api.path['start_dir']
29 out_dir = api.vars.cache_dir.join(
30 'work', 'skia', 'out', api.vars.builder_name, api.vars.configuration)
Eric Boren72f66682018-05-18 07:36:55 -040031
Eric Boren4c7754c2017-04-10 08:19:10 -040032 try:
Eric Boren72f66682018-05-18 07:36:55 -040033 api.build(checkout_root=checkout_root, out_dir=out_dir)
34
35 # TODO(borenet): Move this out of the try/finally.
Eric Boren322a8592018-06-01 10:08:53 -040036 dst = api.vars.swarming_out_dir
Eric Boren72f66682018-05-18 07:36:55 -040037 api.build.copy_build_products(out_dir=out_dir, dst=dst)
Eric Boren4c7754c2017-04-10 08:19:10 -040038 finally:
39 if 'Win' in api.vars.builder_cfg.get('os', ''):
40 api.python.inline(
41 name='cleanup',
42 program='''import psutil
43for p in psutil.process_iter():
44 try:
45 if p.name in ('mspdbsrv.exe', 'vctip.exe', 'cl.exe', 'link.exe'):
46 p.kill()
47 except psutil._error.AccessDenied:
48 pass
49''',
50 infra_step=True)
51
Eric Boren4c7754c2017-04-10 08:19:10 -040052 api.run.check_failure()
53
54
Eric Borenf9aa9e52017-04-10 09:56:10 -040055TEST_BUILDERS = [
Ben Wagner2a5931e2018-03-20 17:13:32 -040056 'Build-Win-Clang-x86-Debug',
Eric Borenf9aa9e52017-04-10 09:56:10 -040057]
borenet1ed2ae42016-07-26 11:52:17 -070058
59
60def GenTests(api):
Eric Borenf9aa9e52017-04-10 09:56:10 -040061 for builder in TEST_BUILDERS:
62 test = (
63 api.test(builder) +
64 api.properties(buildername=builder,
Eric Boren4c7754c2017-04-10 08:19:10 -040065 repository='https://skia.googlesource.com/skia.git',
66 revision='abc123',
67 path_config='kitchen',
Eric Borenf9aa9e52017-04-10 09:56:10 -040068 swarm_out_dir='[SWARM_OUT_DIR]') +
Eric Boren4c7754c2017-04-10 08:19:10 -040069 api.path.exists(
70 api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
Eric Borenf9aa9e52017-04-10 09:56:10 -040071 )
72 )
Ben Wagnera0dbedf2019-04-24 14:14:27 -040073 if 'Win' in builder:
74 test += api.platform('win', 64)
Kevin Lubickfe079d42017-04-12 08:31:48 -040075 yield test