| borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 1 | # 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 | |
| 9 | DEPS = [ |
| Eric Boren | 9030b94 | 2018-05-14 12:50:38 -0400 | [diff] [blame] | 10 | 'build', |
| Eric Boren | 90f0503 | 2018-05-24 09:14:18 -0400 | [diff] [blame] | 11 | 'checkout', |
| Robert Iannucci | 297a7ef | 2017-05-12 19:09:38 -0700 | [diff] [blame] | 12 | 'recipe_engine/context', |
| Eric Boren | b702316 | 2018-05-04 13:46:15 -0400 | [diff] [blame] | 13 | 'recipe_engine/file', |
| Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 14 | 'recipe_engine/json', |
| borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 15 | 'recipe_engine/path', |
| 16 | 'recipe_engine/platform', |
| 17 | 'recipe_engine/properties', |
| Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 18 | 'recipe_engine/python', |
| 19 | 'recipe_engine/step', |
| Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 20 | 'run', |
| 21 | 'vars', |
| borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 22 | ] |
| 23 | |
| 24 | |
| borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 25 | def RunSteps(api): |
| Eric Boren | b702316 | 2018-05-04 13:46:15 -0400 | [diff] [blame] | 26 | api.vars.setup() |
| 27 | |
| Eric Boren | 58d1f76 | 2019-07-19 08:07:44 -0400 | [diff] [blame] | 28 | 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 Boren | 72f6668 | 2018-05-18 07:36:55 -0400 | [diff] [blame] | 31 | |
| Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 32 | try: |
| Eric Boren | 72f6668 | 2018-05-18 07:36:55 -0400 | [diff] [blame] | 33 | api.build(checkout_root=checkout_root, out_dir=out_dir) |
| 34 | |
| 35 | # TODO(borenet): Move this out of the try/finally. |
| Eric Boren | 322a859 | 2018-06-01 10:08:53 -0400 | [diff] [blame] | 36 | dst = api.vars.swarming_out_dir |
| Eric Boren | 72f6668 | 2018-05-18 07:36:55 -0400 | [diff] [blame] | 37 | api.build.copy_build_products(out_dir=out_dir, dst=dst) |
| Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 38 | finally: |
| 39 | if 'Win' in api.vars.builder_cfg.get('os', ''): |
| 40 | api.python.inline( |
| 41 | name='cleanup', |
| 42 | program='''import psutil |
| 43 | for 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 Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 52 | api.run.check_failure() |
| 53 | |
| 54 | |
| Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 55 | TEST_BUILDERS = [ |
| Ben Wagner | 2a5931e | 2018-03-20 17:13:32 -0400 | [diff] [blame] | 56 | 'Build-Win-Clang-x86-Debug', |
| Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 57 | ] |
| borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 58 | |
| 59 | |
| 60 | def GenTests(api): |
| Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 61 | for builder in TEST_BUILDERS: |
| 62 | test = ( |
| 63 | api.test(builder) + |
| 64 | api.properties(buildername=builder, |
| Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 65 | repository='https://skia.googlesource.com/skia.git', |
| 66 | revision='abc123', |
| 67 | path_config='kitchen', |
| Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 68 | swarm_out_dir='[SWARM_OUT_DIR]') + |
| Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 69 | api.path.exists( |
| 70 | api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt') |
| Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 71 | ) |
| 72 | ) |
| Ben Wagner | a0dbedf | 2019-04-24 14:14:27 -0400 | [diff] [blame] | 73 | if 'Win' in builder: |
| 74 | test += api.platform('win', 64) |
| Kevin Lubick | fe079d4 | 2017-04-12 08:31:48 -0400 | [diff] [blame] | 75 | yield test |