| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Utility class to generate a Dart-specific BuildFactory. | 6 """Utility class to generate a Dart-specific BuildFactory. |
| 7 | 7 |
| 8 Based on gclient_factory.py. | 8 Based on gclient_factory.py. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import random | 11 import random |
| 12 | 12 |
| 13 from buildbot.changes import gitpoller | 13 from buildbot.changes import gitpoller |
| 14 from buildbot.process.buildstep import RemoteShellCommand | 14 from buildbot.process.buildstep import RemoteShellCommand |
| 15 from buildbot.status.mail import MailNotifier | 15 from buildbot.status.mail import MailNotifier |
| 16 from buildbot.status.status_push import HttpStatusPush | 16 from buildbot.status.status_push import HttpStatusPush |
| 17 from buildbot.steps import trigger | 17 from buildbot.steps import trigger |
| 18 | 18 |
| 19 from common import chromium_utils | |
| 20 | |
| 21 from master.factory import chromium_factory | |
| 22 from master.factory.dart import dart_commands | 19 from master.factory.dart import dart_commands |
| 23 from master.factory.dart.channels import CHANNELS, CHANNELS_BY_NAME | 20 from master.factory.dart.channels import CHANNELS, CHANNELS_BY_NAME |
| 24 from master.factory import gclient_factory | 21 from master.factory import gclient_factory |
| 25 from master import gitiles_poller | 22 from master import gitiles_poller |
| 26 from master import master_utils | 23 from master import master_utils |
| 27 | 24 |
| 28 import config | 25 import config |
| 29 | 26 |
| 30 android_tools_rev = '@b12d410c0ee23385da78e6c9f353d28fd992e0bd' | 27 android_tools_rev = '@b12d410c0ee23385da78e6c9f353d28fd992e0bd' |
| 31 android_resources_rev = '@3855' | 28 android_resources_rev = '@3855' |
| 32 | 29 |
| 33 chromium_git = 'http://git.chromium.org/git/' | 30 chromium_git = 'http://git.chromium.org/git/' |
| 34 | 31 |
| 35 dartium_url = config.Master.dart_bleeding + '/deps/dartium.deps' | |
| 36 android_tools_url = chromium_git + 'android_tools.git' + android_tools_rev | 32 android_tools_url = chromium_git + 'android_tools.git' + android_tools_rev |
| 37 | 33 |
| 38 github_mirror = 'https://chromium.googlesource.com/external/github.com' | 34 github_mirror = 'https://chromium.googlesource.com/external/github.com' |
| 39 dart_sdk_mirror = github_mirror + '/dart-lang/sdk.git' | 35 dart_sdk_mirror = github_mirror + '/dart-lang/sdk.git' |
| 40 | 36 |
| 41 if config.Master.v8_internal_url: | 37 if config.Master.v8_internal_url: |
| 42 android_resources_url = (config.Master.v8_internal_url + | 38 android_resources_url = (config.Master.v8_internal_url + |
| 43 '/buildbot_deps/android_testing_resources' + android_resources_rev) | 39 '/buildbot_deps/android_testing_resources' + android_resources_rev) |
| 44 else: | 40 else: |
| 45 android_resources_url = None | 41 android_resources_url = None |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 else: | 101 else: |
| 106 custom_wix_deps = [] | 102 custom_wix_deps = [] |
| 107 | 103 |
| 108 custom_deps_list_chromeOnAndroid = [ | 104 custom_deps_list_chromeOnAndroid = [ |
| 109 ('dart/third_party/android_tools', android_tools_url), | 105 ('dart/third_party/android_tools', android_tools_url), |
| 110 ] | 106 ] |
| 111 if android_resources_url: | 107 if android_resources_url: |
| 112 custom_deps_list_chromeOnAndroid.append( | 108 custom_deps_list_chromeOnAndroid.append( |
| 113 ('dart/third_party/android_testing_resources', android_resources_url)) | 109 ('dart/third_party/android_testing_resources', android_resources_url)) |
| 114 | 110 |
| 115 def BuildChromiumFactory(channel, target_platform='win32'): | |
| 116 def new_solution(deps_url, custom_vars, custom_deps, custom_deps_file, name): | |
| 117 return gclient_factory.GClientSolution( | |
| 118 deps_url, | |
| 119 name=name, | |
| 120 custom_vars_list=custom_vars, | |
| 121 custom_deps_list=custom_deps, | |
| 122 custom_deps_file=custom_deps_file) | |
| 123 | |
| 124 class DartiumFactory(chromium_factory.ChromiumFactory): | |
| 125 def __init__(self, target_platform=None): | |
| 126 if target_platform in ['linux2', 'darwin']: | |
| 127 # We use make/ninja on our linux/mac dartium builders which use | |
| 128 # 'src/out' as build directory | |
| 129 build_directory = 'src/out' | |
| 130 else: | |
| 131 # On windows we still use msvc which uses 'src/build' as build directory | |
| 132 build_directory = 'src/build' | |
| 133 chromium_factory.ChromiumFactory.__init__(self, | |
| 134 build_directory, | |
| 135 target_platform) | |
| 136 self._solutions = [] | |
| 137 | |
| 138 def add_solution(self, solution): | |
| 139 self._solutions.append(solution) | |
| 140 | |
| 141 factory = DartiumFactory(target_platform) | |
| 142 custom_deps_file = 'tools/deps/dartium.deps/DEPS' | |
| 143 name = 'src/dart' | |
| 144 deps_url = dart_sdk_mirror | |
| 145 if target_platform == 'win32': | |
| 146 factory.add_solution( | |
| 147 new_solution(deps_url, custom_vars_list, custom_deps_list_win, | |
| 148 custom_deps_file, name)) | |
| 149 else: | |
| 150 factory.add_solution(new_solution(deps_url, custom_vars_list, [], | |
| 151 custom_deps_file, name)) | |
| 152 | |
| 153 return factory.ChromiumFactory | |
| 154 | |
| 155 def AddGeneralGClientProperties(factory_properties): | 111 def AddGeneralGClientProperties(factory_properties): |
| 156 """Adds the general gclient options to ensure we get the correct revisions""" | 112 """Adds the general gclient options to ensure we get the correct revisions""" |
| 157 # Make sure that pulled in projects have the right revision based on date. | 113 # Make sure that pulled in projects have the right revision based on date. |
| 158 factory_properties['gclient_transitive'] = True | 114 factory_properties['gclient_transitive'] = True |
| 159 # Don't set branch part on the --revision flag - we don't use standard | 115 # Don't set branch part on the --revision flag - we don't use standard |
| 160 # chromium layout and hence this is doing the wrong thing. | 116 # chromium layout and hence this is doing the wrong thing. |
| 161 factory_properties['no_gclient_branch'] = True | 117 factory_properties['no_gclient_branch'] = True |
| 162 | 118 |
| 163 class DartFactory(gclient_factory.GClientFactory): | 119 class DartFactory(gclient_factory.GClientFactory): |
| 164 """Encapsulates data and methods common to the dart master.cfg files.""" | 120 """Encapsulates data and methods common to the dart master.cfg files.""" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 DartFactory(channel, | 366 DartFactory(channel, |
| 411 custom_deps_list=custom_deps_list_chromeOnAndroid), | 367 custom_deps_list=custom_deps_list_chromeOnAndroid), |
| 412 'android' + postfix: DartFactory(channel, target_os='android'), | 368 'android' + postfix: DartFactory(channel, target_os='android'), |
| 413 'windows' + postfix: DartFactory(channel, target_platform='win32'), | 369 'windows' + postfix: DartFactory(channel, target_platform='win32'), |
| 414 'windows-wix' + postfix: | 370 'windows-wix' + postfix: |
| 415 DartFactory(channel, target_platform='win32', | 371 DartFactory(channel, target_platform='win32', |
| 416 custom_deps_list=custom_wix_deps), | 372 custom_deps_list=custom_wix_deps), |
| 417 } | 373 } |
| 418 return factory_base | 374 return factory_base |
| 419 | 375 |
| 420 @staticmethod | |
| 421 def get_dartium_factory_base(channel): | |
| 422 postfix = channel.builder_postfix | |
| 423 | |
| 424 F_MAC_CH = BuildChromiumFactory(channel, target_platform='darwin') | |
| 425 F_LINUX_CH = BuildChromiumFactory(channel, target_platform='linux2') | |
| 426 F_WIN_CH = BuildChromiumFactory(channel, target_platform='win32') | |
| 427 | |
| 428 factory_base_dartium = { | |
| 429 'dartium-mac-full' + postfix: F_MAC_CH( | |
| 430 target='Release', | |
| 431 options=DartUtils.mac_options, | |
| 432 clobber=True, | |
| 433 tests=['annotated_steps'], | |
| 434 factory_properties=DartUtils.mac_factory_properties), | |
| 435 'dartium-mac-inc' + postfix: F_MAC_CH( | |
| 436 target='Release', | |
| 437 options=DartUtils.mac_options, | |
| 438 tests=['annotated_steps'], | |
| 439 factory_properties=DartUtils.mac_factory_properties), | |
| 440 'dartium-mac-debug' + postfix: F_MAC_CH( | |
| 441 target='Debug', | |
| 442 compile_timeout=3600, | |
| 443 options=DartUtils.mac_options, | |
| 444 tests=['annotated_steps'], | |
| 445 factory_properties=DartUtils.mac_factory_properties), | |
| 446 'dartium-lucid64-full' + postfix: F_LINUX_CH( | |
| 447 target='Release', | |
| 448 clobber=True, | |
| 449 options=DartUtils.linux_options, | |
| 450 tests=['annotated_steps'], | |
| 451 factory_properties=DartUtils.linux_factory_properties), | |
| 452 'dartium-lucid64-inc' + postfix: F_LINUX_CH( | |
| 453 target='Release', | |
| 454 options=DartUtils.linux_options, | |
| 455 tests=['annotated_steps'], | |
| 456 factory_properties=DartUtils.linux_factory_properties), | |
| 457 'dartium-lucid64-debug' + postfix: F_LINUX_CH( | |
| 458 target='Debug', | |
| 459 options=DartUtils.linux_options, | |
| 460 tests=['annotated_steps'], | |
| 461 factory_properties=DartUtils.linux_factory_properties), | |
| 462 'dartium-win-full' + postfix: F_WIN_CH( | |
| 463 target='Release', | |
| 464 options=DartUtils.win_options, | |
| 465 tests=['annotated_steps'], | |
| 466 factory_properties=DartUtils.win_rel_factory_properties), | |
| 467 'dartium-win-inc' + postfix: F_WIN_CH( | |
| 468 target='Release', | |
| 469 options=DartUtils.win_options, | |
| 470 tests=['annotated_steps'], | |
| 471 factory_properties=DartUtils.win_rel_factory_properties), | |
| 472 'dartium-win-inc-ninja' + postfix: F_WIN_CH( | |
| 473 target='Release', | |
| 474 options=DartUtils.win_options, | |
| 475 tests=['annotated_steps'], | |
| 476 factory_properties=DartUtils.win_rel_factory_properties_ninja), | |
| 477 'dartium-win-debug' + postfix: F_WIN_CH( | |
| 478 target='Debug', | |
| 479 options=DartUtils.win_options, | |
| 480 tests=['annotated_steps'], | |
| 481 factory_properties=DartUtils.win_dbg_factory_properties), | |
| 482 'dartium-lucid32-full' + postfix: F_LINUX_CH( | |
| 483 target='Release', | |
| 484 clobber=True, | |
| 485 options=DartUtils.linux_options, | |
| 486 tests=['annotated_steps'], | |
| 487 factory_properties=DartUtils.linux32_factory_properties), | |
| 488 } | |
| 489 return factory_base_dartium | |
| 490 | |
| 491 factory_base = {} | 376 factory_base = {} |
| 492 factory_base_dartium = {} | |
| 493 | 377 |
| 494 def __init__(self, active_master): | 378 def __init__(self, active_master): |
| 495 self._active_master = active_master | 379 self._active_master = active_master |
| 496 | 380 |
| 497 for channel in CHANNELS: | 381 for channel in CHANNELS: |
| 498 DartUtils.factory_base.update(DartUtils.get_factory_base(channel)) | 382 DartUtils.factory_base.update(DartUtils.get_factory_base(channel)) |
| 499 for channel in CHANNELS: | |
| 500 DartUtils.factory_base_dartium.update( | |
| 501 DartUtils.get_dartium_factory_base(channel)) | |
| 502 | 383 |
| 503 @staticmethod | 384 @staticmethod |
| 504 def monkey_patch_remoteshell(): | 385 def monkey_patch_remoteshell(): |
| 505 # Hack to increase timeout for steps, dart2js debug checked mode takes more | 386 # Hack to increase timeout for steps, dart2js debug checked mode takes more |
| 506 # than 8 hours. | 387 # than 8 hours. |
| 507 RemoteShellCommand.__init__.im_func.func_defaults = (None, | 388 RemoteShellCommand.__init__.im_func.func_defaults = (None, |
| 508 1, | 389 1, |
| 509 1, | 390 1, |
| 510 1200, | 391 1200, |
| 511 48*60*60, {}, | 392 48*60*60, {}, |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 base = self.factory_base[platform] | 518 base = self.factory_base[platform] |
| 638 name = v['name'] | 519 name = v['name'] |
| 639 no_annotated = ((name.startswith('vm') or | 520 no_annotated = ((name.startswith('vm') or |
| 640 name.startswith('new_analyzer') or | 521 name.startswith('new_analyzer') or |
| 641 name.startswith('analyzer_experimental')) | 522 name.startswith('analyzer_experimental')) |
| 642 and not name.startswith('vm-android') | 523 and not name.startswith('vm-android') |
| 643 and not name.startswith('cross-') | 524 and not name.startswith('cross-') |
| 644 and not name.startswith('target-')) | 525 and not name.startswith('target-')) |
| 645 setup_dart_factory(v, base, no_annotated) | 526 setup_dart_factory(v, base, no_annotated) |
| 646 | 527 |
| 647 def setup_dartium_factories(self, dartium_variants): | |
| 648 for variant in dartium_variants: | |
| 649 name = variant['name'] | |
| 650 variant['factory_builder'] = self.factory_base_dartium[name] | |
| 651 | |
| 652 def get_web_statuses(self, order_console_by_time=True, | 528 def get_web_statuses(self, order_console_by_time=True, |
| 653 extra_templates=None): | 529 extra_templates=None): |
| 654 public_html = '../master.chromium/public_html' | 530 public_html = '../master.chromium/public_html' |
| 655 templates = ['../master.client.dart/templates', | 531 templates = ['../master.client.dart/templates', |
| 656 '../master.chromium/templates'] | 532 '../master.chromium/templates'] |
| 657 if extra_templates: | 533 if extra_templates: |
| 658 templates = extra_templates + templates | 534 templates = extra_templates + templates |
| 659 master_port = self._active_master.master_port | 535 master_port = self._active_master.master_port |
| 660 master_port_alt = self._active_master.master_port_alt | 536 master_port_alt = self._active_master.master_port_alt |
| 661 kwargs = { | 537 kwargs = { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 builders=notifying_builders)) | 603 builders=notifying_builders)) |
| 728 else: | 604 else: |
| 729 statuses.append( | 605 statuses.append( |
| 730 MailNotifier(fromaddr=self._active_master.from_address, | 606 MailNotifier(fromaddr=self._active_master.from_address, |
| 731 mode='problem', | 607 mode='problem', |
| 732 sendToInterestedUsers=send_to_interested_useres, | 608 sendToInterestedUsers=send_to_interested_useres, |
| 733 extraRecipients=extra_recipients, | 609 extraRecipients=extra_recipients, |
| 734 lookup=master_utils.UsersAreEmails(), | 610 lookup=master_utils.UsersAreEmails(), |
| 735 builders=notifying_builders)) | 611 builders=notifying_builders)) |
| 736 return statuses | 612 return statuses |
| OLD | NEW |