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

Side by Side 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, 7 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
« no previous file with comments | « scripts/slave/compile.py ('k') | scripts/slave/recipes/findit/chromium/compile.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 import re 5 import re
6 6
7 from recipe_engine import recipe_api 7 from recipe_engine import recipe_api
8 from recipe_engine import util as recipe_util 8 from recipe_engine import util as recipe_util
9 9
10 class TestLauncherFilterFileInputPlaceholder(recipe_util.InputPlaceholder): 10 class TestLauncherFilterFileInputPlaceholder(recipe_util.InputPlaceholder):
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 '--gsutil-py-path', self.m.depot_tools.gsutil_py_path, 159 '--gsutil-py-path', self.m.depot_tools.gsutil_py_path,
160 '--ninja-path', self.m.depot_tools.ninja_path, 160 '--ninja-path', self.m.depot_tools.ninja_path,
161 '--target', target or self.c.build_config_fs, 161 '--target', target or self.c.build_config_fs,
162 '--src-dir', self.m.path['checkout'], 162 '--src-dir', self.m.path['checkout'],
163 '--goma-cache-dir', self.m.path['goma_cache'], 163 '--goma-cache-dir', self.m.path['goma_cache'],
164 ] 164 ]
165 if self.c.compile_py.build_args: 165 if self.c.compile_py.build_args:
166 args += ['--build-args', self.c.compile_py.build_args] 166 args += ['--build-args', self.c.compile_py.build_args]
167 if self.c.compile_py.build_tool: 167 if self.c.compile_py.build_tool:
168 args += ['--build-tool', self.c.compile_py.build_tool] 168 args += ['--build-tool', self.c.compile_py.build_tool]
169 if self.c.compile_py.build_tool == 'ninja':
170 # Collect info of compile failure from ninja 1.7+.
171 args += [
172 '--ninja-compile-failure',
173 self.m.json.output(add_json_log=False, name='ninja-compile-failure')]
169 if self.m.properties.get('build_data_dir'): 174 if self.m.properties.get('build_data_dir'):
170 args += ['--build-data-dir', self.m.properties.get('build_data_dir')] 175 args += ['--build-data-dir', self.m.properties.get('build_data_dir')]
171 if self.c.compile_py.cross_tool: 176 if self.c.compile_py.cross_tool:
172 args += ['--crosstool', self.c.compile_py.cross_tool] 177 args += ['--crosstool', self.c.compile_py.cross_tool]
173 if self.c.compile_py.compiler: 178 if self.c.compile_py.compiler:
174 args += ['--compiler', self.c.compile_py.compiler] 179 args += ['--compiler', self.c.compile_py.compiler]
175 if 'goma' in self.c.compile_py.compiler: 180 if 'goma' in self.c.compile_py.compiler:
176 args += [ 181 args += [
177 '--goma-jsonstatus', self.m.json.output(), 182 '--goma-jsonstatus', self.m.json.output(),
178 ] 183 ]
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 if failure_result_code: 252 if failure_result_code:
248 # Mark goma setup failure as exception instead of step failure. 253 # Mark goma setup failure as exception instead of step failure.
249 step_result.presentation.status = self.m.step.EXCEPTION 254 step_result.presentation.status = self.m.step.EXCEPTION
250 assert len(failure_result_code) <= 20 255 assert len(failure_result_code) <= 20
251 properties = self.m.step.active_result.presentation.properties 256 properties = self.m.step.active_result.presentation.properties
252 if not properties.get('extra_result_code'): 257 if not properties.get('extra_result_code'):
253 properties['extra_result_code'] = [] 258 properties['extra_result_code'] = []
254 properties['extra_result_code'].append(failure_result_code) 259 properties['extra_result_code'].append(failure_result_code)
255 raise self.m.step.InfraFailure('Infra compile failure: %s' % e) 260 raise self.m.step.InfraFailure('Infra compile failure: %s' % e)
256 261
262 if self.c.compile_py.build_tool == 'ninja':
263 # Report failed compile "target"s from ninja as a build property so that
264 # automated tools/service like Findit could use them for the purpose of
265 # culprit finding, etc.
266 # When there is an infra failure like goma outage above, no info is
267 # collected from ninja.
268 step_result = self.m.step.active_result
269 failures = (step_result.json.outputs['ninja-compile-failure'] or
270 {'unknown_failures': True})
271 step_result.presentation.properties['compile_failures'] = failures
272
257 raise e 273 raise e
258 274
259 @recipe_util.returns_placeholder 275 @recipe_util.returns_placeholder
260 def test_launcher_filter(self, tests): 276 def test_launcher_filter(self, tests):
261 return TestLauncherFilterFileInputPlaceholder(self, tests) 277 return TestLauncherFilterFileInputPlaceholder(self, tests)
262 278
263 def runtest(self, test, args=None, xvfb=False, name=None, annotate=None, 279 def runtest(self, test, args=None, xvfb=False, name=None, annotate=None,
264 results_url=None, perf_dashboard_id=None, test_type=None, 280 results_url=None, perf_dashboard_id=None, test_type=None,
265 python_mode=False, spawn_dbus=True, parallel=False, 281 python_mode=False, spawn_dbus=True, parallel=False,
266 revision=None, webkit_revision=None, 282 revision=None, webkit_revision=None,
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 })) 726 }))
711 727
712 def get_annotate_by_test_name(self, test_name): 728 def get_annotate_by_test_name(self, test_name):
713 return 'graphing' 729 return 'graphing'
714 730
715 def download_lto_plugin(self): 731 def download_lto_plugin(self):
716 return self.m.python( 732 return self.m.python(
717 name='download LTO plugin', 733 name='download LTO plugin',
718 script=self.m.path['checkout'].join( 734 script=self.m.path['checkout'].join(
719 'build', 'download_gold_plugin.py')) 735 'build', 'download_gold_plugin.py'))
OLDNEW
« 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