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 get_gyp_defines(builder_dict): |
| 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 # skia:5595 |
| 415 bad_serialize_gms.extend(['composeshader_bitmap', |
| 416 'scaled_tilemodes_npot', |
| 417 'scaled_tilemodes']) |
| 418 for test in bad_serialize_gms: |
| 419 blacklist.extend(['serialize-8888', 'gm', '_', test]) |
| 420 |
| 421 if 'Mac' not in bot: |
| 422 for test in ['bleed_alpha_image', 'bleed_alpha_image_shader']: |
| 423 blacklist.extend(['serialize-8888', 'gm', '_', test]) |
| 424 # It looks like we skip these only for out-of-memory concerns. |
| 425 if 'Win' in bot or 'Android' in bot: |
| 426 for test in ['verylargebitmap', 'verylarge_picture_image']: |
| 427 blacklist.extend(['serialize-8888', 'gm', '_', test]) |
| 428 |
| 429 # skia:4769 |
| 430 for test in ['drawfilter']: |
| 431 blacklist.extend([ 'sp-8888', 'gm', '_', test]) |
| 432 blacklist.extend([ 'pic-8888', 'gm', '_', test]) |
| 433 blacklist.extend(['2ndpic-8888', 'gm', '_', test]) |
| 434 # skia:4703 |
| 435 for test in ['image-cacherator-from-picture', |
| 436 'image-cacherator-from-raster', |
| 437 'image-cacherator-from-ctable']: |
| 438 blacklist.extend([ 'sp-8888', 'gm', '_', test]) |
| 439 blacklist.extend([ 'pic-8888', 'gm', '_', test]) |
| 440 blacklist.extend([ '2ndpic-8888', 'gm', '_', test]) |
| 441 blacklist.extend(['serialize-8888', 'gm', '_', test]) |
| 442 |
| 443 # Extensions for RAW images |
| 444 r = ["arw", "cr2", "dng", "nef", "nrw", "orf", "raf", "rw2", "pef", "srw", |
| 445 "ARW", "CR2", "DNG", "NEF", "NRW", "ORF", "RAF", "RW2", "PEF", "SRW"] |
| 446 |
| 447 # skbug.com/4888 |
| 448 # Blacklist RAW images (and a few large PNGs) on GPU bots |
| 449 # until we can resolve failures |
| 450 if 'GPU' in bot: |
| 451 blacklist.extend('_ image _ interlaced1.png'.split(' ')) |
| 452 blacklist.extend('_ image _ interlaced2.png'.split(' ')) |
| 453 blacklist.extend('_ image _ interlaced3.png'.split(' ')) |
| 454 for raw_ext in r: |
| 455 blacklist.extend(('_ image _ .%s' % raw_ext).split(' ')) |
| 456 |
| 457 if 'Nexus9' in bot: # pragma: no cover |
| 458 for raw_ext in r: |
| 459 blacklist.extend(('_ image _ .%s' % raw_ext).split(' ')) |
| 460 |
| 461 # Large image that overwhelms older Mac bots |
| 462 if 'MacMini4.1-GPU' in bot: # pragma: no cover |
| 463 blacklist.extend('_ image _ abnormal.wbmp'.split(' ')) |
| 464 blacklist.extend(['msaa16', 'gm', '_', 'blurcircles']) |
| 465 |
| 466 match = [] |
| 467 if 'Valgrind' in bot: # skia:3021 |
| 468 match.append('~Threaded') |
| 469 |
| 470 if 'GalaxyS3' in bot: # skia:1699 |
| 471 match.append('~WritePixels') |
| 472 |
| 473 if 'AndroidOne' in bot: # skia:4711 |
| 474 match.append('~WritePixels') # pragma: no cover |
| 475 |
| 476 if 'NexusPlayer' in bot: # pragma: no cover |
| 477 match.append('~ResourceCache') |
| 478 |
| 479 if 'Nexus10' in bot: # skia:5509 |
| 480 match.append('~CopySurface') # pragma: no cover |
| 481 |
| 482 if 'ANGLE' in bot and 'Debug' in bot: # pragma: no cover |
| 483 match.append('~GLPrograms') # skia:4717 |
| 484 |
| 485 if 'MSAN' in bot: |
| 486 match.extend(['~Once', '~Shared']) # Not sure what's up with these tests. |
| 487 |
| 488 if 'TSAN' in bot: # pragma: no cover |
| 489 match.extend(['~ReadWriteAlpha']) # Flaky on TSAN-covered on nvidia bots. |
| 490 |
| 491 if blacklist: |
| 492 args.append('--blacklist') |
| 493 args.extend(blacklist) |
| 494 |
| 495 if match: |
| 496 args.append('--match') |
| 497 args.extend(match) |
| 498 |
| 499 # These bots run out of memory running RAW codec tests. Do not run them in |
| 500 # parallel |
| 501 if ('NexusPlayer' in bot or 'Nexus5' in bot or 'Nexus9' in bot |
| 502 or 'Win8-MSVC-ShuttleB' in bot): |
| 503 args.append('--noRAW_threading') |
| 504 |
| 505 return args |
| 506 |
| 507 |
| 508 def get_builder_spec(api, builder_name): |
| 509 builder_dict = api.builder_name_schema.DictForBuilderName(builder_name) |
| 510 env = get_extra_env_vars(builder_dict) |
| 511 gyp_defs = get_gyp_defines(builder_dict) |
| 512 gyp_defs_list = ['%s=%s' % (k, v) for k, v in gyp_defs.iteritems()] |
| 513 gyp_defs_list.sort() |
| 514 env['GYP_DEFINES'] = ' '.join(gyp_defs_list) |
| 515 |
| 516 build_targets = build_targets_from_builder_dict(builder_dict) |
| 517 rv = { |
| 518 'build_targets': build_targets, |
| 519 'builder_cfg': builder_dict, |
| 520 'dm_flags': dm_flags(builder_name), |
| 521 'env': env, |
| 522 'nanobench_flags': nanobench_flags(builder_name), |
| 523 } |
| 524 device = device_cfg(builder_dict) |
| 525 if device: |
| 526 rv['device_cfg'] = device |
| 527 board = product_board(builder_dict) |
| 528 if board: |
| 529 rv['product.board'] = board |
| 530 |
| 531 role = builder_dict['role'] |
| 532 if role == api.builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: |
| 533 configuration = CONFIG_RELEASE |
| 534 else: |
| 535 configuration = builder_dict.get('configuration', CONFIG_DEBUG) |
| 536 arch = (builder_dict.get('arch') or builder_dict.get('target_arch')) |
| 537 if ('Win' in builder_dict.get('os', '') and arch == 'x86_64'): |
| 538 configuration += '_x64' |
| 539 rv['configuration'] = configuration |
| 540 if configuration == 'Coverage': |
| 541 rv['do_compile_steps'] = False |
| 542 rv['do_test_steps'] = role == api.builder_name_schema.BUILDER_ROLE_TEST |
| 543 rv['do_perf_steps'] = role == api.builder_name_schema.BUILDER_ROLE_PERF |
| 544 |
| 545 # Do we upload perf results? |
| 546 upload_perf_results = False |
| 547 if (role == api.builder_name_schema.BUILDER_ROLE_PERF and |
| 548 CONFIG_RELEASE in configuration): |
| 549 upload_perf_results = True |
| 550 rv['upload_perf_results'] = upload_perf_results |
| 551 |
| 552 # Do we upload correctness results? |
| 553 skip_upload_bots = [ |
| 554 'ASAN', |
| 555 'Coverage', |
| 556 'MSAN', |
| 557 'TSAN', |
| 558 'UBSAN', |
| 559 'Valgrind', |
| 560 ] |
| 561 upload_dm_results = True |
| 562 for s in skip_upload_bots: |
| 563 if s in builder_name: |
| 564 upload_dm_results = False |
| 565 break |
| 566 rv['upload_dm_results'] = upload_dm_results |
| 567 |
| 568 return rv |
| 569 |
| 570 |
| 571 def nanobench_flags(bot): |
| 572 args = ['--pre_log'] |
| 573 |
| 574 if 'GPU' in bot: |
| 575 args.append('--images') |
| 576 args.extend(['--gpuStatsDump', 'true']) |
| 577 |
| 578 if 'Android' in bot and 'GPU' in bot: |
| 579 args.extend(['--useThermalManager', '1,1,10,1000']) |
| 580 |
| 581 args.extend(['--scales', '1.0', '1.1']) |
| 582 |
| 583 if 'iOS' in bot: |
| 584 args.extend(['--skps', 'ignore_skps']) |
| 585 |
| 586 config = ['565', '8888', 'gpu', 'nonrendering', 'angle', 'hwui' ] |
| 587 config += [ 'f16', 'srgb' ] |
| 588 # The S4 crashes and the NP produces a long error stream when we run with |
| 589 # MSAA. |
| 590 if ('GalaxyS4' not in bot and |
| 591 'NexusPlayer' not in bot): |
| 592 if 'Android' in bot: |
| 593 # The TegraX1 has a regular OpenGL implementation. We bench that instead |
| 594 # of ES. |
| 595 if 'TegraX1' in bot: |
| 596 config.remove('gpu') |
| 597 config.extend(['gl', 'glmsaa4', 'glnvpr4', 'glnvprdit4']) |
| 598 else: |
| 599 config.extend(['msaa4', 'nvpr4', 'nvprdit4']) |
| 600 else: |
| 601 config.extend(['msaa16', 'nvpr16', 'nvprdit16']) |
| 602 |
| 603 # Bench instanced rendering on a limited number of platforms |
| 604 if 'Nexus6' in bot: # pragma: no cover |
| 605 config.append('esinst') # esinst4 isn't working yet on Adreno. |
| 606 elif 'TegraX1' in bot: |
| 607 config.extend(['glinst', 'glinst4']) |
| 608 elif 'MacMini6.2' in bot: |
| 609 config.extend(['glinst', 'glinst16']) |
| 610 |
| 611 if 'Vulkan' in bot: |
| 612 config = ['vk'] |
| 613 |
| 614 args.append('--config') |
| 615 args.extend(config) |
| 616 |
| 617 if 'Valgrind' in bot: |
| 618 # Don't care about Valgrind performance. |
| 619 args.extend(['--loops', '1']) |
| 620 args.extend(['--samples', '1']) |
| 621 # Ensure that the bot framework does not think we have timed out. |
| 622 args.extend(['--keepAlive', 'true']) |
| 623 |
| 624 match = [] |
| 625 if 'Android' in bot: |
| 626 # Segfaults when run as GPU bench. Very large texture? |
| 627 match.append('~blurroundrect') |
| 628 match.append('~patch_grid') # skia:2847 |
| 629 match.append('~desk_carsvg') |
| 630 if 'NexusPlayer' in bot: # pragma: no cover |
| 631 match.append('~desk_unicodetable') |
| 632 if 'Nexus5' in bot: # pragma: no cover |
| 633 match.append('~keymobi_shop_mobileweb_ebay_com.skp') # skia:5178 |
| 634 if 'iOS' in bot: |
| 635 match.append('~blurroundrect') |
| 636 match.append('~patch_grid') # skia:2847 |
| 637 match.append('~desk_carsvg') |
| 638 match.append('~keymobi') |
| 639 match.append('~path_hairline') |
| 640 match.append('~GLInstancedArraysBench') # skia:4714 |
| 641 |
| 642 # the 32-bit GCE bots run out of memory in DM when running these large images |
| 643 # so defensively disable them in nanobench, too. |
| 644 # FIXME (scroggo): This may have just been due to SkImageDecoder's |
| 645 # buildTileIndex leaking memory (https://bug.skia.org/4360). That is |
| 646 # disabled by default for nanobench, so we may not need this. |
| 647 # FIXME (scroggo): Share image blacklists between dm and nanobench? |
| 648 if 'x86' in bot and not 'x86-64' in bot: |
| 649 match.append('~interlaced1.png') |
| 650 match.append('~interlaced2.png') |
| 651 match.append('~interlaced3.png') |
| 652 |
| 653 # This low-end Android bot crashes about 25% of the time while running the |
| 654 # (somewhat intense) shapes benchmarks. |
| 655 if 'Perf-Android-GCC-GalaxyS3-GPU-Mali400-Arm7-Release' in bot: |
| 656 match.append('~shapes_') # pragma: no cover |
| 657 |
| 658 # We do not need or want to benchmark the decodes of incomplete images. |
| 659 # In fact, in nanobench we assert that the full image decode succeeds. |
| 660 match.append('~inc0.gif') |
| 661 match.append('~inc1.gif') |
| 662 match.append('~incInterlaced.gif') |
| 663 match.append('~inc0.jpg') |
| 664 match.append('~incGray.jpg') |
| 665 match.append('~inc0.wbmp') |
| 666 match.append('~inc1.wbmp') |
| 667 match.append('~inc0.webp') |
| 668 match.append('~inc1.webp') |
| 669 match.append('~inc0.ico') |
| 670 match.append('~inc1.ico') |
| 671 match.append('~inc0.png') |
| 672 match.append('~inc1.png') |
| 673 match.append('~inc2.png') |
| 674 match.append('~inc12.png') |
| 675 match.append('~inc13.png') |
| 676 match.append('~inc14.png') |
| 677 match.append('~inc0.webp') |
| 678 match.append('~inc1.webp') |
| 679 |
| 680 if match: |
| 681 args.append('--match') |
| 682 args.extend(match) |
| 683 |
| 684 return args |
| 685 |
15 | 686 |
16 class SkiaVarsApi(recipe_api.RecipeApi): | 687 class SkiaVarsApi(recipe_api.RecipeApi): |
17 | 688 |
18 def make_path(self, *path): | 689 def make_path(self, *path): |
19 """Return a Path object for the given path.""" | 690 """Return a Path object for the given path.""" |
20 key = 'custom_%s' % '_'.join(path) | 691 key = 'custom_%s' % '_'.join(path) |
21 self.m.path.c.base_paths[key] = tuple(path) | 692 self.m.path.c.base_paths[key] = tuple(path) |
22 return self.m.path[key] | 693 return self.m.path[key] |
23 | 694 |
24 def gsutil_env(self, boto_file): | 695 def gsutil_env(self, boto_file): |
25 """Environment variables for gsutil.""" | 696 """Environment variables for gsutil.""" |
26 boto_path = None | 697 boto_path = None |
27 if boto_file: | 698 if boto_file: |
28 boto_path = self.m.path.join(self.home_dir, boto_file) | 699 boto_path = self.m.path.join(self.home_dir, boto_file) |
29 return {'AWS_CREDENTIAL_FILE': boto_path, | 700 return {'AWS_CREDENTIAL_FILE': boto_path, |
30 'BOTO_CONFIG': boto_path} | 701 'BOTO_CONFIG': boto_path} |
31 | 702 |
32 @property | 703 @property |
33 def home_dir(self): | 704 def home_dir(self): |
34 """Find the home directory.""" | 705 """Find the home directory.""" |
35 home_dir = os.path.expanduser('~') | 706 home_dir = os.path.expanduser('~') |
36 if self._test_data.enabled: | 707 if self._test_data.enabled: |
37 home_dir = '[HOME]' | 708 home_dir = '[HOME]' |
38 return home_dir | 709 return home_dir |
39 | 710 |
| 711 def get_builder_spec(self, builder_name): |
| 712 """Return the builder_spec for the given builder name.""" |
| 713 return get_builder_spec(self.m, builder_name) |
| 714 |
40 def setup(self): | 715 def setup(self): |
41 """Prepare the variables.""" | 716 """Prepare the variables.""" |
42 # Setup | 717 # Setup |
43 self.builder_name = self.m.properties['buildername'] | 718 self.builder_name = self.m.properties['buildername'] |
44 self.master_name = self.m.properties['mastername'] | 719 self.master_name = self.m.properties['mastername'] |
45 self.slave_name = self.m.properties['slavename'] | 720 self.slave_name = self.m.properties['slavename'] |
46 self.build_number = self.m.properties['buildnumber'] | 721 self.build_number = self.m.properties['buildnumber'] |
47 | 722 |
48 self.slave_dir = self.m.path['slave_build'] | 723 self.slave_dir = self.m.path['slave_build'] |
49 self.checkout_root = self.slave_dir | 724 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'] | 810 self.patchset = self.m.properties['patchset'] |
136 self.rietveld = self.m.properties['rietveld'] | 811 self.rietveld = self.m.properties['rietveld'] |
137 self.upload_dm_results = self.builder_spec['upload_dm_results'] | 812 self.upload_dm_results = self.builder_spec['upload_dm_results'] |
138 self.upload_perf_results = self.builder_spec['upload_perf_results'] | 813 self.upload_perf_results = self.builder_spec['upload_perf_results'] |
139 self.dm_dir = self.m.path.join( | 814 self.dm_dir = self.m.path.join( |
140 self.swarming_out_dir, 'dm') | 815 self.swarming_out_dir, 'dm') |
141 self.perf_data_dir = self.m.path.join(self.swarming_out_dir, | 816 self.perf_data_dir = self.m.path.join(self.swarming_out_dir, |
142 'perfdata', self.builder_name, 'data') | 817 'perfdata', self.builder_name, 'data') |
143 self.dm_flags = self.builder_spec['dm_flags'] | 818 self.dm_flags = self.builder_spec['dm_flags'] |
144 self.nanobench_flags = self.builder_spec['nanobench_flags'] | 819 self.nanobench_flags = self.builder_spec['nanobench_flags'] |
OLD | NEW |