| 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 DEPS = [ | 5 DEPS = [ |
| 6 'bot_update', | 6 'bot_update', |
| 7 'chromium', | 7 'chromium', |
| 8 'gclient', | |
| 9 'path', | |
| 10 'platform', | 8 'platform', |
| 11 'properties', | 9 'properties', |
| 12 'step', | |
| 13 'tryserver', | |
| 14 ] | 10 ] |
| 15 | 11 |
| 16 | 12 |
| 17 BUILDERS = { | 13 BUILDERS = { |
| 18 'chromium.mac': { | 14 'chromium.mac': { |
| 19 'builders': { | 15 'builders': { |
| 20 'Mac GN': { | 16 'Mac GN': { |
| 21 'chromium_config_kwargs': { | 17 'chromium_config_kwargs': { |
| 22 'BUILD_CONFIG': 'Release', | 18 'BUILD_CONFIG': 'Release', |
| 23 'TARGET_PLATFORM': 'mac', | 19 'TARGET_PLATFORM': 'mac', |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 'chromium_lkcr', | 264 'chromium_lkcr', |
| 269 'show_v8_revision', | 265 'show_v8_revision', |
| 270 ], | 266 ], |
| 271 'set_component_rev': {'name': 'src/v8', 'rev_str': '%s'}, | 267 'set_component_rev': {'name': 'src/v8', 'rev_str': '%s'}, |
| 272 }, | 268 }, |
| 273 }, | 269 }, |
| 274 }, | 270 }, |
| 275 } | 271 } |
| 276 | 272 |
| 277 def GenSteps(api): | 273 def GenSteps(api): |
| 278 # TODO: crbug.com/358481 . The build_config should probably be a property | 274 buildername, bot_config = api.chromium.configure_bot(BUILDERS, ['gn']) |
| 279 # passed in from slaves.cfg, but that doesn't exist today, so we need a | |
| 280 # lookup mechanism to map bot name to build_config. | |
| 281 mastername = api.properties.get('mastername') | |
| 282 buildername = api.properties.get('buildername') | |
| 283 master_dict = BUILDERS.get(mastername, {}) | |
| 284 bot_config = master_dict.get('builders', {}).get(buildername) | |
| 285 | |
| 286 api.chromium.set_config('chromium', | |
| 287 **bot_config.get('chromium_config_kwargs', {})) | |
| 288 for c in bot_config.get('chromium_apply_config', []): | |
| 289 api.chromium.apply_config(c) | |
| 290 | |
| 291 api.chromium.apply_config('gn') | |
| 292 | |
| 293 # Note that we have to call gclient.set_config() and apply_config() *after* | |
| 294 # calling chromium.set_config(), above, because otherwise the chromium | |
| 295 # call would reset the gclient config to its defaults. | |
| 296 api.gclient.set_config('chromium') | |
| 297 for c in bot_config.get('gclient_apply_config', []): | |
| 298 api.gclient.apply_config(c) | |
| 299 | |
| 300 if bot_config.get('set_component_rev'): | |
| 301 # If this is a component build and the main revision is e.g. blink, | |
| 302 # webrtc, or v8, the custom deps revision of this component must be | |
| 303 # dynamically set to either: | |
| 304 # (1) 'revision' from the waterfall, or | |
| 305 # (2) 'HEAD' for forced builds with unspecified 'revision'. | |
| 306 component_rev = api.properties.get('revision') or 'HEAD' | |
| 307 dep = bot_config.get('set_component_rev') | |
| 308 api.gclient.c.revisions[dep['name']] = dep['rev_str'] % component_rev | |
| 309 | |
| 310 if api.tryserver.is_tryserver: | |
| 311 api.step.auto_resolve_conflicts = True | |
| 312 | 275 |
| 313 api.bot_update.ensure_checkout( | 276 api.bot_update.ensure_checkout( |
| 314 force=True, patch_root=bot_config.get('root_override')) | 277 force=True, patch_root=bot_config.get('root_override')) |
| 315 | 278 |
| 316 api.chromium.runhooks() | 279 api.chromium.runhooks() |
| 317 | 280 |
| 318 # TODO(scottmg): goma doesn't work on windows GN builds yet. | 281 # TODO(dpranke): goma doesn't work on windows GN builds yet. |
| 319 is_windows = ('Win8' in buildername or 'win8_' in buildername) | 282 is_windows = ('Win' in buildername or 'win' in buildername) |
| 320 api.chromium.run_gn(use_goma=not is_windows) | 283 api.chromium.run_gn(use_goma=not is_windows) |
| 321 if is_windows: | 284 if is_windows: |
| 322 api.chromium.c.compile_py.compiler = None | 285 api.chromium.c.compile_py.compiler = None |
| 323 api.chromium.c.compile_py.goma_dir = None | 286 api.chromium.c.compile_py.goma_dir = None |
| 324 | 287 |
| 325 api.chromium.compile(targets=['all']) | 288 api.chromium.compile(targets=['all']) |
| 326 | 289 |
| 327 if bot_config.get('should_run_gn_gyp_compare', False): | 290 if bot_config.get('should_run_gn_gyp_compare', False): |
| 328 api.chromium.run_gn_compare() | 291 api.chromium.run_gn_compare() |
| 329 | 292 |
| 330 # TODO(dpranke): crbug.com/353854. Run gn_unittests and other tests | 293 # TODO(dpranke): crbug.com/353854. Run gn_unittests and other tests |
| 331 # when they are also being run as part of the try jobs. | 294 # when they are also being run as part of the try jobs. |
| 332 if bot_config.get('should_run_mojo_tests', False): | 295 if bot_config.get('should_run_mojo_tests', False): |
| 333 api.chromium.runtest('html_viewer_unittests') | 296 api.chromium.runtest('html_viewer_unittests') |
| 334 | 297 |
| 335 | 298 |
| 336 def _sanitize_nonalpha(text): | |
| 337 return ''.join(c if c.isalnum() else '_' for c in text) | |
| 338 | |
| 339 | |
| 340 def GenTests(api): | 299 def GenTests(api): |
| 341 # TODO: crbug.com/354674. Figure out where to put "simulation" | 300 for test in api.chromium.gen_tests_for_builders(BUILDERS): |
| 342 # tests. We should have one test for each bot this recipe runs on. | 301 yield test |
| 343 | |
| 344 for mastername in BUILDERS: | |
| 345 for buildername in BUILDERS[mastername]['builders']: | |
| 346 if 'mac' in buildername or 'Mac' in buildername: | |
| 347 platform_name = 'mac' | |
| 348 elif 'win' in buildername or 'Win' in buildername: | |
| 349 platform_name = 'win' | |
| 350 else: | |
| 351 platform_name = 'linux' | |
| 352 test = ( | |
| 353 api.test('full_%s_%s' % (_sanitize_nonalpha(mastername), | |
| 354 _sanitize_nonalpha(buildername))) + | |
| 355 api.platform.name(platform_name) | |
| 356 ) | |
| 357 if mastername.startswith('tryserver'): | |
| 358 test += api.properties.tryserver(buildername=buildername, | |
| 359 mastername=mastername) | |
| 360 else: | |
| 361 test += api.properties.generic(buildername=buildername, | |
| 362 mastername=mastername) | |
| 363 yield test | |
| 364 | 302 |
| 365 yield ( | 303 yield ( |
| 366 api.test('compile_failure') + | 304 api.test('compile_failure') + |
| 367 api.platform.name('linux') + | 305 api.platform.name('linux') + |
| 368 api.properties.tryserver( | 306 api.properties.tryserver( |
| 369 buildername='linux_chromium_gn_rel', | 307 buildername='linux_chromium_gn_rel', |
| 370 mastername='tryserver.chromium.linux') + | 308 mastername='tryserver.chromium.linux') + |
| 371 api.step_data('compile', retcode=1) | 309 api.step_data('compile', retcode=1) |
| 372 ) | 310 ) |
| OLD | NEW |