Chromium Code Reviews| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 # calling chromium.set_config(), above, because otherwise the chromium | 149 # calling chromium.set_config(), above, because otherwise the chromium |
| 150 # call would reset the gclient config to its defaults. | 150 # call would reset the gclient config to its defaults. |
| 151 self.m.gclient.set_config( | 151 self.m.gclient.set_config( |
| 152 'chromium', | 152 'chromium', |
| 153 PATCH_PROJECT=self.m.properties.get('patch_project')) | 153 PATCH_PROJECT=self.m.properties.get('patch_project')) |
| 154 for c in bot_config.get('gclient_apply_config', []): | 154 for c in bot_config.get('gclient_apply_config', []): |
| 155 self.m.gclient.apply_config(c) | 155 self.m.gclient.apply_config(c) |
| 156 | 156 |
| 157 return (buildername, bot_config) | 157 return (buildername, bot_config) |
| 158 | 158 |
| 159 # TODO(tikuta): Remove use_compile_py=True after removing compile.py. | |
| 159 def compile(self, targets=None, name=None, out_dir=None, | 160 def compile(self, targets=None, name=None, out_dir=None, |
| 160 target=None, use_goma_module=False, **kwargs): | 161 target=None, use_goma_module=False, |
| 162 use_compile_py=True, **kwargs): | |
| 161 """Return a compile.py invocation.""" | 163 """Return a compile.py invocation.""" |
| 162 targets = targets or self.c.compile_py.default_targets.as_jsonish() | 164 targets = targets or self.c.compile_py.default_targets.as_jsonish() |
| 163 assert isinstance(targets, (list, tuple)) | 165 assert isinstance(targets, (list, tuple)) |
| 164 | 166 |
| 165 if self.c.gyp_env.GYP_DEFINES.get('clang', 0) == 1: | 167 if self.c.gyp_env.GYP_DEFINES.get('clang', 0) == 1: |
| 166 # Get the Clang revision before compiling. | 168 # Get the Clang revision before compiling. |
| 167 self._clang_version = self.get_clang_version() | 169 self._clang_version = self.get_clang_version() |
| 168 | 170 |
| 169 goma_env = self.get_env() | 171 goma_env = self.get_env() |
| 170 goma_env.update(kwargs.get('env', {})) | 172 goma_env.update(kwargs.get('env', {})) |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 args += ['--cros-board', self.c.TARGET_CROS_BOARD] | 255 args += ['--cros-board', self.c.TARGET_CROS_BOARD] |
| 254 | 256 |
| 255 args.append('--') | 257 args.append('--') |
| 256 args.extend(targets) | 258 args.extend(targets) |
| 257 | 259 |
| 258 if self.c.TARGET_CROS_BOARD: | 260 if self.c.TARGET_CROS_BOARD: |
| 259 # Wrap 'compile' through 'cros chrome-sdk' | 261 # Wrap 'compile' through 'cros chrome-sdk' |
| 260 kwargs['wrapper'] = self.get_cros_chrome_sdk_wrapper() | 262 kwargs['wrapper'] = self.get_cros_chrome_sdk_wrapper() |
| 261 kwargs.setdefault('cwd', self.m.path['checkout']) | 263 kwargs.setdefault('cwd', self.m.path['checkout']) |
| 262 | 264 |
| 263 if use_goma_module: | 265 if use_goma_module or not use_compile_py: |
| 264 | 266 |
| 265 if self.m.platform.is_linux and self.c.TARGET_CROS_BOARD: | 267 if self.m.platform.is_linux and self.c.TARGET_CROS_BOARD: |
| 266 out_dir = 'out_%s' % self.c.TARGET_CROS_BOARD | 268 out_dir = 'out_%s' % self.c.TARGET_CROS_BOARD |
| 267 elif out_dir is None: | 269 elif out_dir is None: |
| 268 out_dir = 'out' | 270 out_dir = 'out' |
| 269 | 271 |
| 270 target_output_dir = self.m.path.abspath( | 272 target_output_dir = self.m.path.abspath( |
| 271 self.m.path.join(self.m.path['checkout'], out_dir, | 273 self.m.path.join(self.m.path['checkout'], out_dir, |
| 272 target or self.c.build_config_fs)) | 274 target or self.c.build_config_fs)) |
| 273 | 275 |
| 274 command = [str(self.m.depot_tools.ninja_path), '-w', 'dupbuild=err', | 276 command = [str(self.m.depot_tools.ninja_path), '-w', 'dupbuild=err', |
| 275 '-C', target_output_dir] | 277 '-C', target_output_dir] |
| 276 | 278 |
| 277 if self.c.compile_py.build_args: | 279 if self.c.compile_py.build_args: |
| 278 command.extend(self.c.compile_py.build_args) | 280 command.extend(self.c.compile_py.build_args) |
| 279 | 281 |
| 280 # Set -j just before 'with self.m.goma.build_with_goma(' | 282 if use_goma_module: |
| 281 # for ninja_log_command being set correctly if starting goma | 283 # Set -j just before 'with self.m.goma.build_with_goma(' |
| 282 # fails. | 284 # for ninja_log_command being set correctly if starting goma |
| 283 command += ['-j', self.m.goma.recommended_goma_jobs] | 285 # fails. |
| 286 command += ['-j', self.m.goma.recommended_goma_jobs] | |
| 284 | 287 |
| 285 if targets is not None: | 288 if targets is not None: |
| 286 # Add build targets to command ('All', 'chrome' etc). | 289 # Add build targets to command ('All', 'chrome' etc). |
| 287 command += targets | 290 command += targets |
| 288 | 291 |
| 292 kwargs.pop('env', {}) | |
| 293 | |
| 289 # TODO(tikuta): Set disable_local_fallback option appropriately. | 294 # TODO(tikuta): Set disable_local_fallback option appropriately. |
| 290 with self.m.goma.build_with_goma( | 295 if use_goma_module: |
| 291 env=goma_env, | 296 with self.m.goma.build_with_goma( |
| 292 ninja_log_outdir=target_output_dir, | 297 env=goma_env, |
| 293 ninja_log_compiler=self.c.compile_py.compiler or 'goma', | 298 ninja_log_outdir=target_output_dir, |
| 294 ninja_log_command=command, | 299 ninja_log_compiler=self.c.compile_py.compiler or 'goma', |
| 295 allow_build_without_goma=allow_build_without_goma): | 300 ninja_log_command=command, |
| 296 if 'GOMA_DISABLED' in goma_env: | 301 allow_build_without_goma=allow_build_without_goma): |
|
ukai
2016/11/04 02:35:45
goma.build_with_goma says env should be used for n
tikuta
2016/11/04 03:09:02
Hmm, please let me make another CL for this.
I thi
| |
| 297 self.m.goma.remove_j_flag(command) | 302 if 'GOMA_DISABLED' in goma_env: |
| 298 | 303 self.m.goma.remove_j_flag(command) |
| 299 if self.m.platform.is_win: | 304 ninja_env['GOMA_DISABLED'] = 'true' |
| 300 self.m.python('update windows env', | 305 if self.m.platform.is_win: |
| 301 script=self.package_repo_resource( | 306 self.m.python('update windows env', |
| 302 'scripts', 'slave', 'update_windows_env.py'), | 307 script=self.package_repo_resource( |
| 303 args=['--envfile-dir', str(target_output_dir)], | 308 'scripts', 'slave', 'update_windows_env.py'), |
| 304 env=goma_env) | 309 args=['--envfile-dir', str(target_output_dir)], |
| 305 ninja_env.update(kwargs.pop('env', {})) | 310 env=goma_env) |
| 311 self.m.step(name or 'compile with ninja', | |
| 312 command, | |
| 313 env=ninja_env, | |
| 314 **kwargs) | |
| 315 else: | |
| 306 self.m.step(name or 'compile with ninja', | 316 self.m.step(name or 'compile with ninja', |
| 307 command, | 317 command, |
| 308 env=ninja_env, | 318 env=ninja_env, |
| 309 **kwargs) | 319 **kwargs) |
| 310 return | 320 return |
| 311 | 321 |
| 312 env = self.get_env() | 322 env = self.get_env() |
| 313 env.update(kwargs.pop('env', {})) | 323 env.update(kwargs.pop('env', {})) |
| 314 | 324 |
| 315 try: | 325 try: |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 903 })) | 913 })) |
| 904 | 914 |
| 905 def get_annotate_by_test_name(self, test_name): | 915 def get_annotate_by_test_name(self, test_name): |
| 906 return 'graphing' | 916 return 'graphing' |
| 907 | 917 |
| 908 def download_lto_plugin(self): | 918 def download_lto_plugin(self): |
| 909 return self.m.python( | 919 return self.m.python( |
| 910 name='download LTO plugin', | 920 name='download LTO plugin', |
| 911 script=self.m.path['checkout'].join( | 921 script=self.m.path['checkout'].join( |
| 912 'build', 'download_gold_plugin.py')) | 922 'build', 'download_gold_plugin.py')) |
| OLD | NEW |