OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import json | 6 import json |
7 import os | 7 import os |
8 import re | 8 import re |
9 import sys | 9 import sys |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 def is_ios(builder_cfg): | 75 def is_ios(builder_cfg): |
76 return ('iOS' in builder_cfg.get('extra_config', '') or | 76 return ('iOS' in builder_cfg.get('extra_config', '') or |
77 builder_cfg.get('os') == 'iOS') | 77 builder_cfg.get('os') == 'iOS') |
78 | 78 |
79 | 79 |
80 def is_valgrind(builder_cfg): | 80 def is_valgrind(builder_cfg): |
81 return 'Valgrind' in builder_cfg.get('extra_config', '') | 81 return 'Valgrind' in builder_cfg.get('extra_config', '') |
82 | 82 |
83 | 83 |
84 def is_xsan(builder_cfg): | 84 def is_xsan(builder_cfg): |
85 return (builder_cfg.get('extra_config') == 'ASAN' or | 85 return ('ASAN' in builder_cfg.get('extra_config', '') or |
86 builder_cfg.get('extra_config') == 'MSAN' or | 86 'MSAN' in builder_cfg.get('extra_config', '') or |
87 builder_cfg.get('extra_config') == 'TSAN') | 87 'TSAN' in builder_cfg.get('extra_config', '')) |
88 | 88 |
89 | 89 |
90 class SkiaApi(recipe_api.RecipeApi): | 90 class SkiaApi(recipe_api.RecipeApi): |
91 | 91 |
92 def get_flavor(self, builder_cfg): | 92 def get_flavor(self, builder_cfg): |
93 """Return a flavor utils object specific to the given builder.""" | 93 """Return a flavor utils object specific to the given builder.""" |
94 if is_appurify(builder_cfg): | 94 if is_appurify(builder_cfg): |
95 return appurify_flavor.AppurifyFlavorUtils(self) | 95 return appurify_flavor.AppurifyFlavorUtils(self) |
96 elif is_android(builder_cfg): | 96 elif is_android(builder_cfg): |
97 return android_flavor.AndroidFlavorUtils(self) | 97 return android_flavor.AndroidFlavorUtils(self) |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 184 |
185 # We run through this recipe in one of two ways: | 185 # We run through this recipe in one of two ways: |
186 # 1. Normal bot: run all of the steps. | 186 # 1. Normal bot: run all of the steps. |
187 # 2. Running as a Swarming task: perform the given task only, with | 187 # 2. Running as a Swarming task: perform the given task only, with |
188 # adaptations for running within Swarming, eg. copying build results | 188 # adaptations for running within Swarming, eg. copying build results |
189 # into the correct output directory. | 189 # into the correct output directory. |
190 self.running_in_swarming = running_in_swarming | 190 self.running_in_swarming = running_in_swarming |
191 | 191 |
192 # Some bots also require a checkout of chromium. | 192 # Some bots also require a checkout of chromium. |
193 self._need_chromium_checkout = 'CommandBuffer' in self.builder_name | 193 self._need_chromium_checkout = 'CommandBuffer' in self.builder_name |
| 194 if (self.running_in_swarming and |
| 195 self.is_compile_bot and |
| 196 'SAN' in self.builder_name): |
| 197 self._need_chromium_checkout = True |
194 | 198 |
195 # Check out the Skia code. | 199 # Check out the Skia code. |
196 self.checkout_steps() | 200 self.checkout_steps() |
197 | 201 |
198 # Obtain the spec for this builder from the Skia repo. Use it to set more | 202 # Obtain the spec for this builder from the Skia repo. Use it to set more |
199 # properties. | 203 # properties. |
200 self.builder_spec = self.get_builder_spec(self.skia_dir, self.builder_name) | 204 self.builder_spec = self.get_builder_spec(self.skia_dir, self.builder_name) |
201 | 205 |
202 self.builder_cfg = self.builder_spec['builder_cfg'] | 206 self.builder_cfg = self.builder_spec['builder_cfg'] |
203 self.role = self.builder_cfg['role'] | 207 self.role = self.builder_cfg['role'] |
204 | 208 |
205 # Set some important variables. | 209 # Set some important variables. |
206 self.resource_dir = self.skia_dir.join('resources') | 210 self.resource_dir = self.skia_dir.join('resources') |
207 self.images_dir = self.slave_dir.join('images') | 211 self.images_dir = self.slave_dir.join('images') |
208 self.skia_out = self.skia_dir.join('out', self.builder_name) | 212 self.skia_out = self.skia_dir.join('out', self.builder_name) |
209 if self.running_in_swarming: | 213 if self.running_in_swarming: |
210 self.swarming_out_dir = self.m.properties['swarm_out_dir'] | 214 self.swarming_out_dir = self.make_path(self.m.properties['swarm_out_dir']) |
211 self.local_skp_dir = self.slave_dir.join('skps') | 215 self.local_skp_dir = self.slave_dir.join('skps') |
212 if not self.is_compile_bot: | 216 if not self.is_compile_bot: |
213 self.skia_out = self.slave_dir.join('out') | 217 self.skia_out = self.slave_dir.join('out') |
214 else: | 218 else: |
215 self.local_skp_dir = self.slave_dir.join('playback', 'skps') | 219 self.local_skp_dir = self.slave_dir.join('playback', 'skps') |
216 self.tmp_dir = self.m.path['slave_build'].join('tmp') | 220 self.tmp_dir = self.m.path['slave_build'].join('tmp') |
217 | 221 |
218 self.gsutil_env_chromium_skia_gm = self.gsutil_env(BOTO_CHROMIUM_SKIA_GM) | 222 self.gsutil_env_chromium_skia_gm = self.gsutil_env(BOTO_CHROMIUM_SKIA_GM) |
219 | 223 |
220 self.device_dirs = None | 224 self.device_dirs = None |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 if self.running_in_swarming: | 346 if self.running_in_swarming: |
343 checkout_kwargs['env'] = self.default_env | 347 checkout_kwargs['env'] = self.default_env |
344 update_step = self.m.gclient.checkout(gclient_config=gclient_cfg, | 348 update_step = self.m.gclient.checkout(gclient_config=gclient_cfg, |
345 cwd=self.checkout_root, | 349 cwd=self.checkout_root, |
346 **checkout_kwargs) | 350 **checkout_kwargs) |
347 | 351 |
348 self.got_revision = update_step.presentation.properties['got_revision'] | 352 self.got_revision = update_step.presentation.properties['got_revision'] |
349 self.m.tryserver.maybe_apply_issue() | 353 self.m.tryserver.maybe_apply_issue() |
350 | 354 |
351 if self._need_chromium_checkout: | 355 if self._need_chromium_checkout: |
352 self.m.gclient.runhooks() | 356 self.m.gclient.runhooks(cwd=self.checkout_root) |
353 | 357 |
354 def copy_build_products(self, src, dst): | 358 def copy_build_products(self, src, dst): |
355 """Copy whitelisted build products from src to dst.""" | 359 """Copy whitelisted build products from src to dst.""" |
356 self.m.python.inline( | 360 self.m.python.inline( |
357 name='copy build products', | 361 name='copy build products', |
358 program='''import errno | 362 program='''import errno |
359 import glob | 363 import glob |
360 import os | 364 import os |
361 import shutil | 365 import shutil |
362 import sys | 366 import sys |
(...skipping 21 matching lines...) Expand all Loading... |
384 infra_step=True) | 388 infra_step=True) |
385 | 389 |
386 def compile_steps(self, clobber=False): | 390 def compile_steps(self, clobber=False): |
387 """Run the steps to build Skia.""" | 391 """Run the steps to build Skia.""" |
388 try: | 392 try: |
389 for target in self.build_targets: | 393 for target in self.build_targets: |
390 self.flavor.compile(target) | 394 self.flavor.compile(target) |
391 if self.running_in_swarming: | 395 if self.running_in_swarming: |
392 self.copy_build_products( | 396 self.copy_build_products( |
393 self.flavor.out_dir, | 397 self.flavor.out_dir, |
394 self.m.path.join(self.swarming_out_dir, 'out', self.configuration)) | 398 self.swarming_out_dir.join('out', self.configuration)) |
| 399 self.flavor.copy_extra_build_products(self.swarming_out_dir) |
395 finally: | 400 finally: |
396 if 'Win' in self.builder_cfg.get('os', ''): | 401 if 'Win' in self.builder_cfg.get('os', ''): |
397 self.m.python.inline( | 402 self.m.python.inline( |
398 name='cleanup', | 403 name='cleanup', |
399 program='''import psutil | 404 program='''import psutil |
400 for p in psutil.process_iter(): | 405 for p in psutil.process_iter(): |
401 try: | 406 try: |
402 if p.name in ('mspdbsrv.exe', 'vctip.exe', 'cl.exe', 'link.exe'): | 407 if p.name in ('mspdbsrv.exe', 'vctip.exe', 'cl.exe', 'link.exe'): |
403 p.kill() | 408 p.kill() |
404 except psutil._error.AccessDenied: | 409 except psutil._error.AccessDenied: |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 # Don't bother to include role, which is always Test. | 893 # Don't bother to include role, which is always Test. |
889 # TryBots are uploaded elsewhere so they can use the same key. | 894 # TryBots are uploaded elsewhere so they can use the same key. |
890 blacklist = ['role', 'is_trybot'] | 895 blacklist = ['role', 'is_trybot'] |
891 | 896 |
892 flat = [] | 897 flat = [] |
893 for k in sorted(self.builder_cfg.keys()): | 898 for k in sorted(self.builder_cfg.keys()): |
894 if k not in blacklist: | 899 if k not in blacklist: |
895 flat.append(k) | 900 flat.append(k) |
896 flat.append(self.builder_cfg[k]) | 901 flat.append(self.builder_cfg[k]) |
897 return flat | 902 return flat |
OLD | NEW |