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

Side by Side Diff: scripts/slave/recipes/chromium_codesearch.py

Issue 2480193002: Stop to use contextmanager for goma.build_with_goma (Closed)
Patch Set: fix pylint 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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 from recipe_engine.types import freeze 5 from recipe_engine.types import freeze
6 6
7 DEPS = [ 7 DEPS = [
8 'chromium', 8 'chromium',
9 'commit_position', 9 'commit_position',
10 'depot_tools/bot_update', 10 'depot_tools/bot_update',
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 args = LINUX_GN_ARGS if platform == 'linux' else CHROMEOS_GN_ARGS 103 args = LINUX_GN_ARGS if platform == 'linux' else CHROMEOS_GN_ARGS
104 args.extend(['use_goma=true', 104 args.extend(['use_goma=true',
105 'goma_dir="%s"' % api.goma.goma_dir]) 105 'goma_dir="%s"' % api.goma.goma_dir])
106 command = [gn_path, 'gen', debug_path, '--args=%s' % ' '.join(args)] 106 command = [gn_path, 'gen', debug_path, '--args=%s' % ' '.join(args)]
107 api.step('generate build files for %s' % platform, command, 107 api.step('generate build files for %s' % platform, command,
108 cwd=api.path['checkout']) 108 cwd=api.path['checkout'])
109 command = ['ninja', '-C', debug_path] + list(targets) 109 command = ['ninja', '-C', debug_path] + list(targets)
110 # Add the parameters for creating the compilation database. 110 # Add the parameters for creating the compilation database.
111 command += ['-t', 'compdb', 'cc', 'cxx', 'objc', 'objcxx'] 111 command += ['-t', 'compdb', 'cc', 'cxx', 'objc', 'objcxx']
112 112
113 command += ['-j', api.goma.recommended_goma_jobs]
114
115 with api.goma.build_with_goma( 113 with api.goma.build_with_goma(
116 ninja_log_outdir=debug_path, 114 ninja_log_outdir=debug_path,
117 ninja_log_command=command, 115 ninja_command=command,
118 ninja_log_compiler='goma'): 116 ninja_log_compiler='goma') as (env_update, ninja_command):
119 return api.step('generate compilation database for %s' % platform, 117 return api.step('generate compilation database for %s' % platform,
120 command, 118 ninja_command,
121 stdout=api.raw_io.output()) 119 stdout=api.raw_io.output(),
120 env=env_update)
122 121
123 122
124 def RunSteps(api): 123 def RunSteps(api):
125 buildername = api.properties.get('buildername') 124 buildername = api.properties.get('buildername')
126 125
127 bot_config = SPEC.get('builders', {}).get(buildername) 126 bot_config = SPEC.get('builders', {}).get(buildername)
128 platform = bot_config.get('platform', 'linux') 127 platform = bot_config.get('platform', 'linux')
129 128
130 # Checkout the repositories that are either directly needed or should be 129 # Checkout the repositories that are either directly needed or should be
131 # included in the source archive. 130 # included in the source archive.
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 api.test( 275 api.test(
277 'full_%s_fail' % _sanitize_nonalpha('ChromiumOS Codesearch')) + 276 'full_%s_fail' % _sanitize_nonalpha('ChromiumOS Codesearch')) +
278 api.step_data('generate compilation database for chromeos', 277 api.step_data('generate compilation database for chromeos',
279 stdout=api.raw_io.output('some compilation data')) + 278 stdout=api.raw_io.output('some compilation data')) +
280 api.step_data('generate compilation database for linux', 279 api.step_data('generate compilation database for linux',
281 stdout=api.raw_io.output('some compilation data')) + 280 stdout=api.raw_io.output('some compilation data')) +
282 api.step_data('run translation_unit clang tool', retcode=2) + 281 api.step_data('run translation_unit clang tool', retcode=2) +
283 api.properties.generic(buildername='ChromiumOS Codesearch', 282 api.properties.generic(buildername='ChromiumOS Codesearch',
284 mastername='chromium.infra.cron') 283 mastername='chromium.infra.cron')
285 ) 284 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698