• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
9DEPS = [
10  'build',
11  'checkout',
12  'recipe_engine/context',
13  'recipe_engine/file',
14  'recipe_engine/json',
15  'recipe_engine/path',
16  'recipe_engine/platform',
17  'recipe_engine/properties',
18  'recipe_engine/python',
19  'recipe_engine/step',
20  'run',
21  'vars',
22]
23
24
25def RunSteps(api):
26  api.vars.setup()
27
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)
31
32  try:
33    api.build(checkout_root=checkout_root, out_dir=out_dir)
34
35    # TODO(borenet): Move this out of the try/finally.
36    dst = api.vars.swarming_out_dir
37    api.build.copy_build_products(out_dir=out_dir, dst=dst)
38  finally:
39    if 'Win' in api.vars.builder_cfg.get('os', ''):
40      api.python.inline(
41          name='cleanup',
42          program='''
43# [VPYTHON:BEGIN]
44# wheel: <
45#  name: "infra/python/wheels/psutil/${vpython_platform}"
46#  version: "version:5.4.7"
47# >
48# [VPYTHON:END]
49
50import psutil
51for p in psutil.process_iter():
52  try:
53    if p.name in ('mspdbsrv.exe', 'vctip.exe', 'cl.exe', 'link.exe'):
54      p.kill()
55  except psutil._error.AccessDenied:
56    pass
57''',
58          infra_step=True,
59          venv=True)
60
61  api.run.check_failure()
62
63
64TEST_BUILDERS = [
65  'Build-Win-Clang-x86-Debug',
66]
67
68
69def GenTests(api):
70  for builder in TEST_BUILDERS:
71    test = (
72      api.test(builder) +
73      api.properties(buildername=builder,
74                     repository='https://skia.googlesource.com/skia.git',
75                     revision='abc123',
76                     path_config='kitchen',
77                     swarm_out_dir='[SWARM_OUT_DIR]') +
78      api.path.exists(
79          api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
80      )
81    )
82    if 'Win' in builder:
83      test += api.platform('win', 64)
84    yield test
85