Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: infra/bots/recipes/swarm_compile.py

Issue 2205473002: [recipes] Separate builder_spec into compile/test/perf recipes (Closed) Base URL: https://skia.googlesource.com/skia.git@test_perf_steps
Patch Set: rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « infra/bots/recipe_modules/vars/api.py ('k') | infra/bots/recipes/swarm_perf.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 5
6 # Recipe module for Skia Swarming compile. 6 # Recipe module for Skia Swarming compile.
7 7
8 8
9 DEPS = [ 9 DEPS = [
10 'core', 10 'core',
(...skipping 10 matching lines...) Expand all
21 21
22 TEST_BUILDERS = { 22 TEST_BUILDERS = {
23 'client.skia.compile': { 23 'client.skia.compile': {
24 'skiabot-linux-swarm-000': [ 24 'skiabot-linux-swarm-000': [
25 'Build-Mac-Clang-Arm7-Debug-Android', 25 'Build-Mac-Clang-Arm7-Debug-Android',
26 'Build-Mac-Clang-Arm7-Release-iOS', 26 'Build-Mac-Clang-Arm7-Release-iOS',
27 'Build-Mac-Clang-x86_64-Debug-CommandBuffer', 27 'Build-Mac-Clang-x86_64-Debug-CommandBuffer',
28 'Build-Mac-Clang-x86_64-Release-CMake', 28 'Build-Mac-Clang-x86_64-Release-CMake',
29 'Build-Ubuntu-Clang-x86_64-Debug-GN', 29 'Build-Ubuntu-Clang-x86_64-Debug-GN',
30 'Build-Ubuntu-GCC-Arm7-Debug-Android-Trybot', 30 'Build-Ubuntu-GCC-Arm7-Debug-Android-Trybot',
31 #'Build-Ubuntu-GCC-Arm7-Debug-Android_FrameworkDefs',
32 #'Build-Ubuntu-GCC-Arm7-Debug-Android_NoNeon',
31 'Build-Ubuntu-GCC-Arm7-Release-Android', 33 'Build-Ubuntu-GCC-Arm7-Release-Android',
32 'Build-Ubuntu-GCC-Arm7-Release-Android_Vulkan', 34 'Build-Ubuntu-GCC-Arm7-Release-Android_Vulkan',
33 'Build-Ubuntu-GCC-x86-Debug', 35 'Build-Ubuntu-GCC-x86-Debug',
34 'Build-Ubuntu-GCC-x86_64-Debug-MSAN', 36 'Build-Ubuntu-GCC-x86_64-Debug-MSAN',
35 'Build-Ubuntu-GCC-x86_64-Debug-GN', 37 'Build-Ubuntu-GCC-x86_64-Debug-GN',
38 #'Build-Ubuntu-GCC-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE',
39 #'Build-Ubuntu-GCC-x86_64-Release-ANGLE',
36 'Build-Ubuntu-GCC-x86_64-Release-CMake', 40 'Build-Ubuntu-GCC-x86_64-Release-CMake',
41 #'Build-Ubuntu-GCC-x86_64-Release-Fast',
42 #'Build-Ubuntu-GCC-x86_64-Release-Mesa',
37 'Build-Ubuntu-GCC-x86_64-Release-PDFium', 43 'Build-Ubuntu-GCC-x86_64-Release-PDFium',
38 'Build-Ubuntu-GCC-x86_64-Release-Shared', 44 'Build-Ubuntu-GCC-x86_64-Release-Shared',
39 'Build-Ubuntu-GCC-x86_64-Release-Valgrind', 45 'Build-Ubuntu-GCC-x86_64-Release-Valgrind',
40 'Build-Win-MSVC-x86-Debug', 46 'Build-Win-MSVC-x86-Debug',
47 #'Build-Win-MSVC-x86-Debug-Exceptions',
48 #'Build-Win-MSVC-x86-Release-GDI',
41 'Build-Win-MSVC-x86-Release-GN', 49 'Build-Win-MSVC-x86-Release-GN',
42 'Build-Win-MSVC-x86_64-Release-Vulkan', 50 'Build-Win-MSVC-x86_64-Release-Vulkan',
43 ], 51 ],
44 }, 52 },
45 } 53 }
46 54
47 55
56 def build_targets_from_builder_dict(builder_dict):
57 """Return a list of targets to build, depending on the builder type."""
58 if builder_dict.get('extra_config') == 'iOS':
59 return ['iOSShell']
60 if 'SAN' in builder_dict.get('extra_config', ''):
61 # 'most' does not compile under MSAN.
62 return ['dm', 'nanobench']
63 else:
64 return ['most']
65
66
67 def get_extra_env_vars(builder_dict):
68 env = {}
69 if builder_dict.get('compiler') == 'Clang':
70 env['CC'] = '/usr/bin/clang'
71 env['CXX'] = '/usr/bin/clang++'
72
73 # SKNX_NO_SIMD, SK_USE_DISCARDABLE_SCALEDIMAGECACHE, etc.
74 extra_config = builder_dict.get('extra_config', '')
75 if extra_config.startswith('SK') and extra_config.isupper():
76 env['CPPFLAGS'] = '-D' + extra_config # pragma: no cover
77
78 return env
79
80
81 def get_gyp_defines(builder_dict):
82 gyp_defs = {}
83
84 # skia_arch_type.
85 arch = builder_dict['target_arch']
86
87 arch_types = {
88 'x86': 'x86',
89 'x86_64': 'x86_64',
90 'Arm7': 'arm',
91 'Arm64': 'arm64',
92 'Mips': 'mips32',
93 'Mips64': 'mips64',
94 'MipsDSP2': 'mips32',
95 }
96 if arch in arch_types:
97 gyp_defs['skia_arch_type'] = arch_types[arch]
98
99 # skia_warnings_as_errors.
100 werr = False
101 if 'Win' in builder_dict.get('os', ''):
102 if not ('GDI' in builder_dict.get('extra_config', '') or
103 'Exceptions' in builder_dict.get('extra_config', '')):
104 werr = True
105 elif ('Mac' in builder_dict.get('os', '') and
106 'Android' in builder_dict.get('extra_config', '')):
107 werr = False
108 elif 'Fast' in builder_dict.get('extra_config', ''):
109 # See https://bugs.chromium.org/p/skia/issues/detail?id=5257
110 werr = False # pragma: no cover
111 else:
112 werr = True
113 gyp_defs['skia_warnings_as_errors'] = str(int(werr)) # True/False -> '1'/'0'
114
115 # Win debugger.
116 if 'Win' in builder_dict.get('os', ''):
117 gyp_defs['skia_win_debuggers_path'] = 'c:/DbgHelp'
118
119 # Qt SDK (Win).
120 if 'Win' in builder_dict.get('os', ''):
121 gyp_defs['qt_sdk'] = 'C:/Qt/4.8.5/'
122
123 # ANGLE.
124 if builder_dict.get('extra_config') == 'ANGLE': # pragma: no cover
125 gyp_defs['skia_angle'] = '1'
126 if builder_dict.get('os', '') in ('Ubuntu', 'Linux'):
127 gyp_defs['use_x11'] = '1'
128 gyp_defs['chromeos'] = '0'
129
130 # GDI.
131 if builder_dict.get('extra_config') == 'GDI':
132 gyp_defs['skia_gdi'] = '1' # pragma: no cover
133
134 # Build with Exceptions on Windows.
135 if ('Win' in builder_dict.get('os', '') and
136 builder_dict.get('extra_config') == 'Exceptions'):
137 gyp_defs['skia_win_exceptions'] = '1' # pragma: no cover
138
139 # iOS.
140 if (builder_dict.get('os') == 'iOS' or
141 builder_dict.get('extra_config') == 'iOS'):
142 gyp_defs['skia_os'] = 'ios'
143
144 # Shared library build.
145 if builder_dict.get('extra_config') == 'Shared':
146 gyp_defs['skia_shared_lib'] = '1'
147
148 # Build fastest Skia possible.
149 if builder_dict.get('extra_config') == 'Fast':
150 gyp_defs['skia_fast'] = '1' # pragma: no cover
151
152 # PDF viewer in GM.
153 if (builder_dict.get('os') == 'Mac10.8' and
154 builder_dict.get('arch') == 'x86_64' and
155 builder_dict.get('configuration') == 'Release'): # pragma: no cover
156 gyp_defs['skia_run_pdfviewer_in_gm'] = '1'
157
158 # Clang.
159 if builder_dict.get('compiler') == 'Clang':
160 gyp_defs['skia_clang_build'] = '1'
161
162 # Valgrind.
163 if 'Valgrind' in builder_dict.get('extra_config', ''):
164 gyp_defs['skia_release_optimization_level'] = '1'
165
166 # Link-time code generation just wastes time on compile-only bots.
167 if builder_dict.get('compiler') == 'MSVC':
168 gyp_defs['skia_win_ltcg'] = '0'
169
170 # Mesa.
171 if (builder_dict.get('extra_config') == 'Mesa' or
172 builder_dict.get('cpu_or_gpu_value') == 'Mesa'):
173 gyp_defs['skia_mesa'] = '1' # pragma: no cover
174
175 # skia_use_android_framework_defines.
176 if builder_dict.get('extra_config') == 'Android_FrameworkDefs':
177 gyp_defs['skia_use_android_framework_defines'] = '1' # pragma: no cover
178
179 # CommandBuffer.
180 if builder_dict.get('extra_config') == 'CommandBuffer':
181 gyp_defs['skia_command_buffer'] = '1'
182
183 # Vulkan.
184 if builder_dict.get('extra_config') == 'Vulkan':
185 gyp_defs['skia_vulkan'] = '1'
186 gyp_defs['skia_vulkan_debug_layers'] = '0'
187
188 return gyp_defs
189
190
48 def RunSteps(api): 191 def RunSteps(api):
49 api.core.setup() 192 api.core.setup()
50 193
51 env = api.vars.builder_spec['env'] 194 env = get_extra_env_vars(api.vars.builder_cfg)
195 gyp_defs = get_gyp_defines(api.vars.builder_cfg)
196 gyp_defs_list = ['%s=%s' % (k, v) for k, v in gyp_defs.iteritems()]
197 gyp_defs_list.sort()
198 env['GYP_DEFINES'] = ' '.join(gyp_defs_list)
52 199
53 build_targets = api.vars.builder_spec['build_targets'] 200 build_targets = build_targets_from_builder_dict(api.vars.builder_cfg)
54 201
55 try: 202 try:
56 for target in build_targets: 203 for target in build_targets:
57 api.flavor.compile(target, env=env) 204 api.flavor.compile(target, env=env)
58 api.run.copy_build_products( 205 api.run.copy_build_products(
59 api.flavor.out_dir, 206 api.flavor.out_dir,
60 api.vars.swarming_out_dir.join( 207 api.vars.swarming_out_dir.join(
61 'out', api.vars.configuration)) 208 'out', api.vars.configuration))
62 api.flavor.copy_extra_build_products(api.vars.swarming_out_dir) 209 api.flavor.copy_extra_build_products(api.vars.swarming_out_dir)
63 finally: 210 finally:
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 path_config='kitchen', 308 path_config='kitchen',
162 swarm_out_dir='[SWARM_OUT_DIR]', 309 swarm_out_dir='[SWARM_OUT_DIR]',
163 rietveld='https://codereview.chromium.org', 310 rietveld='https://codereview.chromium.org',
164 patchset=1, 311 patchset=1,
165 issue=2147533002L) + 312 issue=2147533002L) +
166 api.path.exists( 313 api.path.exists(
167 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt') 314 api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt')
168 ) + 315 ) +
169 api.platform('win', 64) 316 api.platform('win', 64)
170 ) 317 )
OLDNEW
« no previous file with comments | « infra/bots/recipe_modules/vars/api.py ('k') | infra/bots/recipes/swarm_perf.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698