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