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

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: 1 -> true 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
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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 # for ninja_log_command being set correctly if starting goma 284 # for ninja_log_command being set correctly if starting goma
285 # fails. 285 # fails.
286 command += ['-j', self.m.goma.recommended_goma_jobs] 286 command += ['-j', self.m.goma.recommended_goma_jobs]
287 287
288 if targets is not None: 288 if targets is not None:
289 # Add build targets to command ('All', 'chrome' etc). 289 # Add build targets to command ('All', 'chrome' etc).
290 command += targets 290 command += targets
291 291
292 kwargs.pop('env', {}) 292 kwargs.pop('env', {})
293 293
294 # TODO(tikuta): Set disable_local_fallback option appropriately.
295 if use_goma_module: 294 if use_goma_module:
296 with self.m.goma.build_with_goma( 295 with self.m.goma.build_with_goma(
297 env=goma_env, 296 env=goma_env,
298 ninja_log_outdir=target_output_dir, 297 ninja_log_outdir=target_output_dir,
299 ninja_log_compiler=self.c.compile_py.compiler or 'goma', 298 ninja_log_compiler=self.c.compile_py.compiler or 'goma',
300 ninja_log_command=command, 299 ninja_log_command=command,
301 allow_build_without_goma=allow_build_without_goma): 300 allow_build_without_goma=allow_build_without_goma) as (
302 if 'GOMA_DISABLED' in goma_env: 301 env_update, ninja_command):
303 self.m.goma.remove_j_flag(command) 302 ninja_env.update(env_update)
304 ninja_env['GOMA_DISABLED'] = 'true' 303 if self.m.platform.is_win and 'GOMA_DISABLED' in env_update:
305 if self.m.platform.is_win: 304 goma_env.update(goma_env)
306 self.m.python('update windows env', 305 self.m.python('update windows env',
307 script=self.package_repo_resource( 306 script=self.package_repo_resource(
308 'scripts', 'slave', 'update_windows_env.py'), 307 'scripts', 'slave', 'update_windows_env.py'),
309 args=['--envfile-dir', str(target_output_dir)], 308 args=['--envfile-dir', str(target_output_dir)],
310 env=goma_env) 309 env=goma_env)
311 self.m.step(name or 'compile with ninja', 310 self.m.step(name or 'compile with ninja',
312 command, 311 ninja_command,
313 env=ninja_env, 312 env=ninja_env,
314 **kwargs) 313 **kwargs)
315 else: 314 else:
316 self.m.step(name or 'compile with ninja', 315 self.m.step(name or 'compile with ninja',
317 command, 316 command,
318 env=ninja_env, 317 env=ninja_env,
319 **kwargs) 318 **kwargs)
320 return 319 return
321 320
322 env = self.get_env() 321 env = self.get_env()
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 })) 910 }))
912 911
913 def get_annotate_by_test_name(self, test_name): 912 def get_annotate_by_test_name(self, test_name):
914 return 'graphing' 913 return 'graphing'
915 914
916 def download_lto_plugin(self): 915 def download_lto_plugin(self):
917 return self.m.python( 916 return self.m.python(
918 name='download LTO plugin', 917 name='download LTO plugin',
919 script=self.m.path['checkout'].join( 918 script=self.m.path['checkout'].join(
920 'build', 'download_gold_plugin.py')) 919 'build', 'download_gold_plugin.py'))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698