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

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

Issue 2480193002: Stop to use contextmanager for goma.build_with_goma (Closed)
Patch Set: rebase 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/goma/api.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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 target_output_dir = self.m.path.abspath( 267 target_output_dir = self.m.path.abspath(
268 self.m.path.join(self.m.path['checkout'], out_dir, 268 self.m.path.join(self.m.path['checkout'], out_dir,
269 target or self.c.build_config_fs)) 269 target or self.c.build_config_fs))
270 270
271 command = [str(self.m.depot_tools.ninja_path), '-w', 'dupbuild=err', 271 command = [str(self.m.depot_tools.ninja_path), '-w', 'dupbuild=err',
272 '-C', target_output_dir] 272 '-C', target_output_dir]
273 273
274 if self.c.compile_py.build_args: 274 if self.c.compile_py.build_args:
275 command.extend(self.c.compile_py.build_args) 275 command.extend(self.c.compile_py.build_args)
276 276
277 # TODO(tikuta): Remove this and let goma module set '-j'
278 # inside build_with_goma.
277 if use_goma_module: 279 if use_goma_module:
278 # Set -j just before 'with self.m.goma.build_with_goma(' 280 # Set -j just before 'with self.m.goma.build_with_goma('
279 # for ninja_log_command being set correctly if starting goma 281 # for ninja_log_command being set correctly if starting goma
280 # fails. 282 # fails.
281 command += ['-j', self.m.goma.recommended_goma_jobs] 283 command += ['-j', self.m.goma.recommended_goma_jobs]
282 284
283 if targets is not None: 285 if targets is not None:
284 # Add build targets to command ('All', 'chrome' etc). 286 # Add build targets to command ('All', 'chrome' etc).
285 command += targets 287 command += targets
286 288
287 kwargs.pop('env', {}) 289 kwargs.pop('env', {})
288 290
289 # TODO(tikuta): Set disable_local_fallback option appropriately.
290 if use_goma_module: 291 if use_goma_module:
291 with self.m.goma.build_with_goma( 292 self.m.goma.build_with_goma(
292 env=goma_env, 293 name=name or 'compile',
294 ninja_command=command,
295 ninja_env=ninja_env,
296 goma_env=goma_env,
293 ninja_log_outdir=target_output_dir, 297 ninja_log_outdir=target_output_dir,
294 ninja_log_compiler=self.c.compile_py.compiler or 'goma', 298 ninja_log_compiler=self.c.compile_py.compiler or 'goma',
295 ninja_log_command=command, 299 allow_build_without_goma=allow_build_without_goma,
296 allow_build_without_goma=allow_build_without_goma): 300 **kwargs)
297 if 'GOMA_DISABLED' in goma_env:
298 self.m.goma.remove_j_flag(command)
299 ninja_env['GOMA_DISABLED'] = 'true'
300 if self.m.platform.is_win:
301 self.m.python('update windows env',
302 script=self.package_repo_resource(
303 'scripts', 'slave', 'update_windows_env.py'),
304 args=['--envfile-dir', str(target_output_dir)],
305 env=goma_env)
306 self.m.step(name or 'compile',
307 command,
308 env=ninja_env,
309 **kwargs)
310 else: 301 else:
311 self.m.step(name or 'compile', 302 self.m.step(name or 'compile',
312 command, 303 command,
313 env=ninja_env, 304 env=ninja_env,
314 **kwargs) 305 **kwargs)
315 return 306 return
316 307
317 env = self.get_env() 308 env = self.get_env()
318 env.update(kwargs.pop('env', {})) 309 env.update(kwargs.pop('env', {}))
319 310
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 })) 898 }))
908 899
909 def get_annotate_by_test_name(self, test_name): 900 def get_annotate_by_test_name(self, test_name):
910 return 'graphing' 901 return 'graphing'
911 902
912 def download_lto_plugin(self): 903 def download_lto_plugin(self):
913 return self.m.python( 904 return self.m.python(
914 name='download LTO plugin', 905 name='download LTO plugin',
915 script=self.m.path['checkout'].join( 906 script=self.m.path['checkout'].join(
916 'build', 'download_gold_plugin.py')) 907 'build', 'download_gold_plugin.py'))
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/goma/api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698