Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Side by Side Diff: scripts/slave/recipe_modules/chromium/api.py

Issue 2466793002: Add option to not use compile.py in chromium recipe_module (Closed)
Patch Set: small modify Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/chromium/example.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 # TODO(tikuta): 266 # TODO(tikuta):
265 # Make it possible to build with TARGET_CROS_BOARD using goma module. 267 # Make it possible to build with TARGET_CROS_BOARD using goma module.
266 assert not self.c.TARGET_CROS_BOARD 268 assert not self.c.TARGET_CROS_BOARD
267 269
268 if out_dir is None: 270 if out_dir is None:
269 out_dir = 'out' 271 out_dir = 'out'
270 272
271 target_output_dir = self.m.path.abspath( 273 target_output_dir = self.m.path.abspath(
272 self.m.path.join(self.m.path['checkout'], out_dir, 274 self.m.path.join(self.m.path['checkout'], out_dir,
273 target or self.c.build_config_fs)) 275 target or self.c.build_config_fs))
274 276
275 command = [str(self.m.depot_tools.ninja_path), '-w', 'dupbuild=err', 277 command = [str(self.m.depot_tools.ninja_path), '-w', 'dupbuild=err',
276 '-C', target_output_dir] 278 '-C', target_output_dir]
277 279
278 if self.c.compile_py.build_args: 280 if self.c.compile_py.build_args:
279 command.extend(self.c.compile_py.build_args) 281 command.extend(self.c.compile_py.build_args)
280 282
281 # Set -j just before 'with self.m.goma.build_with_goma(' 283 if use_goma_module:
282 # for ninja_log_command being set correctly if starting goma 284 # Set -j just before 'with self.m.goma.build_with_goma('
283 # fails. 285 # for ninja_log_command being set correctly if starting goma
284 command += ['-j', self.m.goma.recommended_goma_jobs] 286 # fails.
287 command += ['-j', self.m.goma.recommended_goma_jobs]
285 288
286 if targets is not None: 289 if targets is not None:
287 # Add build targets to command ('All', 'chrome' etc). 290 # Add build targets to command ('All', 'chrome' etc).
288 command += targets 291 command += targets
289 292
293 kwargs.pop('env', {})
294
290 # TODO(tikuta): Set disable_local_fallback option appropriately. 295 # TODO(tikuta): Set disable_local_fallback option appropriately.
291 with self.m.goma.build_with_goma( 296 if use_goma_module:
292 env=goma_env, 297 with self.m.goma.build_with_goma(
293 ninja_log_outdir=target_output_dir, 298 env=goma_env,
294 ninja_log_compiler=self.c.compile_py.compiler or 'goma', 299 ninja_log_outdir=target_output_dir,
295 ninja_log_command=command, 300 ninja_log_compiler=self.c.compile_py.compiler or 'goma',
296 allow_build_without_goma=allow_build_without_goma): 301 ninja_log_command=command,
297 if 'GOMA_DISABLED' in goma_env: 302 allow_build_without_goma=allow_build_without_goma):
298 self.m.goma.remove_j_flag(command) 303 if 'GOMA_DISABLED' in goma_env:
304 self.m.goma.remove_j_flag(command)
299 305
300 if self.m.platform.is_win: 306 if self.m.platform.is_win:
301 self.m.python('update windows env', 307 self.m.python('update windows env',
302 script=self.package_repo_resource( 308 script=self.package_repo_resource(
303 'scripts', 'slave', 'update_windows_env.py'), 309 'scripts', 'slave', 'update_windows_env.py'),
304 args=['--envfile-dir', str(target_output_dir)], 310 args=['--envfile-dir', str(target_output_dir)],
305 env=goma_env) 311 env=goma_env)
306 ninja_env.update(kwargs.pop('env', {})) 312 self.m.step(name or 'compile with ninja',
shinyak 2016/11/01 04:37:09 Could you explain why we don't need to do `ninja_e
tikuta 2016/11/01 04:45:05 I noticed that same thing is done in line 172 and
shinyak 2016/11/01 04:55:22 Oh, I see. Then, maybe it would be good to use kwa
tikuta 2016/11/01 05:08:59 kwargs['env'] is used in line 324. I will use kwar
shinyak (Google) 2016/11/01 05:20:06 Hmm, sorry. if-block from L265 is too large ><
313 command,
314 env=ninja_env,
ukai 2016/11/02 01:22:07 ninja_env will have GOMA_DISABLED if failed to sta
tikuta 2016/11/02 04:51:30 'GOMA_DISABLED' is set in goma_env passed to goma.
315 **kwargs)
316 else:
307 self.m.step(name or 'compile with ninja', 317 self.m.step(name or 'compile with ninja',
308 command, 318 command,
309 env=ninja_env, 319 env=ninja_env,
310 **kwargs) 320 **kwargs)
311 return 321 return
312 322
313 env = self.get_env() 323 env = self.get_env()
314 env.update(kwargs.pop('env', {})) 324 env.update(kwargs.pop('env', {}))
315 325
316 try: 326 try:
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 })) 914 }))
905 915
906 def get_annotate_by_test_name(self, test_name): 916 def get_annotate_by_test_name(self, test_name):
907 return 'graphing' 917 return 'graphing'
908 918
909 def download_lto_plugin(self): 919 def download_lto_plugin(self):
910 return self.m.python( 920 return self.m.python(
911 name='download LTO plugin', 921 name='download LTO plugin',
912 script=self.m.path['checkout'].join( 922 script=self.m.path['checkout'].join(
913 'build', 'download_gold_plugin.py')) 923 'build', 'download_gold_plugin.py'))
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/chromium/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698