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

Unified Diff: appengine/findit/waterfall/extractors.py

Issue 1799313002: [Findit] Collect failed output nodes of compile and link failures by strict regex (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 9 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
Index: appengine/findit/waterfall/extractors.py
diff --git a/appengine/findit/waterfall/extractors.py b/appengine/findit/waterfall/extractors.py
index 0b94f48e3d5569ff5c0f90919c2e9964ad08d173..f55e29f883bc94779b8b363ffdb13e0107065cd2 100644
--- a/appengine/findit/waterfall/extractors.py
+++ b/appengine/findit/waterfall/extractors.py
@@ -2,10 +2,12 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import logging
import os
import re
from waterfall import extractor_util
+from waterfall import waterfall_config
from waterfall.extractor import Extractor
from waterfall.failure_signal import FailureSignal
@@ -129,6 +131,40 @@ class CompileStepExtractor(Extractor):
IOS_BUILDER_NAMES_FOR_COMPILE = ['iOS_Simulator_(dbg)', 'iOS_Device']
MAC_MASTER_NAME_FOR_COMPILE = 'chromium.mac'
+ STRICT_COMPILE_FAILURE_PATTEN = re.compile(
chanli 2016/03/15 06:07:49 nit: It seems that the first 2 lines of compile pa
stgao 2016/03/15 18:32:21 Done.
+ r'^FAILED: \S*/b/build/goma/gomacc '
+ '\S*third_party/llvm-build/Release\+Asserts/bin/clang\+\+ '
+ '-MMD -MF (obj/[^\s-]+\.o)\.d .* '
+ '-c ([^\s-]+(?:cc|c|cpp)) -o (obj/[^\s-]+\.o)$'
chanli 2016/03/15 06:07:49 I think this one can be simplified a little as : r
stgao 2016/03/15 18:32:21 Actually, I went with the \number approach before
+ )
+
+ STRICT_LINK_FAILURE_PATTEN = re.compile(
lijeffrey 2016/03/15 07:12:26 I'm thinking, would it make sense to make these pa
stgao 2016/03/15 18:32:21 I'd not make them into the config. Because this is
+ r'^FAILED: \S*/b/build/goma/gomacc '
+ '\S*third_party/llvm-build/Release\+Asserts/bin/clang\+\+ -Wl,.* '
+ '-o (\S+) -Wl,--start-group .*$'
+ )
+
+ def ExtractFailedOutputNodes(self, line, signal):
+ match = self.STRICT_COMPILE_FAILURE_PATTEN.match(line)
+ if match:
+ dep_obj_name = match.group(1)
+ source = match.group(2)
+ target = match.group(3)
+ if dep_obj_name == target:
+ signal.AddTarget({
+ 'target': target,
+ 'source': source,
+ })
+ else:
+ logging.error('Unexpected compile failure pattern:%s', line)
+ else:
+ match = self.STRICT_LINK_FAILURE_PATTEN.match(line)
+ if match:
+ target = match.group(1)
+ signal.AddTarget({
+ 'target': target,
+ })
+
def GetFailedTarget(self, line, signal):
match = self.LINUX_FAILED_SOURCE_TARGET_PATTERN.search(line)
@@ -199,9 +235,14 @@ class CompileStepExtractor(Extractor):
else:
error_lines.append(line)
else:
+ strict_regex = waterfall_config.EnableStrictRegexForCompileLinkFailures(
+ master_name, bot_name)
for line in failure_log.splitlines():
if line.startswith(self.FAILURE_START_LINE_PREFIX):
- self.GetFailedTarget(line, signal)
+ if strict_regex:
+ self.ExtractFailedOutputNodes(line, signal)
chanli 2016/03/15 06:07:49 What if strict_regex is true but the line doesn't
stgao 2016/03/15 18:32:21 Then we ignore and let "analyze" to figure out wha
+ else:
+ self.GetFailedTarget(line, signal)
if not failure_started:
failure_started = True
continue # pragma: no cover
@@ -209,7 +250,8 @@ class CompileStepExtractor(Extractor):
# It is possible the target and source file associated with a compile
# failure is logged outside a 'FAILED: ... 1 error generated' block,
# so extract regardless of failure_started.
- self.GetFailedTarget(line, signal)
+ if not strict_regex:
+ self.GetFailedTarget(line, signal)
elif failure_started and self.ERROR_LINE_END_PATTERN.match(line):
failure_started = False
elif failure_started and line.startswith(

Powered by Google App Engine
This is Rietveld 408576698