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