| 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 import copy | 5 import copy |
| 6 | 6 |
| 7 from slave import recipe_api | 7 from slave import recipe_api |
| 8 | 8 |
| 9 | 9 |
| 10 # Different types of builds this recipe module can do. | 10 # Different types of builds this recipe module can do. |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 recipe_config = RECIPE_CONFIGS[recipe_config_name] | 133 recipe_config = RECIPE_CONFIGS[recipe_config_name] |
| 134 | 134 |
| 135 self.m.chromium.set_config( | 135 self.m.chromium.set_config( |
| 136 recipe_config['chromium_config'], | 136 recipe_config['chromium_config'], |
| 137 **bot_config.get('chromium_config_kwargs', {})) | 137 **bot_config.get('chromium_config_kwargs', {})) |
| 138 # Set GYP_DEFINES explicitly because chromium config constructor does | 138 # Set GYP_DEFINES explicitly because chromium config constructor does |
| 139 # not support that. | 139 # not support that. |
| 140 self.m.chromium.c.gyp_env.GYP_DEFINES.update( | 140 self.m.chromium.c.gyp_env.GYP_DEFINES.update( |
| 141 bot_config.get('GYP_DEFINES', {})) | 141 bot_config.get('GYP_DEFINES', {})) |
| 142 if bot_config.get('use_isolate'): | 142 if bot_config.get('use_isolate'): |
| 143 self.m.isolate.set_isolate_environment( | 143 self.m.isolate.set_isolate_environment(self.m.chromium.c, mode='prepare') |
| 144 self.m.chromium.c, mode=bot_config.get('isolation_mode', 'archive')) | |
| 145 for c in recipe_config.get('chromium_apply_config', []): | 144 for c in recipe_config.get('chromium_apply_config', []): |
| 146 self.m.chromium.apply_config(c) | 145 self.m.chromium.apply_config(c) |
| 147 for c in bot_config.get('chromium_apply_config', []): | 146 for c in bot_config.get('chromium_apply_config', []): |
| 148 self.m.chromium.apply_config(c) | 147 self.m.chromium.apply_config(c) |
| 149 if chromium_apply_config: | 148 if chromium_apply_config: |
| 150 for c in chromium_apply_config: | 149 for c in chromium_apply_config: |
| 151 self.m.chromium.apply_config(c) | 150 self.m.chromium.apply_config(c) |
| 152 self.m.gclient.set_config( | 151 self.m.gclient.set_config( |
| 153 recipe_config['gclient_config'], | 152 recipe_config['gclient_config'], |
| 154 **bot_config.get('gclient_config_kwargs', {})) | 153 **bot_config.get('gclient_config_kwargs', {})) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 # Bot Update re-uses the gclient configs. | 185 # Bot Update re-uses the gclient configs. |
| 187 update_step = self.m.bot_update.ensure_checkout() | 186 update_step = self.m.bot_update.ensure_checkout() |
| 188 assert update_step.json.output['did_run'] | 187 assert update_step.json.output['did_run'] |
| 189 # HACK(dnj): Remove after 'crbug.com/398105' has landed | 188 # HACK(dnj): Remove after 'crbug.com/398105' has landed |
| 190 self.m.chromium.set_build_properties(update_step.json.output['properties']) | 189 self.m.chromium.set_build_properties(update_step.json.output['properties']) |
| 191 | 190 |
| 192 if not enable_swarming: | 191 if not enable_swarming: |
| 193 enable_swarming = bot_config.get('enable_swarming') | 192 enable_swarming = bot_config.get('enable_swarming') |
| 194 | 193 |
| 195 if enable_swarming: | 194 if enable_swarming: |
| 196 self.m.isolate.set_isolate_environment( | 195 self.m.isolate.set_isolate_environment(self.m.chromium.c, mode='prepare') |
| 197 self.m.chromium.c, mode=bot_config.get('isolation_mode', 'archive')) | |
| 198 self.m.swarming.check_client_version() | 196 self.m.swarming.check_client_version() |
| 199 self.m.swarming.default_priority = 50 | 197 self.m.swarming.default_priority = 50 |
| 200 os_dimension = bot_config.get('swarming_dimensions', {}).get('os') | 198 os_dimension = bot_config.get('swarming_dimensions', {}).get('os') |
| 201 if os_dimension: | 199 if os_dimension: |
| 202 self.m.swarming.set_default_dimension('os', os_dimension) | 200 self.m.swarming.set_default_dimension('os', os_dimension) |
| 203 cpu_dimension = bot_config.get('swarming_dimensions', {}).get('cpu') | 201 cpu_dimension = bot_config.get('swarming_dimensions', {}).get('cpu') |
| 204 if cpu_dimension: | 202 if cpu_dimension: |
| 205 self.m.swarming.set_default_dimension('cpu', cpu_dimension) | 203 self.m.swarming.set_default_dimension('cpu', cpu_dimension) |
| 206 | 204 |
| 207 if not bot_config.get('disable_runhooks'): | 205 if not bot_config.get('disable_runhooks'): |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 333 |
| 336 # Step 'checkdeps' is same on all platforms, no need to run it everywhere. | 334 # Step 'checkdeps' is same on all platforms, no need to run it everywhere. |
| 337 if self.m.platform.is_linux: | 335 if self.m.platform.is_linux: |
| 338 self.m.chromium.checkdeps() | 336 self.m.chromium.checkdeps() |
| 339 | 337 |
| 340 if self.m.chromium.c.TARGET_PLATFORM == 'android': | 338 if self.m.chromium.c.TARGET_PLATFORM == 'android': |
| 341 self.m.chromium_android.check_webview_licenses() | 339 self.m.chromium_android.check_webview_licenses() |
| 342 self.m.chromium_android.findbugs() | 340 self.m.chromium_android.findbugs() |
| 343 | 341 |
| 344 if isolated_targets: | 342 if isolated_targets: |
| 345 isolation_mode = bot_config.get('isolation_mode', 'archive') | 343 # In 'prepare' isolation mode, 'compile' just prepares all information |
| 346 deduped_targets = list(set(isolated_targets)) | 344 # needed for the isolation, and the isolation is a separate step. |
| 347 # In 'archive' mode, 'compile' step does the archival, and we just need | 345 self.m.isolate.isolate_tests( |
| 348 # to find resulting *.isolated files. | 346 self.m.chromium.output_dir, |
| 349 if isolation_mode == 'archive': | 347 targets=list(set(isolated_targets)), |
| 350 self.m.isolate.find_isolated_tests( | 348 verbose=True) |
| 351 self.m.chromium.output_dir, targets=deduped_targets) | |
| 352 else: | |
| 353 # In 'prepare' mode, 'compile' just prepares all information needed | |
| 354 # for isolation, and isolation is a separate step done here. | |
| 355 assert isolation_mode == 'prepare', isolation_mode | |
| 356 self.m.isolate.isolate_tests( | |
| 357 self.m.chromium.output_dir, targets=deduped_targets) | |
| 358 | 349 |
| 359 got_revision = update_step.presentation.properties['got_revision'] | 350 got_revision = update_step.presentation.properties['got_revision'] |
| 360 | 351 |
| 361 if bot_type == 'builder': | 352 if bot_type == 'builder': |
| 362 if mastername == 'chromium.linux': | 353 if mastername == 'chromium.linux': |
| 363 # TODO(samuong): This is restricted to Linux for now until I have more | 354 # TODO(samuong): This is restricted to Linux for now until I have more |
| 364 # confidence that it is not totally broken. | 355 # confidence that it is not totally broken. |
| 365 self.m.archive.archive_dependencies( | 356 self.m.archive.archive_dependencies( |
| 366 'archive dependencies', | 357 'archive dependencies', |
| 367 self.m.chromium.c.build_config_fs, | 358 self.m.chromium.c.build_config_fs, |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 if mastername == 'chromium.perf': | 533 if mastername == 'chromium.perf': |
| 543 return self.m.archive.legacy_upload_url( | 534 return self.m.archive.legacy_upload_url( |
| 544 master_config.get('build_gs_bucket'), | 535 master_config.get('build_gs_bucket'), |
| 545 extra_url_components=None) | 536 extra_url_components=None) |
| 546 elif mastername == 'tryserver.chromium.perf': | 537 elif mastername == 'tryserver.chromium.perf': |
| 547 return None | 538 return None |
| 548 else: | 539 else: |
| 549 return self.m.archive.legacy_upload_url( | 540 return self.m.archive.legacy_upload_url( |
| 550 master_config.get('build_gs_bucket'), | 541 master_config.get('build_gs_bucket'), |
| 551 extra_url_components=self.m.properties['mastername']) | 542 extra_url_components=self.m.properties['mastername']) |
| OLD | NEW |