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

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

Issue 1917243002: Revert "build: roll infra_paths changes" (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 8 months 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 'depot_tools/bot_update', 8 'depot_tools/bot_update',
9 'depot_tools/infra_paths',
10 'chromium', 9 'chromium',
11 'commit_position', 10 'commit_position',
12 'file', 11 'file',
13 'depot_tools/gclient', 12 'depot_tools/gclient',
14 'gsutil', 13 'gsutil',
15 'recipe_engine/json', 14 'recipe_engine/json',
16 'recipe_engine/path', 15 'recipe_engine/path',
17 'recipe_engine/properties', 16 'recipe_engine/properties',
18 'recipe_engine/python', 17 'recipe_engine/python',
19 'recipe_engine/raw_io', 18 'recipe_engine/raw_io',
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 # Copy the created output to the correct directory. When running the clang 159 # Copy the created output to the correct directory. When running the clang
161 # tool, it is assumed by the scripts that the compilation database is in the 160 # tool, it is assumed by the scripts that the compilation database is in the
162 # out/Debug directory, and named 'compile_commands.json'. 161 # out/Debug directory, and named 'compile_commands.json'.
163 api.step('copy compilation database', 162 api.step('copy compilation database',
164 ['cp', api.raw_io.input(data=result.stdout), 163 ['cp', api.raw_io.input(data=result.stdout),
165 debug_path.join('compile_commands.json')]) 164 debug_path.join('compile_commands.json')])
166 165
167 if platform == 'chromeos': 166 if platform == 'chromeos':
168 result = GenerateCompilationDatabase(api, debug_path, targets, 'linux') 167 result = GenerateCompilationDatabase(api, debug_path, targets, 'linux')
169 api.python('Filter out duplicate compilation units', 168 api.python('Filter out duplicate compilation units',
170 api.infra_paths['build'].join('scripts', 'slave', 'chromium', 169 api.path['build'].join('scripts', 'slave', 'chromium',
171 'filter_compilations.py'), 170 'filter_compilations.py'),
172 ['--compdb-input', debug_path.join('compile_commands.json'), 171 ['--compdb-input', debug_path.join('compile_commands.json'),
173 '--compdb-filter', api.raw_io.input(data=result.stdout), 172 '--compdb-filter', api.raw_io.input(data=result.stdout),
174 '--compdb-output', debug_path.join('compile_commands.json')]) 173 '--compdb-output', debug_path.join('compile_commands.json')])
175 # Compile the clang tool 174 # Compile the clang tool
176 script_path = api.path.sep.join(['tools', 'clang', 'scripts', 'update.py']) 175 script_path = api.path.sep.join(['tools', 'clang', 'scripts', 'update.py'])
177 api.step('compile translation_unit clang tool', 176 api.step('compile translation_unit clang tool',
178 [script_path, '--force-local-build', '--without-android', 177 [script_path, '--force-local-build', '--without-android',
179 '--tools', 'translation_unit'], 178 '--tools', 'translation_unit'],
180 cwd=api.path['checkout']) 179 cwd=api.path['checkout'])
(...skipping 16 matching lines...) Expand all
197 api.step.active_result.presentation.step_text = f.reason_message() 196 api.step.active_result.presentation.step_text = f.reason_message()
198 api.step.active_result.presentation.status = api.step.WARNING 197 api.step.active_result.presentation.status = api.step.WARNING
199 198
200 # Create the index pack 199 # Create the index pack
201 got_revision_cp = api.chromium.build_properties.get('got_revision_cp') 200 got_revision_cp = api.chromium.build_properties.get('got_revision_cp')
202 commit_position = api.commit_position.parse_revision(got_revision_cp) 201 commit_position = api.commit_position.parse_revision(got_revision_cp)
203 index_pack_name = 'index_pack_%s.zip' % platform 202 index_pack_name = 'index_pack_%s.zip' % platform
204 index_pack_name_with_revision = 'index_pack_%s_%s.zip' % ( 203 index_pack_name_with_revision = 'index_pack_%s_%s.zip' % (
205 platform, commit_position) 204 platform, commit_position)
206 api.python('create index pack', 205 api.python('create index pack',
207 api.infra_paths['build'].join('scripts', 'slave', 'chromium', 206 api.path['build'].join('scripts', 'slave', 'chromium',
208 'package_index.py'), 207 'package_index.py'),
209 ['--path-to-compdb', debug_path.join('compile_commands.json'), 208 ['--path-to-compdb', debug_path.join('compile_commands.json'),
210 '--path-to-archive-output', debug_path.join(index_pack_name)]) 209 '--path-to-archive-output', debug_path.join(index_pack_name)])
211 210
212 # Upload the index pack 211 # Upload the index pack
213 api.gsutil.upload( 212 api.gsutil.upload(
214 name='upload index pack', 213 name='upload index pack',
215 source=debug_path.join(index_pack_name), 214 source=debug_path.join(index_pack_name),
216 bucket=BUCKET_NAME, 215 bucket=BUCKET_NAME,
217 dest='%s/%s' % (environment, index_pack_name_with_revision) 216 dest='%s/%s' % (environment, index_pack_name_with_revision)
218 ) 217 )
219 218
220 # Package the source code. 219 # Package the source code.
221 tarball_name = 'chromium_src_%s.tar.bz2' % platform 220 tarball_name = 'chromium_src_%s.tar.bz2' % platform
222 tarball_name_with_revision = 'chromium_src_%s_%s.tar.bz2' % ( 221 tarball_name_with_revision = 'chromium_src_%s_%s.tar.bz2' % (
223 platform,commit_position) 222 platform,commit_position)
224 api.python('archive source', 223 api.python('archive source',
225 api.infra_paths['build'].join('scripts','slave', 224 api.path['build'].join('scripts','slave',
226 'archive_source_codesearch.py'), 225 'archive_source_codesearch.py'),
227 ['src', 'build', 'infra', 'tools', '-f', 226 ['src', 'build', 'infra', 'tools', '-f',
228 tarball_name]) 227 tarball_name])
229 228
230 # Upload the source code. 229 # Upload the source code.
231 api.gsutil.upload( 230 api.gsutil.upload(
232 name='upload source tarball', 231 name='upload source tarball',
233 source=api.infra_paths['slave_build'].join(tarball_name), 232 source=api.path['slave_build'].join(tarball_name),
234 bucket=BUCKET_NAME, 233 bucket=BUCKET_NAME,
235 dest='%s/%s' % (environment, tarball_name_with_revision) 234 dest='%s/%s' % (environment, tarball_name_with_revision)
236 ) 235 )
237 236
238 def _sanitize_nonalpha(text): 237 def _sanitize_nonalpha(text):
239 return ''.join(c if c.isalnum() else '_' for c in text) 238 return ''.join(c if c.isalnum() else '_' for c in text)
240 239
241 240
242 def GenTests(api): 241 def GenTests(api):
243 for buildername, config in SPEC['builders'].iteritems(): 242 for buildername, config in SPEC['builders'].iteritems():
(...skipping 13 matching lines...) Expand all
257 api.test( 256 api.test(
258 'full_%s_fail' % _sanitize_nonalpha('ChromiumOS Codesearch')) + 257 'full_%s_fail' % _sanitize_nonalpha('ChromiumOS Codesearch')) +
259 api.step_data('generate compilation database for chromeos', 258 api.step_data('generate compilation database for chromeos',
260 stdout=api.raw_io.output('some compilation data')) + 259 stdout=api.raw_io.output('some compilation data')) +
261 api.step_data('generate compilation database for linux', 260 api.step_data('generate compilation database for linux',
262 stdout=api.raw_io.output('some compilation data')) + 261 stdout=api.raw_io.output('some compilation data')) +
263 api.step_data('run translation_unit clang tool', retcode=2) + 262 api.step_data('run translation_unit clang tool', retcode=2) +
264 api.properties.generic(buildername='ChromiumOS Codesearch', 263 api.properties.generic(buildername='ChromiumOS Codesearch',
265 mastername='chromium.infra.cron') 264 mastername='chromium.infra.cron')
266 ) 265 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698