aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots/recipe_modules/compile/api.py
diff options
context:
space:
mode:
authorGravatar Eric Boren <borenet@google.com>2017-01-13 13:37:53 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-17 12:58:30 +0000
commit6441a4645be53e124ec88b8f6c59b8ca2ca4b427 (patch)
tree91892859ad02d4267d6f494dee5284254bb9b12b /infra/bots/recipe_modules/compile/api.py
parent2103cf0ff09763aeaa35508734f765aec9b75665 (diff)
Move recipe modules to shared repo
BUG=skia:6070 Change-Id: I6c487e77ddfddb6164b983981dff5ee8ae870376 Reviewed-on: https://skia-review.googlesource.com/6946 Commit-Queue: Eric Boren <borenet@google.com> Reviewed-by: Ravi Mistry <rmistry@google.com> Reviewed-by: Stephan Altmueller <stephana@google.com>
Diffstat (limited to 'infra/bots/recipe_modules/compile/api.py')
-rw-r--r--infra/bots/recipe_modules/compile/api.py81
1 files changed, 0 insertions, 81 deletions
diff --git a/infra/bots/recipe_modules/compile/api.py b/infra/bots/recipe_modules/compile/api.py
deleted file mode 100644
index 5f332c55b5..0000000000
--- a/infra/bots/recipe_modules/compile/api.py
+++ /dev/null
@@ -1,81 +0,0 @@
-# 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.
-
-
-from recipe_engine import recipe_api
-
-
-def build_targets_from_builder_dict(builder_dict):
- """Return a list of targets to build, depending on the builder type."""
- if builder_dict.get('extra_config') == 'iOS':
- return ['iOSShell']
- return ['most']
-
-
-def get_extra_env_vars(builder_dict):
- env = {}
- if builder_dict.get('compiler') == 'Clang':
- env['CC'] = '/usr/bin/clang'
- env['CXX'] = '/usr/bin/clang++'
-
- # SKNX_NO_SIMD, SK_USE_DISCARDABLE_SCALEDIMAGECACHE, etc.
- extra_config = builder_dict.get('extra_config', '')
- if extra_config.startswith('SK') and extra_config.isupper():
- env['CPPFLAGS'] = '-D' + extra_config
-
- return env
-
-
-def get_gyp_defines(builder_dict):
- gyp_defs = {}
-
- if (builder_dict.get('os') == 'iOS' or
- builder_dict.get('extra_config') == 'iOS'):
- gyp_defs['skia_arch_type'] = 'arm'
- gyp_defs['skia_clang_build'] = '1'
- gyp_defs['skia_os'] = 'ios'
- gyp_defs['skia_warnings_as_errors'] = 1
-
- return gyp_defs
-
-
-class CompileApi(recipe_api.RecipeApi):
- def run(self):
- self.m.core.setup()
-
- env = get_extra_env_vars(self.m.vars.builder_cfg)
- gyp_defs = get_gyp_defines(self.m.vars.builder_cfg)
- gyp_defs_list = ['%s=%s' % (k, v) for k, v in gyp_defs.iteritems()]
- gyp_defs_list.sort()
- env['GYP_DEFINES'] = ' '.join(gyp_defs_list)
-
- build_targets = build_targets_from_builder_dict(self.m.vars.builder_cfg)
-
- try:
- for target in build_targets:
- self.m.flavor.compile(target, env=env)
- self.m.run.copy_build_products(
- self.m.flavor.out_dir,
- self.m.vars.swarming_out_dir.join(
- 'out', self.m.vars.configuration))
- self.m.flavor.copy_extra_build_products(self.m.vars.swarming_out_dir)
- finally:
- if 'Win' in self.m.vars.builder_cfg.get('os', ''):
- self.m.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)
-
- self.m.flavor.cleanup_steps()
- self.m.run.check_failure()