Chromium Code Reviews| Index: scripts/slave/recipes/chromium_codesearch.py |
| diff --git a/scripts/slave/recipes/chromium_codesearch.py b/scripts/slave/recipes/chromium_codesearch.py |
| index 6fcb3e29366914cf39e78312408945b4802c5782..3256372aea6374bcde40b42bc3d0e5a938c101d9 100644 |
| --- a/scripts/slave/recipes/chromium_codesearch.py |
| +++ b/scripts/slave/recipes/chromium_codesearch.py |
| @@ -5,11 +5,12 @@ |
| from recipe_engine.types import freeze |
| DEPS = [ |
| - 'depot_tools/bot_update', |
| 'chromium', |
| 'commit_position', |
| - 'file', |
| + 'depot_tools/bot_update', |
| 'depot_tools/gclient', |
| + 'file', |
| + 'goma', |
| 'gsutil', |
| 'recipe_engine/json', |
| 'recipe_engine/path', |
| @@ -45,10 +46,8 @@ LINUX_GN_ARGS = [ |
| 'is_clang=true', |
| 'is_component_build=true', |
| 'is_debug=true', |
| - 'goma_dir="/b/build/goma"', |
| 'symbol_level=1', |
| 'target_cpu="x64"', |
| - 'use_goma=true', |
| ] |
| CHROMEOS_GN_ARGS = LINUX_GN_ARGS + [ |
| @@ -103,15 +102,24 @@ def GenerateCompilationDatabase(api, debug_path, targets, platform): |
| # adjusted. |
| gn_path = api.path['checkout'].join('buildtools', 'linux64', 'gn') |
| args = LINUX_GN_ARGS if platform == 'linux' else CHROMEOS_GN_ARGS |
| + args.extend(['use_goma=true', |
| + 'goma_dir=%s' % api.goma.goma_dir]) |
|
ukai
2016/09/21 07:12:49
hmm. https://build.chromium.org/p/chromium.infra.c
|
| command = [gn_path, 'gen', debug_path, '--args=%s' % ' '.join(args)] |
| api.step('generate build files for %s' % platform, command, |
| cwd=api.path['checkout']) |
| command = ['ninja', '-C', debug_path] + list(targets) |
| # Add the parameters for creating the compilation database. |
| command += ['-t', 'compdb', 'cc', 'cxx', 'objc', 'objcxx'] |
| - return api.step('generate compilation database for %s' % platform, |
| - command, |
| - stdout=api.raw_io.output()) |
| + |
| + command += ['-j', api.goma.recommended_goma_jobs] |
| + |
| + with api.goma.build_with_goma( |
| + ninja_log_outdir=debug_path, |
| + ninja_log_command=command, |
| + ninja_log_compiler='goma'): |
| + return api.step('generate compilation database for %s' % platform, |
| + command, |
| + stdout=api.raw_io.output()) |
| def RunSteps(api): |
| @@ -140,6 +148,7 @@ def RunSteps(api): |
| debug_path = api.path['checkout'].join('out', 'Debug') |
| targets = bot_config.get('compile_targets', []) |
| api.chromium.set_config('codesearch', BUILD_CONFIG='Debug') |
| + api.chromium.ensure_goma() |
| api.chromium.runhooks() |
| result = GenerateCompilationDatabase(api, debug_path, targets, platform) |