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 contextlib | 5 import contextlib |
6 import copy | 6 import copy |
7 import json | 7 import json |
8 | 8 |
9 from infra.libs.infra_types import freeze, thaw | 9 from infra.libs.infra_types import freeze, thaw |
10 from recipe_engine import recipe_api | 10 from recipe_engine import recipe_api |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
477 raise | 477 raise |
478 if has_failing_swarming_tests: | 478 if has_failing_swarming_tests: |
479 self.m.isolate.isolate_tests(self.m.chromium.output_dir, | 479 self.m.isolate.isolate_tests(self.m.chromium.output_dir, |
480 verbose=True) | 480 verbose=True) |
481 | 481 |
482 with self.wrap_chromium_tests(mastername): | 482 with self.wrap_chromium_tests(mastername): |
483 return self.m.test_utils.determine_new_failures(api, tests, | 483 return self.m.test_utils.determine_new_failures(api, tests, |
484 deapply_patch_fn) | 484 deapply_patch_fn) |
485 | 485 |
486 def analyze(self, affected_files, exes, compile_targets, config_file_name, | 486 def analyze(self, affected_files, exes, compile_targets, config_file_name, |
487 additional_names=None): | 487 additional_names=None, legacy_postprocess=True): |
488 """Runs "analyze" step to determine targets affected by the patch. | 488 """Runs "analyze" step to determine targets affected by the patch. |
489 | 489 |
490 Returns a tuple of: | 490 Returns a tuple of: |
491 - boolean, indicating whether patch requires compile | 491 - boolean, indicating whether patch requires compile |
492 - list of matching exes (see filter recipe module) | 492 - list of matching exes (see filter recipe module) |
493 - list of targets that need to be compiled (see filter recipe module)""" | 493 - list of targets that need to be compiled (see filter recipe module)""" |
494 | 494 |
495 original_exes = exes[:] | 495 original_exes = exes[:] |
496 original_compile_targets = compile_targets[:] | 496 original_compile_targets = compile_targets[:] |
497 | 497 |
498 if additional_names is None: | 498 if additional_names is None: |
499 additional_names = ['chromium'] | 499 additional_names = ['chromium'] |
500 | 500 |
501 use_mb = (self.m.chromium.c.project_generator.tool == 'mb') | 501 use_mb = (self.m.chromium.c.project_generator.tool == 'mb') |
502 build_output_dir = '//out/%s' % self.m.chromium.c.build_config_fs | 502 build_output_dir = '//out/%s' % self.m.chromium.c.build_config_fs |
503 self.m.filter.does_patch_require_compile( | 503 self.m.filter.does_patch_require_compile( |
504 affected_files, | 504 affected_files, |
505 exes=exes, | 505 exes=exes, |
506 compile_targets=compile_targets, | 506 compile_targets=compile_targets, |
507 additional_names=additional_names, | 507 additional_names=additional_names, |
508 config_file_name=config_file_name, | 508 config_file_name=config_file_name, |
509 use_mb=use_mb, | 509 use_mb=use_mb, |
510 build_output_dir=build_output_dir, | 510 build_output_dir=build_output_dir, |
511 cros_board=self.m.chromium.c.TARGET_CROS_BOARD) | 511 cros_board=self.m.chromium.c.TARGET_CROS_BOARD) |
512 | 512 |
513 if not self.m.filter.result: | 513 if not self.m.filter.result: |
514 # Patch does not require compile. | 514 # Patch does not require compile. |
515 return False, [], [] | 515 return False, [], [] |
516 | 516 |
517 if 'all' in compile_targets: | 517 if legacy_postprocess: |
518 if 'all' in compile_targets: | |
519 compile_targets = self.m.filter.compile_targets | |
520 else: | |
521 compile_targets = list(set(compile_targets) & | |
522 set(self.m.filter.compile_targets)) | |
523 # Always add |matching_exes|. They will be covered by |compile_targets|, | |
524 # but adding |matching_exes| makes determing if conditional tests are | |
525 # necessary easier. For example, if we didn't do this we could end up | |
526 # with chrome_run as a compile_target and not chrome (since chrome_run | |
527 # depends upon chrome). This results in not picking up | |
528 # NaclIntegrationTest as it depends upon chrome not chrome_run. | |
529 compile_targets = list(set(self.m.filter.matching_exes + compile_targets)) | |
Adrian Kuegel
2015/06/15 14:19:44
I have the feeling that this should be done in any
Paweł Hajdan Jr.
2015/06/15 15:02:44
I believe this should be handled by the analyzer.
| |
530 else: | |
518 compile_targets = self.m.filter.compile_targets | 531 compile_targets = self.m.filter.compile_targets |
519 else: | |
520 compile_targets = list(set(compile_targets) & | |
521 set(self.m.filter.compile_targets)) | |
522 # Always add |matching_exes|. They will be covered by |compile_targets|, | |
523 # but adding |matching_exes| makes determing if conditional tests are | |
524 # necessary easier. For example, if we didn't do this we could end up | |
525 # with chrome_run as a compile_target and not chrome (since chrome_run | |
526 # depends upon chrome). This results in not picking up | |
527 # NaclIntegrationTest as it depends upon chrome not chrome_run. | |
528 compile_targets = list(set(self.m.filter.matching_exes + compile_targets)) | |
529 | 532 |
530 # Add crash_service to compile_targets. This is done after filtering compile | 533 # Add crash_service to compile_targets. This is done after filtering compile |
531 # targets out because crash_service should always be there on windows. | 534 # targets out because crash_service should always be there on windows. |
532 # TODO(akuegel): Need to solve this in a better way. crbug.com/478053 | 535 # TODO(akuegel): Need to solve this in a better way. crbug.com/478053 |
533 if (self.m.platform.is_win and compile_targets and | 536 if (self.m.platform.is_win and compile_targets and |
534 'crash_service' not in compile_targets and not use_mb): | 537 'crash_service' not in compile_targets and not use_mb): |
535 compile_targets.extend(['crash_service']) | 538 compile_targets.extend(['crash_service']) |
536 | 539 |
537 # Emit more detailed output useful for debugging. | 540 # Emit more detailed output useful for debugging. |
538 analyze_details = { | 541 analyze_details = { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
611 master_config.get('build_gs_bucket'), | 614 master_config.get('build_gs_bucket'), |
612 extra_url_components=None) | 615 extra_url_components=None) |
613 elif (mastername == 'tryserver.chromium.perf' or | 616 elif (mastername == 'tryserver.chromium.perf' or |
614 (mastername == 'tryserver.chromium.linux' and | 617 (mastername == 'tryserver.chromium.linux' and |
615 buildername == 'linux_full_bisect_builder')): | 618 buildername == 'linux_full_bisect_builder')): |
616 return None | 619 return None |
617 else: | 620 else: |
618 return self.m.archive.legacy_upload_url( | 621 return self.m.archive.legacy_upload_url( |
619 master_config.get('build_gs_bucket'), | 622 master_config.get('build_gs_bucket'), |
620 extra_url_components=self.m.properties['mastername']) | 623 extra_url_components=self.m.properties['mastername']) |
OLD | NEW |