OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 re | 5 import re |
6 | 6 |
7 from recipe_engine import recipe_api | 7 from recipe_engine import recipe_api |
8 from recipe_engine import util as recipe_util | 8 from recipe_engine import util as recipe_util |
9 | 9 |
10 class TestLauncherFilterFileInputPlaceholder(recipe_util.InputPlaceholder): | 10 class TestLauncherFilterFileInputPlaceholder(recipe_util.InputPlaceholder): |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 # (in chromium/config.py), and the buildside gypfiles are as dumb as | 43 # (in chromium/config.py), and the buildside gypfiles are as dumb as |
44 # possible. However, since the recipes need to accurately contain | 44 # possible. However, since the recipes need to accurately contain |
45 # {TARGET,HOST}_{BITS,ARCH,PLATFORM}, for use across many tools (of which | 45 # {TARGET,HOST}_{BITS,ARCH,PLATFORM}, for use across many tools (of which |
46 # gyp is one tool), we're taking a small risk and replicating the logic | 46 # gyp is one tool), we're taking a small risk and replicating the logic |
47 # here. | 47 # here. |
48 'TARGET_BITS': ( | 48 'TARGET_BITS': ( |
49 32 if self.m.platform.name == 'win' | 49 32 if self.m.platform.name == 'win' |
50 else self.m.platform.bits), | 50 else self.m.platform.bits), |
51 | 51 |
52 'BUILD_CONFIG': self.m.properties.get('build_config', 'Release'), | 52 'BUILD_CONFIG': self.m.properties.get('build_config', 'Release'), |
53 | |
54 'BUILD_PATH': self.m.infra_paths['build'], | |
55 } | 53 } |
56 | 54 |
57 def get_env(self): | 55 def get_env(self): |
58 ret = {} | 56 ret = {} |
59 if self.c.env.PATH: | 57 if self.c.env.PATH: |
60 ret['PATH'] = self.m.path.pathsep.join( | 58 ret['PATH'] = self.m.path.pathsep.join( |
61 map(str, self.c.env.PATH) + ['%(PATH)s']) | 59 map(str, self.c.env.PATH) + ['%(PATH)s']) |
62 if self.c.env.ADB_VENDOR_KEYS: | 60 if self.c.env.ADB_VENDOR_KEYS: |
63 ret['ADB_VENDOR_KEYS'] = self.c.env.ADB_VENDOR_KEYS | 61 ret['ADB_VENDOR_KEYS'] = self.c.env.ADB_VENDOR_KEYS |
64 if self.c.env.LLVM_FORCE_HEAD_REVISION: | 62 if self.c.env.LLVM_FORCE_HEAD_REVISION: |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 self._clang_version = self.get_clang_version() | 155 self._clang_version = self.get_clang_version() |
158 | 156 |
159 args = [ | 157 args = [ |
160 '--show-path', | 158 '--show-path', |
161 'python', | 159 'python', |
162 self.package_repo_resource('scripts', 'slave', 'compile.py'), | 160 self.package_repo_resource('scripts', 'slave', 'compile.py'), |
163 '--gsutil-py-path', self.m.depot_tools.gsutil_py_path, | 161 '--gsutil-py-path', self.m.depot_tools.gsutil_py_path, |
164 '--ninja-path', self.m.depot_tools.ninja_path, | 162 '--ninja-path', self.m.depot_tools.ninja_path, |
165 '--target', target or self.c.build_config_fs, | 163 '--target', target or self.c.build_config_fs, |
166 '--src-dir', self.m.path['checkout'], | 164 '--src-dir', self.m.path['checkout'], |
167 '--goma-cache-dir', self.m.infra_paths['goma_cache'], | 165 '--goma-cache-dir', self.m.path['goma_cache'], |
168 ] | 166 ] |
169 if self.c.compile_py.build_args: | 167 if self.c.compile_py.build_args: |
170 args += ['--build-args', self.c.compile_py.build_args] | 168 args += ['--build-args', self.c.compile_py.build_args] |
171 if self.c.compile_py.build_tool: | 169 if self.c.compile_py.build_tool: |
172 args += ['--build-tool', self.c.compile_py.build_tool] | 170 args += ['--build-tool', self.c.compile_py.build_tool] |
173 if self.m.properties.get('build_data_dir'): | 171 if self.m.properties.get('build_data_dir'): |
174 args += ['--build-data-dir', self.m.properties.get('build_data_dir')] | 172 args += ['--build-data-dir', self.m.properties.get('build_data_dir')] |
175 if self.c.compile_py.cross_tool: | 173 if self.c.compile_py.cross_tool: |
176 args += ['--crosstool', self.c.compile_py.cross_tool] | 174 args += ['--crosstool', self.c.compile_py.cross_tool] |
177 if self.c.compile_py.compiler: | 175 if self.c.compile_py.compiler: |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 # rather than setting the gn_args flags via a parameter passed to | 522 # rather than setting the gn_args flags via a parameter passed to |
525 # run_gn(). We shouldn't have *three* different mechanisms to control | 523 # run_gn(). We shouldn't have *three* different mechanisms to control |
526 # what args to use. | 524 # what args to use. |
527 if use_goma: | 525 if use_goma: |
528 gn_args.append('use_goma=true') | 526 gn_args.append('use_goma=true') |
529 gn_args.append('goma_dir="%s"' % self.c.compile_py.goma_dir) | 527 gn_args.append('goma_dir="%s"' % self.c.compile_py.goma_dir) |
530 gn_args.extend(self.c.project_generator.args) | 528 gn_args.extend(self.c.project_generator.args) |
531 | 529 |
532 self.m.python( | 530 self.m.python( |
533 name='gn', | 531 name='gn', |
534 script=self.m.infra_paths['depot_tools'].join('gn.py'), | 532 script=self.m.path['depot_tools'].join('gn.py'), |
535 args=[ | 533 args=[ |
536 '--root=%s' % str(self.m.path['checkout']), | 534 '--root=%s' % str(self.m.path['checkout']), |
537 'gen', | 535 'gen', |
538 build_dir, | 536 build_dir, |
539 '--args=%s' % ' '.join(gn_args), | 537 '--args=%s' % ' '.join(gn_args), |
540 ]) | 538 ]) |
541 | 539 |
542 def run_mb(self, mastername, buildername, use_goma=True, | 540 def run_mb(self, mastername, buildername, use_goma=True, |
543 mb_config_path=None, isolated_targets=None, name=None, | 541 mb_config_path=None, isolated_targets=None, name=None, |
544 build_dir=None, android_version_code=None, | 542 build_dir=None, android_version_code=None, |
(...skipping 14 matching lines...) Expand all Loading... |
559 if use_goma: | 557 if use_goma: |
560 goma_dir = self.c.compile_py.goma_dir | 558 goma_dir = self.c.compile_py.goma_dir |
561 if not goma_dir: | 559 if not goma_dir: |
562 # This method defaults to use_goma=True, which doesn't necessarily | 560 # This method defaults to use_goma=True, which doesn't necessarily |
563 # match build-side configuration. However, MB is configured | 561 # match build-side configuration. However, MB is configured |
564 # src-side, and so it might be actually using goma. | 562 # src-side, and so it might be actually using goma. |
565 self.ensure_goma() | 563 self.ensure_goma() |
566 goma_dir = self.c.compile_py.goma_dir | 564 goma_dir = self.c.compile_py.goma_dir |
567 if not goma_dir: # pragma: no cover | 565 if not goma_dir: # pragma: no cover |
568 # TODO(phajdan.jr): remove fallback when we always use cipd for goma. | 566 # TODO(phajdan.jr): remove fallback when we always use cipd for goma. |
569 goma_dir = self.m.infra_paths['build'].join('goma') | 567 goma_dir = self.m.path['build'].join('goma') |
570 args += ['--goma-dir', goma_dir] | 568 args += ['--goma-dir', goma_dir] |
571 | 569 |
572 if isolated_targets: | 570 if isolated_targets: |
573 sorted_isolated_targets = sorted(set(isolated_targets)) | 571 sorted_isolated_targets = sorted(set(isolated_targets)) |
574 # TODO(dpranke): Change the MB flag to '--isolate-targets-file', maybe? | 572 # TODO(dpranke): Change the MB flag to '--isolate-targets-file', maybe? |
575 data = '\n'.join(sorted_isolated_targets) + '\n' | 573 data = '\n'.join(sorted_isolated_targets) + '\n' |
576 args += ['--swarming-targets-file', self.m.raw_io.input(data)] | 574 args += ['--swarming-targets-file', self.m.raw_io.input(data)] |
577 | 575 |
578 if android_version_code: | 576 if android_version_code: |
579 args += ['--android-version-code=%s' % android_version_code] | 577 args += ['--android-version-code=%s' % android_version_code] |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 })) | 710 })) |
713 | 711 |
714 def get_annotate_by_test_name(self, test_name): | 712 def get_annotate_by_test_name(self, test_name): |
715 return 'graphing' | 713 return 'graphing' |
716 | 714 |
717 def download_lto_plugin(self): | 715 def download_lto_plugin(self): |
718 return self.m.python( | 716 return self.m.python( |
719 name='download LTO plugin', | 717 name='download LTO plugin', |
720 script=self.m.path['checkout'].join( | 718 script=self.m.path['checkout'].join( |
721 'build', 'download_gold_plugin.py')) | 719 'build', 'download_gold_plugin.py')) |
OLD | NEW |