Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 # pylint: disable=W0201 | 6 # pylint: disable=W0201 |
| 7 | 7 |
| 8 | 8 |
| 9 from recipe_engine import recipe_api | 9 from recipe_engine import recipe_api |
| 10 import os | 10 import os |
| 11 | 11 |
| 12 | 12 |
| 13 BOTO_CHROMIUM_SKIA_GM = 'chromium-skia-gm.boto' | 13 BOTO_CHROMIUM_SKIA_GM = 'chromium-skia-gm.boto' |
| 14 | 14 |
| 15 CONFIG_DEBUG = 'Debug' | |
| 16 CONFIG_RELEASE = 'Release' | |
| 17 | |
| 18 | |
| 19 def gyp_defines(builder_dict): | |
|
rmistry
2016/08/04 17:15:46
Should this be get_gyp_defines? gyp_defines makes
borenet
2016/08/04 17:23:40
I just copied what was in buildbot_spec.py, but ye
| |
| 20 gyp_defs = {} | |
| 21 | |
| 22 # skia_arch_type. | |
| 23 if builder_dict['role'] == 'Build': | |
| 24 arch = builder_dict['target_arch'] | |
| 25 elif builder_dict['role'] in ('Housekeeper', 'Infra'): | |
| 26 arch = None | |
| 27 else: | |
| 28 arch = builder_dict['arch'] | |
| 29 | |
| 30 arch_types = { | |
| 31 'x86': 'x86', | |
| 32 'x86_64': 'x86_64', | |
| 33 'Arm7': 'arm', | |
| 34 'Arm64': 'arm64', | |
| 35 'Mips': 'mips32', | |
| 36 'Mips64': 'mips64', | |
| 37 'MipsDSP2': 'mips32', | |
| 38 } | |
| 39 if arch in arch_types: | |
| 40 gyp_defs['skia_arch_type'] = arch_types[arch] | |
| 41 | |
| 42 # housekeeper: build shared lib. | |
| 43 if builder_dict['role'] == 'Housekeeper': | |
| 44 gyp_defs['skia_shared_lib'] = '1' | |
| 45 | |
| 46 # skia_gpu. | |
| 47 if builder_dict.get('cpu_or_gpu') == 'CPU': | |
| 48 gyp_defs['skia_gpu'] = '0' | |
| 49 | |
| 50 # skia_warnings_as_errors. | |
| 51 werr = False | |
| 52 if builder_dict['role'] == 'Build': | |
| 53 if 'Win' in builder_dict.get('os', ''): | |
| 54 if not ('GDI' in builder_dict.get('extra_config', '') or | |
| 55 'Exceptions' in builder_dict.get('extra_config', '')): | |
| 56 werr = True | |
| 57 elif ('Mac' in builder_dict.get('os', '') and | |
| 58 'Android' in builder_dict.get('extra_config', '')): | |
| 59 werr = False | |
| 60 elif 'Fast' in builder_dict.get('extra_config', ''): # pragma: no cover | |
| 61 # See https://bugs.chromium.org/p/skia/issues/detail?id=5257 | |
| 62 werr = False | |
| 63 else: | |
| 64 werr = True | |
| 65 gyp_defs['skia_warnings_as_errors'] = str(int(werr)) # True/False -> '1'/'0' | |
| 66 | |
| 67 # Win debugger. | |
| 68 if 'Win' in builder_dict.get('os', ''): | |
| 69 gyp_defs['skia_win_debuggers_path'] = 'c:/DbgHelp' | |
| 70 | |
| 71 # Qt SDK (Win). | |
| 72 if 'Win' in builder_dict.get('os', ''): | |
| 73 if builder_dict.get('os') == 'Win8': | |
| 74 gyp_defs['qt_sdk'] = 'C:/Qt/Qt5.1.0/5.1.0/msvc2012_64/' | |
| 75 else: | |
| 76 gyp_defs['qt_sdk'] = 'C:/Qt/4.8.5/' | |
| 77 | |
| 78 # ANGLE. | |
| 79 if builder_dict.get('extra_config') == 'ANGLE': # pragma: no cover | |
| 80 gyp_defs['skia_angle'] = '1' | |
| 81 if builder_dict.get('os', '') in ('Ubuntu', 'Linux'): | |
| 82 gyp_defs['use_x11'] = '1' | |
| 83 gyp_defs['chromeos'] = '0' | |
| 84 | |
| 85 # GDI. | |
| 86 if builder_dict.get('extra_config') == 'GDI': # pragma: no cover | |
| 87 gyp_defs['skia_gdi'] = '1' | |
| 88 | |
| 89 # Build with Exceptions on Windows. | |
| 90 if ('Win' in builder_dict.get('os', '') and | |
| 91 builder_dict.get('extra_config') == 'Exceptions'): # pragma: no cover | |
| 92 gyp_defs['skia_win_exceptions'] = '1' | |
| 93 | |
| 94 # iOS. | |
| 95 if (builder_dict.get('os') == 'iOS' or | |
| 96 builder_dict.get('extra_config') == 'iOS'): | |
| 97 gyp_defs['skia_os'] = 'ios' | |
| 98 | |
| 99 # Shared library build. | |
| 100 if builder_dict.get('extra_config') == 'Shared': | |
| 101 gyp_defs['skia_shared_lib'] = '1' | |
| 102 | |
| 103 # Build fastest Skia possible. | |
| 104 if builder_dict.get('extra_config') == 'Fast': # pragma: no cover | |
| 105 gyp_defs['skia_fast'] = '1' | |
| 106 | |
| 107 # PDF viewer in GM. | |
| 108 if (builder_dict.get('os') == 'Mac10.8' and | |
| 109 builder_dict.get('arch') == 'x86_64' and | |
| 110 builder_dict.get('configuration') == 'Release'): # pragma: no cover | |
| 111 gyp_defs['skia_run_pdfviewer_in_gm'] = '1' | |
| 112 | |
| 113 # Clang. | |
| 114 if builder_dict.get('compiler') == 'Clang': | |
| 115 gyp_defs['skia_clang_build'] = '1' | |
| 116 | |
| 117 # Valgrind. | |
| 118 if 'Valgrind' in builder_dict.get('extra_config', ''): | |
| 119 gyp_defs['skia_release_optimization_level'] = '1' | |
| 120 | |
| 121 # Link-time code generation just wastes time on compile-only bots. | |
| 122 if (builder_dict.get('role') == 'Build' and | |
| 123 builder_dict.get('compiler') == 'MSVC'): | |
| 124 gyp_defs['skia_win_ltcg'] = '0' | |
| 125 | |
| 126 # Mesa. | |
| 127 if (builder_dict.get('extra_config') == 'Mesa' or | |
| 128 builder_dict.get('cpu_or_gpu_value') == 'Mesa'): # pragma: no cover | |
| 129 gyp_defs['skia_mesa'] = '1' | |
| 130 | |
| 131 # skia_use_android_framework_defines. | |
| 132 if builder_dict.get('extra_config') == 'Android_FrameworkDefs': | |
| 133 gyp_defs['skia_use_android_framework_defines'] = '1' # pragma: no cover | |
| 134 | |
| 135 # Skia dump stats for perf tests and gpu | |
| 136 if (builder_dict.get('cpu_or_gpu') == 'GPU' and | |
| 137 builder_dict.get('role') == 'Perf'): | |
| 138 gyp_defs['skia_dump_stats'] = '1' | |
| 139 | |
| 140 # CommandBuffer. | |
| 141 if builder_dict.get('extra_config') == 'CommandBuffer': | |
| 142 gyp_defs['skia_command_buffer'] = '1' | |
| 143 | |
| 144 # Vulkan. | |
| 145 if builder_dict.get('extra_config') == 'Vulkan': | |
| 146 gyp_defs['skia_vulkan'] = '1' | |
| 147 gyp_defs['skia_vulkan_debug_layers'] = '0' | |
| 148 | |
| 149 return gyp_defs | |
| 150 | |
| 151 | |
| 152 def get_extra_env_vars(builder_dict): | |
| 153 env = {} | |
| 154 if builder_dict.get('configuration') == 'Coverage': | |
| 155 # We have to use Clang 3.6 because earlier versions do not support the | |
| 156 # compile flags we use and 3.7 and 3.8 hit asserts during compilation. | |
| 157 env['CC'] = '/usr/bin/clang-3.6' | |
| 158 env['CXX'] = '/usr/bin/clang++-3.6' | |
| 159 elif builder_dict.get('compiler') == 'Clang': | |
| 160 env['CC'] = '/usr/bin/clang' | |
| 161 env['CXX'] = '/usr/bin/clang++' | |
| 162 | |
| 163 # SKNX_NO_SIMD, SK_USE_DISCARDABLE_SCALEDIMAGECACHE, etc. | |
| 164 extra_config = builder_dict.get('extra_config', '') | |
| 165 if extra_config.startswith('SK') and extra_config.isupper(): | |
| 166 env['CPPFLAGS'] = '-D' + extra_config # pragma: no cover | |
| 167 | |
| 168 return env | |
| 169 | |
| 170 | |
| 171 def build_targets_from_builder_dict(builder_dict): | |
| 172 """Return a list of targets to build, depending on the builder type.""" | |
| 173 if builder_dict.get('extra_config') == 'iOS': | |
| 174 return ['iOSShell'] | |
| 175 if 'SAN' in builder_dict.get('extra_config', ''): | |
| 176 # 'most' does not compile under MSAN. | |
| 177 return ['dm', 'nanobench'] | |
| 178 else: | |
| 179 return ['most'] | |
| 180 | |
| 181 | |
| 182 def device_cfg(builder_dict): | |
| 183 # Android. | |
| 184 if 'Android' in builder_dict.get('extra_config', ''): | |
| 185 if 'NoNeon' in builder_dict['extra_config']: # pragma: no cover | |
| 186 return 'arm_v7' | |
| 187 return { | |
| 188 'Arm64': 'arm64', | |
| 189 'x86': 'x86', | |
| 190 'x86_64': 'x86_64', | |
| 191 'Mips': 'mips', | |
| 192 'Mips64': 'mips64', | |
| 193 'MipsDSP2': 'mips_dsp2', | |
| 194 }.get(builder_dict['target_arch'], 'arm_v7_neon') | |
| 195 elif builder_dict.get('os') == 'Android': | |
| 196 return { | |
| 197 'AndroidOne': 'arm_v7_neon', | |
| 198 'GalaxyS3': 'arm_v7_neon', | |
| 199 'GalaxyS4': 'arm_v7_neon', | |
| 200 'NVIDIA_Shield': 'arm64', | |
| 201 'Nexus10': 'arm_v7_neon', | |
| 202 'Nexus5': 'arm_v7_neon', | |
| 203 'Nexus6': 'arm_v7_neon', | |
| 204 'Nexus7': 'arm_v7_neon', | |
| 205 'Nexus7v2': 'arm_v7_neon', | |
| 206 'Nexus9': 'arm64', | |
| 207 'NexusPlayer': 'x86', | |
| 208 }[builder_dict['model']] | |
| 209 | |
| 210 # iOS. | |
| 211 if 'iOS' in builder_dict.get('os', ''): | |
| 212 return { | |
| 213 'iPad4': 'iPad4,1', | |
| 214 }[builder_dict['model']] | |
| 215 | |
| 216 return None | |
| 217 | |
| 218 | |
| 219 def product_board(builder_dict): | |
| 220 if 'Android' in builder_dict.get('os', ''): | |
| 221 return { | |
| 222 'AndroidOne': 'sprout', | |
| 223 'GalaxyS3': 'm0', #'smdk4x12', Detected incorrectly by swarming? | |
| 224 'GalaxyS4': None, # TODO(borenet,kjlubick) | |
| 225 'NVIDIA_Shield': 'foster', | |
| 226 'Nexus10': 'manta', | |
| 227 'Nexus5': 'hammerhead', | |
| 228 'Nexus6': 'shamu', | |
| 229 'Nexus7': 'grouper', | |
| 230 'Nexus7v2': 'flo', | |
| 231 'Nexus9': 'flounder', | |
| 232 'NexusPlayer': 'fugu', | |
| 233 }[builder_dict['model']] | |
| 234 return None | |
| 235 | |
| 236 | |
| 237 def dm_flags(bot): | |
| 238 args = [] | |
| 239 | |
| 240 # 32-bit desktop bots tend to run out of memory, because they have relatively | |
| 241 # far more cores than RAM (e.g. 32 cores, 3G RAM). Hold them back a bit. | |
| 242 if '-x86-' in bot and not 'NexusPlayer' in bot: | |
| 243 args.extend('--threads 4'.split(' ')) | |
| 244 | |
| 245 # These are the canonical configs that we would ideally run on all bots. We | |
| 246 # may opt out or substitute some below for specific bots | |
| 247 configs = ['565', '8888', 'gpu', 'gpusrgb', 'pdf'] | |
| 248 # Add in either msaa4 or msaa16 to the canonical set of configs to run | |
| 249 if 'Android' in bot or 'iOS' in bot: | |
| 250 configs.append('msaa4') | |
| 251 else: | |
| 252 configs.append('msaa16') | |
| 253 | |
| 254 # With msaa, the S4 crashes and the NP produces a long error stream when we | |
| 255 # run with MSAA. The Tegra2 and Tegra3 just don't support it. No record of | |
| 256 # why we're not running msaa on iOS, probably started with gpu config and just | |
| 257 # haven't tried. | |
| 258 if ('GalaxyS4' in bot or | |
| 259 'NexusPlayer' in bot or | |
| 260 'Tegra3' in bot or | |
| 261 'iOS' in bot): | |
| 262 configs = [x for x in configs if 'msaa' not in x] | |
| 263 | |
| 264 # Runs out of memory on Android bots and Daisy. Everyone else seems fine. | |
| 265 if 'Android' in bot or 'Daisy' in bot: | |
| 266 configs.remove('pdf') | |
| 267 | |
| 268 if '-GCE-' in bot: | |
| 269 configs.extend(['f16', 'srgb']) # Gamma-correct formats. | |
| 270 configs.extend(['sp-8888', '2ndpic-8888']) # Test niche uses of SkPicture. | |
| 271 | |
| 272 if '-TSAN' not in bot: | |
| 273 if ('TegraK1' in bot or | |
| 274 'TegraX1' in bot or | |
| 275 'GTX550Ti' in bot or | |
| 276 'GTX660' in bot or | |
| 277 'GT610' in bot): | |
| 278 if 'Android' in bot: | |
| 279 configs.append('nvprdit4') | |
| 280 else: | |
| 281 configs.append('nvprdit16') | |
| 282 | |
| 283 # We want to test the OpenGL config not the GLES config on the X1 | |
| 284 if 'TegraX1' in bot: | |
| 285 configs = [x.replace('gpu', 'gl') for x in configs] | |
| 286 configs = [x.replace('msaa', 'glmsaa') for x in configs] | |
| 287 configs = [x.replace('nvpr', 'glnvpr') for x in configs] | |
| 288 | |
| 289 # NP is running out of RAM when we run all these modes. skia:3255 | |
| 290 if 'NexusPlayer' not in bot: | |
| 291 configs.extend(mode + '-8888' for mode in | |
| 292 ['serialize', 'tiles_rt', 'pic']) | |
| 293 | |
| 294 if 'ANGLE' in bot: # pragma: no cover | |
| 295 configs.append('angle') | |
| 296 | |
| 297 # We want to run gpudft on atleast the mali 400 | |
| 298 if 'GalaxyS3' in bot: | |
| 299 configs.append('gpudft') | |
| 300 | |
| 301 # Test instanced rendering on a limited number of platforms | |
| 302 if 'Nexus6' in bot: # pragma: no cover | |
| 303 configs.append('esinst') # esinst4 isn't working yet on Adreno. | |
| 304 elif 'TegraX1' in bot: | |
| 305 # Multisampled instanced configs use nvpr. | |
| 306 configs = [x.replace('glnvpr', 'glinst') for x in configs] | |
| 307 configs.append('glinst') | |
| 308 elif 'MacMini6.2' in bot: | |
| 309 configs.extend(['glinst', 'glinst16']) | |
| 310 | |
| 311 # CommandBuffer bot *only* runs the command_buffer config. | |
| 312 if 'CommandBuffer' in bot: | |
| 313 configs = ['commandbuffer'] | |
| 314 | |
| 315 # Vulkan bot *only* runs the vk config. | |
| 316 if 'Vulkan' in bot: | |
| 317 configs = ['vk'] | |
| 318 | |
| 319 args.append('--config') | |
| 320 args.extend(configs) | |
| 321 | |
| 322 # Run tests, gms, and image decoding tests everywhere. | |
| 323 args.extend('--src tests gm image'.split(' ')) | |
| 324 | |
| 325 if 'GalaxyS' in bot: | |
| 326 args.extend(('--threads', '0')) | |
| 327 | |
| 328 blacklist = [] | |
| 329 | |
| 330 # TODO: ??? | |
| 331 blacklist.extend('f16 _ _ dstreadshuffle'.split(' ')) | |
| 332 blacklist.extend('f16 image _ _'.split(' ')) | |
| 333 blacklist.extend('srgb image _ _'.split(' ')) | |
| 334 blacklist.extend('gpusrgb image _ _'.split(' ')) | |
| 335 | |
| 336 if 'Valgrind' in bot: | |
| 337 # These take 18+ hours to run. | |
| 338 blacklist.extend('pdf gm _ fontmgr_iter'.split(' ')) | |
| 339 blacklist.extend('pdf _ _ PANO_20121023_214540.jpg'.split(' ')) | |
| 340 blacklist.extend('pdf skp _ worldjournal'.split(' ')) | |
| 341 blacklist.extend('pdf skp _ desk_baidu.skp'.split(' ')) | |
| 342 blacklist.extend('pdf skp _ desk_wikipedia.skp'.split(' ')) | |
| 343 | |
| 344 if 'iOS' in bot: | |
| 345 blacklist.extend('gpu skp _ _ msaa skp _ _'.split(' ')) | |
| 346 blacklist.extend('msaa16 gm _ tilemodesProcess'.split(' ')) | |
| 347 | |
| 348 if 'Mac' in bot or 'iOS' in bot: | |
| 349 # CG fails on questionable bmps | |
| 350 blacklist.extend('_ image gen_platf rgba32abf.bmp'.split(' ')) | |
| 351 blacklist.extend('_ image gen_platf rgb24prof.bmp'.split(' ')) | |
| 352 blacklist.extend('_ image gen_platf rgb24lprof.bmp'.split(' ')) | |
| 353 blacklist.extend('_ image gen_platf 8bpp-pixeldata-cropped.bmp'.split(' ')) | |
| 354 blacklist.extend('_ image gen_platf 4bpp-pixeldata-cropped.bmp'.split(' ')) | |
| 355 blacklist.extend('_ image gen_platf 32bpp-pixeldata-cropped.bmp'.split(' ')) | |
| 356 blacklist.extend('_ image gen_platf 24bpp-pixeldata-cropped.bmp'.split(' ')) | |
| 357 | |
| 358 # CG has unpredictable behavior on this questionable gif | |
| 359 # It's probably using uninitialized memory | |
| 360 blacklist.extend('_ image gen_platf frame_larger_than_image.gif'.split(' ')) | |
| 361 | |
| 362 # WIC fails on questionable bmps | |
| 363 if 'Win' in bot: | |
| 364 blacklist.extend('_ image gen_platf rle8-height-negative.bmp'.split(' ')) | |
| 365 blacklist.extend('_ image gen_platf rle4-height-negative.bmp'.split(' ')) | |
| 366 blacklist.extend('_ image gen_platf pal8os2v2.bmp'.split(' ')) | |
| 367 blacklist.extend('_ image gen_platf pal8os2v2-16.bmp'.split(' ')) | |
| 368 blacklist.extend('_ image gen_platf rgba32abf.bmp'.split(' ')) | |
| 369 blacklist.extend('_ image gen_platf rgb24prof.bmp'.split(' ')) | |
| 370 blacklist.extend('_ image gen_platf rgb24lprof.bmp'.split(' ')) | |
| 371 blacklist.extend('_ image gen_platf 8bpp-pixeldata-cropped.bmp'.split(' ')) | |
| 372 blacklist.extend('_ image gen_platf 4bpp-pixeldata-cropped.bmp'.split(' ')) | |
| 373 blacklist.extend('_ image gen_platf 32bpp-pixeldata-cropped.bmp'.split(' ')) | |
| 374 blacklist.extend('_ image gen_platf 24bpp-pixeldata-cropped.bmp'.split(' ')) | |
| 375 if 'x86_64' in bot and 'CPU' in bot: | |
| 376 # This GM triggers a SkSmallAllocator assert. | |
| 377 blacklist.extend('_ gm _ composeshader_bitmap'.split(' ')) | |
| 378 | |
| 379 if 'Android' in bot or 'iOS' in bot: | |
| 380 # This test crashes the N9 (perhaps because of large malloc/frees). It also | |
| 381 # is fairly slow and not platform-specific. So we just disable it on all of | |
| 382 # Android and iOS. skia:5438 | |
| 383 blacklist.extend('_ test _ GrShape'.split(' ')) | |
| 384 | |
| 385 if 'Win8' in bot: | |
| 386 # bungeman: "Doesn't work on Windows anyway, produces unstable GMs with | |
| 387 # 'Unexpected error' from DirectWrite" | |
| 388 blacklist.extend('_ gm _ fontscalerdistortable'.split(' ')) | |
| 389 | |
| 390 # skia:4095 | |
| 391 bad_serialize_gms = ['bleed_image', | |
| 392 'c_gms', | |
| 393 'colortype', | |
| 394 'colortype_xfermodes', | |
| 395 'drawfilter', | |
| 396 'fontmgr_bounds_0.75_0', | |
| 397 'fontmgr_bounds_1_-0.25', | |
| 398 'fontmgr_bounds', | |
| 399 'fontmgr_match', | |
| 400 'fontmgr_iter'] | |
| 401 | |
| 402 # skia:5589 | |
| 403 bad_serialize_gms.extend(['bitmapfilters', | |
| 404 'bitmapshaders', | |
| 405 'bleed', | |
| 406 'bleed_alpha_bmp', | |
| 407 'bleed_alpha_bmp_shader', | |
| 408 'convex_poly_clip', | |
| 409 'extractalpha', | |
| 410 'filterbitmap_checkerboard_32_32_g8', | |
| 411 'filterbitmap_image_mandrill_64', | |
| 412 'shadows', | |
| 413 'simpleaaclip_aaclip']) | |
| 414 for test in bad_serialize_gms: | |
| 415 blacklist.extend(['serialize-8888', 'gm', '_', test]) | |
| 416 | |
| 417 if 'Mac' not in bot: | |
| 418 for test in ['bleed_alpha_image', 'bleed_alpha_image_shader']: | |
| 419 blacklist.extend(['serialize-8888', 'gm', '_', test]) | |
| 420 # It looks like we skip these only for out-of-memory concerns. | |
| 421 if 'Win' in bot or 'Android' in bot: | |
| 422 for test in ['verylargebitmap', 'verylarge_picture_image']: | |
| 423 blacklist.extend(['serialize-8888', 'gm', '_', test]) | |
| 424 | |
| 425 # skia:4769 | |
| 426 for test in ['drawfilter']: | |
| 427 blacklist.extend([ 'sp-8888', 'gm', '_', test]) | |
| 428 blacklist.extend([ 'pic-8888', 'gm', '_', test]) | |
| 429 blacklist.extend(['2ndpic-8888', 'gm', '_', test]) | |
| 430 # skia:4703 | |
| 431 for test in ['image-cacherator-from-picture', | |
| 432 'image-cacherator-from-raster', | |
| 433 'image-cacherator-from-ctable']: | |
| 434 blacklist.extend([ 'sp-8888', 'gm', '_', test]) | |
| 435 blacklist.extend([ 'pic-8888', 'gm', '_', test]) | |
| 436 blacklist.extend([ '2ndpic-8888', 'gm', '_', test]) | |
| 437 blacklist.extend(['serialize-8888', 'gm', '_', test]) | |
| 438 | |
| 439 # Extensions for RAW images | |
| 440 r = ["arw", "cr2", "dng", "nef", "nrw", "orf", "raf", "rw2", "pef", "srw", | |
| 441 "ARW", "CR2", "DNG", "NEF", "NRW", "ORF", "RAF", "RW2", "PEF", "SRW"] | |
| 442 | |
| 443 # skbug.com/4888 | |
| 444 # Blacklist RAW images (and a few large PNGs) on GPU bots | |
| 445 # until we can resolve failures | |
| 446 if 'GPU' in bot: | |
| 447 blacklist.extend('_ image _ interlaced1.png'.split(' ')) | |
| 448 blacklist.extend('_ image _ interlaced2.png'.split(' ')) | |
| 449 blacklist.extend('_ image _ interlaced3.png'.split(' ')) | |
| 450 for raw_ext in r: | |
| 451 blacklist.extend(('_ image _ .%s' % raw_ext).split(' ')) | |
| 452 | |
| 453 if 'Nexus9' in bot: # pragma: no cover | |
| 454 for raw_ext in r: | |
| 455 blacklist.extend(('_ image _ .%s' % raw_ext).split(' ')) | |
| 456 | |
| 457 # Large image that overwhelms older Mac bots | |
| 458 if 'MacMini4.1-GPU' in bot: # pragma: no cover | |
| 459 blacklist.extend('_ image _ abnormal.wbmp'.split(' ')) | |
| 460 blacklist.extend(['msaa16', 'gm', '_', 'blurcircles']) | |
| 461 | |
| 462 match = [] | |
| 463 if 'Valgrind' in bot: # skia:3021 | |
| 464 match.append('~Threaded') | |
| 465 | |
| 466 if 'GalaxyS3' in bot: # skia:1699 | |
| 467 match.append('~WritePixels') | |
| 468 | |
| 469 if 'AndroidOne' in bot: # skia:4711 | |
| 470 match.append('~WritePixels') # pragma: no cover | |
| 471 | |
| 472 if 'NexusPlayer' in bot: # pragma: no cover | |
| 473 match.append('~ResourceCache') | |
| 474 | |
| 475 if 'Nexus10' in bot: # skia:5509 | |
| 476 match.append('~CopySurface') # pragma: no cover | |
| 477 | |
| 478 if 'ANGLE' in bot and 'Debug' in bot: # pragma: no cover | |
| 479 match.append('~GLPrograms') # skia:4717 | |
| 480 | |
| 481 if 'MSAN' in bot: | |
| 482 match.extend(['~Once', '~Shared']) # Not sure what's up with these tests. | |
| 483 | |
| 484 if 'TSAN' in bot: # pragma: no cover | |
| 485 match.extend(['~ReadWriteAlpha']) # Flaky on TSAN-covered on nvidia bots. | |
| 486 | |
| 487 if blacklist: | |
| 488 args.append('--blacklist') | |
| 489 args.extend(blacklist) | |
| 490 | |
| 491 if match: | |
| 492 args.append('--match') | |
| 493 args.extend(match) | |
| 494 | |
| 495 # These bots run out of memory running RAW codec tests. Do not run them in | |
| 496 # parallel | |
| 497 if ('NexusPlayer' in bot or 'Nexus5' in bot or 'Nexus9' in bot | |
| 498 or 'Win8-MSVC-ShuttleB' in bot): | |
| 499 args.append('--noRAW_threading') | |
| 500 | |
| 501 return args | |
| 502 | |
| 503 | |
| 504 def get_builder_spec(api, builder_name): | |
| 505 builder_dict = api.builder_name_schema.DictForBuilderName(builder_name) | |
| 506 env = get_extra_env_vars(builder_dict) | |
| 507 gyp_defs = gyp_defines(builder_dict) | |
| 508 gyp_defs_list = ['%s=%s' % (k, v) for k, v in gyp_defs.iteritems()] | |
| 509 gyp_defs_list.sort() | |
| 510 env['GYP_DEFINES'] = ' '.join(gyp_defs_list) | |
| 511 | |
| 512 build_targets = build_targets_from_builder_dict(builder_dict) | |
| 513 rv = { | |
| 514 'build_targets': build_targets, | |
| 515 'builder_cfg': builder_dict, | |
| 516 'dm_flags': dm_flags(builder_name), | |
| 517 'env': env, | |
| 518 'nanobench_flags': nanobench_flags(builder_name), | |
| 519 } | |
| 520 device = device_cfg(builder_dict) | |
| 521 if device: | |
| 522 rv['device_cfg'] = device | |
| 523 board = product_board(builder_dict) | |
| 524 if board: | |
| 525 rv['product.board'] = board | |
| 526 | |
| 527 role = builder_dict['role'] | |
| 528 if role == api.builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: | |
| 529 configuration = CONFIG_RELEASE | |
| 530 else: | |
| 531 configuration = builder_dict.get('configuration', CONFIG_DEBUG) | |
| 532 arch = (builder_dict.get('arch') or builder_dict.get('target_arch')) | |
| 533 if ('Win' in builder_dict.get('os', '') and arch == 'x86_64'): | |
| 534 configuration += '_x64' | |
| 535 rv['configuration'] = configuration | |
| 536 if configuration == 'Coverage': | |
| 537 rv['do_compile_steps'] = False | |
| 538 rv['do_test_steps'] = role == api.builder_name_schema.BUILDER_ROLE_TEST | |
| 539 rv['do_perf_steps'] = role == api.builder_name_schema.BUILDER_ROLE_PERF | |
| 540 | |
| 541 # Do we upload perf results? | |
| 542 upload_perf_results = False | |
| 543 if (role == api.builder_name_schema.BUILDER_ROLE_PERF and | |
| 544 CONFIG_RELEASE in configuration): | |
| 545 upload_perf_results = True | |
| 546 rv['upload_perf_results'] = upload_perf_results | |
| 547 | |
| 548 # Do we upload correctness results? | |
| 549 skip_upload_bots = [ | |
| 550 'ASAN', | |
| 551 'Coverage', | |
| 552 'MSAN', | |
| 553 'TSAN', | |
| 554 'UBSAN', | |
| 555 'Valgrind', | |
| 556 ] | |
| 557 upload_dm_results = True | |
| 558 for s in skip_upload_bots: | |
| 559 if s in builder_name: | |
| 560 upload_dm_results = False | |
| 561 break | |
| 562 rv['upload_dm_results'] = upload_dm_results | |
| 563 | |
| 564 return rv | |
| 565 | |
| 566 | |
| 567 def nanobench_flags(bot): | |
| 568 args = ['--pre_log'] | |
| 569 | |
| 570 if 'GPU' in bot: | |
| 571 args.append('--images') | |
| 572 args.extend(['--gpuStatsDump', 'true']) | |
| 573 | |
| 574 if 'Android' in bot and 'GPU' in bot: | |
| 575 args.extend(['--useThermalManager', '1,1,10,1000']) | |
| 576 | |
| 577 args.extend(['--scales', '1.0', '1.1']) | |
| 578 | |
| 579 if 'iOS' in bot: | |
| 580 args.extend(['--skps', 'ignore_skps']) | |
| 581 | |
| 582 config = ['565', '8888', 'gpu', 'nonrendering', 'angle', 'hwui' ] | |
| 583 config += [ 'f16', 'srgb' ] | |
| 584 # The S4 crashes and the NP produces a long error stream when we run with | |
| 585 # MSAA. | |
| 586 if ('GalaxyS4' not in bot and | |
| 587 'NexusPlayer' not in bot): | |
| 588 if 'Android' in bot: | |
| 589 # The TegraX1 has a regular OpenGL implementation. We bench that instead | |
| 590 # of ES. | |
| 591 if 'TegraX1' in bot: | |
| 592 config.remove('gpu') | |
| 593 config.extend(['gl', 'glmsaa4', 'glnvpr4', 'glnvprdit4']) | |
| 594 else: | |
| 595 config.extend(['msaa4', 'nvpr4', 'nvprdit4']) | |
| 596 else: | |
| 597 config.extend(['msaa16', 'nvpr16', 'nvprdit16']) | |
| 598 | |
| 599 # Bench instanced rendering on a limited number of platforms | |
| 600 if 'Nexus6' in bot: # pragma: no cover | |
| 601 config.append('esinst') # esinst4 isn't working yet on Adreno. | |
| 602 elif 'TegraX1' in bot: | |
| 603 config.extend(['glinst', 'glinst4']) | |
| 604 elif 'MacMini6.2' in bot: | |
| 605 config.extend(['glinst', 'glinst16']) | |
| 606 | |
| 607 if 'Vulkan' in bot: | |
| 608 config = ['vk'] | |
| 609 | |
| 610 args.append('--config') | |
| 611 args.extend(config) | |
| 612 | |
| 613 if 'Valgrind' in bot: | |
| 614 # Don't care about Valgrind performance. | |
| 615 args.extend(['--loops', '1']) | |
| 616 args.extend(['--samples', '1']) | |
| 617 # Ensure that the bot framework does not think we have timed out. | |
| 618 args.extend(['--keepAlive', 'true']) | |
| 619 | |
| 620 match = [] | |
| 621 if 'Android' in bot: | |
| 622 # Segfaults when run as GPU bench. Very large texture? | |
| 623 match.append('~blurroundrect') | |
| 624 match.append('~patch_grid') # skia:2847 | |
| 625 match.append('~desk_carsvg') | |
| 626 if 'NexusPlayer' in bot: # pragma: no cover | |
| 627 match.append('~desk_unicodetable') | |
| 628 if 'Nexus5' in bot: # pragma: no cover | |
| 629 match.append('~keymobi_shop_mobileweb_ebay_com.skp') # skia:5178 | |
| 630 if 'iOS' in bot: | |
| 631 match.append('~blurroundrect') | |
| 632 match.append('~patch_grid') # skia:2847 | |
| 633 match.append('~desk_carsvg') | |
| 634 match.append('~keymobi') | |
| 635 match.append('~path_hairline') | |
| 636 match.append('~GLInstancedArraysBench') # skia:4714 | |
| 637 | |
| 638 # the 32-bit GCE bots run out of memory in DM when running these large images | |
| 639 # so defensively disable them in nanobench, too. | |
| 640 # FIXME (scroggo): This may have just been due to SkImageDecoder's | |
| 641 # buildTileIndex leaking memory (https://bug.skia.org/4360). That is | |
| 642 # disabled by default for nanobench, so we may not need this. | |
| 643 # FIXME (scroggo): Share image blacklists between dm and nanobench? | |
| 644 if 'x86' in bot and not 'x86-64' in bot: | |
| 645 match.append('~interlaced1.png') | |
| 646 match.append('~interlaced2.png') | |
| 647 match.append('~interlaced3.png') | |
| 648 | |
| 649 # This low-end Android bot crashes about 25% of the time while running the | |
| 650 # (somewhat intense) shapes benchmarks. | |
| 651 if 'Perf-Android-GCC-GalaxyS3-GPU-Mali400-Arm7-Release' in bot: | |
| 652 match.append('~shapes_') # pragma: no cover | |
| 653 | |
| 654 # We do not need or want to benchmark the decodes of incomplete images. | |
| 655 # In fact, in nanobench we assert that the full image decode succeeds. | |
| 656 match.append('~inc0.gif') | |
| 657 match.append('~inc1.gif') | |
| 658 match.append('~incInterlaced.gif') | |
| 659 match.append('~inc0.jpg') | |
| 660 match.append('~incGray.jpg') | |
| 661 match.append('~inc0.wbmp') | |
| 662 match.append('~inc1.wbmp') | |
| 663 match.append('~inc0.webp') | |
| 664 match.append('~inc1.webp') | |
| 665 match.append('~inc0.ico') | |
| 666 match.append('~inc1.ico') | |
| 667 match.append('~inc0.png') | |
| 668 match.append('~inc1.png') | |
| 669 match.append('~inc2.png') | |
| 670 match.append('~inc12.png') | |
| 671 match.append('~inc13.png') | |
| 672 match.append('~inc14.png') | |
| 673 match.append('~inc0.webp') | |
| 674 match.append('~inc1.webp') | |
| 675 | |
| 676 if match: | |
| 677 args.append('--match') | |
| 678 args.extend(match) | |
| 679 | |
| 680 return args | |
| 681 | |
| 15 | 682 |
| 16 class SkiaVarsApi(recipe_api.RecipeApi): | 683 class SkiaVarsApi(recipe_api.RecipeApi): |
| 17 | 684 |
| 18 def make_path(self, *path): | 685 def make_path(self, *path): |
| 19 """Return a Path object for the given path.""" | 686 """Return a Path object for the given path.""" |
| 20 key = 'custom_%s' % '_'.join(path) | 687 key = 'custom_%s' % '_'.join(path) |
| 21 self.m.path.c.base_paths[key] = tuple(path) | 688 self.m.path.c.base_paths[key] = tuple(path) |
| 22 return self.m.path[key] | 689 return self.m.path[key] |
| 23 | 690 |
| 24 def gsutil_env(self, boto_file): | 691 def gsutil_env(self, boto_file): |
| 25 """Environment variables for gsutil.""" | 692 """Environment variables for gsutil.""" |
| 26 boto_path = None | 693 boto_path = None |
| 27 if boto_file: | 694 if boto_file: |
| 28 boto_path = self.m.path.join(self.home_dir, boto_file) | 695 boto_path = self.m.path.join(self.home_dir, boto_file) |
| 29 return {'AWS_CREDENTIAL_FILE': boto_path, | 696 return {'AWS_CREDENTIAL_FILE': boto_path, |
| 30 'BOTO_CONFIG': boto_path} | 697 'BOTO_CONFIG': boto_path} |
| 31 | 698 |
| 32 @property | 699 @property |
| 33 def home_dir(self): | 700 def home_dir(self): |
| 34 """Find the home directory.""" | 701 """Find the home directory.""" |
| 35 home_dir = os.path.expanduser('~') | 702 home_dir = os.path.expanduser('~') |
| 36 if self._test_data.enabled: | 703 if self._test_data.enabled: |
| 37 home_dir = '[HOME]' | 704 home_dir = '[HOME]' |
| 38 return home_dir | 705 return home_dir |
| 39 | 706 |
| 707 def get_builder_spec(self, builder_name): | |
| 708 """Return the builder_spec for the given builder name.""" | |
| 709 return get_builder_spec(self.m, builder_name) | |
| 710 | |
| 40 def setup(self): | 711 def setup(self): |
| 41 """Prepare the variables.""" | 712 """Prepare the variables.""" |
| 42 # Setup | 713 # Setup |
| 43 self.builder_name = self.m.properties['buildername'] | 714 self.builder_name = self.m.properties['buildername'] |
| 44 self.master_name = self.m.properties['mastername'] | 715 self.master_name = self.m.properties['mastername'] |
| 45 self.slave_name = self.m.properties['slavename'] | 716 self.slave_name = self.m.properties['slavename'] |
| 46 self.build_number = self.m.properties['buildnumber'] | 717 self.build_number = self.m.properties['buildnumber'] |
| 47 | 718 |
| 48 self.slave_dir = self.m.path['slave_build'] | 719 self.slave_dir = self.m.path['slave_build'] |
| 49 self.checkout_root = self.slave_dir | 720 self.checkout_root = self.slave_dir |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 self.patchset = self.m.properties['patchset'] | 806 self.patchset = self.m.properties['patchset'] |
| 136 self.rietveld = self.m.properties['rietveld'] | 807 self.rietveld = self.m.properties['rietveld'] |
| 137 self.upload_dm_results = self.builder_spec['upload_dm_results'] | 808 self.upload_dm_results = self.builder_spec['upload_dm_results'] |
| 138 self.upload_perf_results = self.builder_spec['upload_perf_results'] | 809 self.upload_perf_results = self.builder_spec['upload_perf_results'] |
| 139 self.dm_dir = self.m.path.join( | 810 self.dm_dir = self.m.path.join( |
| 140 self.swarming_out_dir, 'dm') | 811 self.swarming_out_dir, 'dm') |
| 141 self.perf_data_dir = self.m.path.join(self.swarming_out_dir, | 812 self.perf_data_dir = self.m.path.join(self.swarming_out_dir, |
| 142 'perfdata', self.builder_name, 'data') | 813 'perfdata', self.builder_name, 'data') |
| 143 self.dm_flags = self.builder_spec['dm_flags'] | 814 self.dm_flags = self.builder_spec['dm_flags'] |
| 144 self.nanobench_flags = self.builder_spec['nanobench_flags'] | 815 self.nanobench_flags = self.builder_spec['nanobench_flags'] |
| OLD | NEW |