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

Unified Diff: scripts/slave/recipe_modules/chromium/api.py

Issue 1766873002: Collect failed "target"s from ninja in the compile step on Waterfall. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@check_target_existence
Patch Set: Rebase. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/slave/compile.py ('k') | scripts/slave/recipes/findit/chromium/compile.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/chromium/api.py
diff --git a/scripts/slave/recipe_modules/chromium/api.py b/scripts/slave/recipe_modules/chromium/api.py
index 9074871496a1250a7efa6b6d235805ca8fcc9566..cd21580bb227c77ae7f5bc914677876043bae253 100644
--- a/scripts/slave/recipe_modules/chromium/api.py
+++ b/scripts/slave/recipe_modules/chromium/api.py
@@ -166,6 +166,11 @@ class ChromiumApi(recipe_api.RecipeApi):
args += ['--build-args', self.c.compile_py.build_args]
if self.c.compile_py.build_tool:
args += ['--build-tool', self.c.compile_py.build_tool]
+ if self.c.compile_py.build_tool == 'ninja':
+ # Collect info of compile failure from ninja 1.7+.
+ args += [
+ '--ninja-compile-failure',
+ self.m.json.output(add_json_log=False, name='ninja-compile-failure')]
if self.m.properties.get('build_data_dir'):
args += ['--build-data-dir', self.m.properties.get('build_data_dir')]
if self.c.compile_py.cross_tool:
@@ -254,6 +259,17 @@ class ChromiumApi(recipe_api.RecipeApi):
properties['extra_result_code'].append(failure_result_code)
raise self.m.step.InfraFailure('Infra compile failure: %s' % e)
+ if self.c.compile_py.build_tool == 'ninja':
+ # Report failed compile "target"s from ninja as a build property so that
+ # automated tools/service like Findit could use them for the purpose of
+ # culprit finding, etc.
+ # When there is an infra failure like goma outage above, no info is
+ # collected from ninja.
+ step_result = self.m.step.active_result
+ failures = (step_result.json.outputs['ninja-compile-failure'] or
+ {'unknown_failures': True})
+ step_result.presentation.properties['compile_failures'] = failures
+
raise e
@recipe_util.returns_placeholder
« no previous file with comments | « scripts/slave/compile.py ('k') | scripts/slave/recipes/findit/chromium/compile.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698