Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH][autobuild] Use last 4 lines of log instead of 3 when getting failure reason
@ 2016-10-26 10:45 Vlad Zakharov
  2016-10-26 11:52 ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Vlad Zakharov @ 2016-10-26 10:45 UTC (permalink / raw)
  To: buildroot

Latest versions of make produce a bit different output than older
versions do. They also print number of line in Makefile where the
failure occurred.

E.g. latest make produces the following output:
---------------------------------->8------------------------------------
GNUmakefile:277: recipe for target 'cgiedit.o' failed
make[2]: *** [cgiedit.o] Error 1
package/pkg-generic.mk:201: recipe for target '/home/buildroot/autobuild/run/instance-2/output/build/privoxy-3.0.26/.stamp_built' failed
make[1]: *** [/home/buildroot/autobuild/run/instance-2/output/build/privoxy-3.0.26/.stamp_built] Error 2
Makefile:88: recipe for target '_all' failed
make: *** [_all] Error 2
make: Leaving directory '/home/buildroot/autobuild/run/instance-2/buildroot'
---------------------------------->8------------------------------------

When with old version we get something like:
---------------------------------->8------------------------------------
make[2]: *** [cgiedit.o] Error 1
make[1]: *** [/home/buildroot/autobuild/run/instance-1/output/build/privoxy-3.0.26/.stamp_built] Error 2
make: *** [_all] Error 2
make: Leaving directory `/home/buildroot/autobuild/run/instance-1/buildroot'
---------------------------------->8------------------------------------

So latest make produce much more "noise" and we have to analyze
at least 4 last lines of log to be sure that they contain a line
with failure reason.

Signed-off-by: Vlad Zakharov <vzakhar@synopsys.com>
---
 scripts/autobuild-run | 2 +-
 web/import.inc.php    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/autobuild-run b/scripts/autobuild-run
index 0fa5fdc..8c86a29 100755
--- a/scripts/autobuild-run
+++ b/scripts/autobuild-run
@@ -667,7 +667,7 @@ def send_results(result, **kwargs):
     def get_failure_reason():
         # Output is a tuple (package, version), or None.
         lastlines = decode_bytes(subprocess.Popen(
-            ["tail", "-n", "3", os.path.join(outputdir, "logfile")],
+            ["tail", "-n", "4", os.path.join(outputdir, "logfile")],
             stdout=subprocess.PIPE).communicate()[0]).splitlines()
 
         regexp = re.compile(r'make: \*\*\* .*/(?:build|toolchain)/([^/]*)/')
diff --git a/web/import.inc.php b/web/import.inc.php
index 243a1f3..3be1251 100644
--- a/web/import.inc.php
+++ b/web/import.inc.php
@@ -102,7 +102,7 @@ function import_result($buildid, $filename)
       $reason = "none";
     else {
 	$tmp = Array();
-	exec("tail -3 " . $thisbuildfinaldir . "build-end.log | grep -v '\[_all\]' | grep 'make.*: \*\*\*' | sed 's,.*\[\([^\]*\)\] Error.*,\\1,' | sed 's,.*/build/\([^/]*\)/.*,\\1,'", $tmp);
+	exec("tail -4 " . $thisbuildfinaldir . "build-end.log | grep -v '\[_all\]' | grep 'make.*: \*\*\*' | sed 's,.*\[\([^\]*\)\] Error.*,\\1,' | sed 's,.*/build/\([^/]*\)/.*,\\1,'", $tmp);
 	if (trim($tmp[0]))
 	  $reason = $tmp[0];
 	else
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-04-15  7:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-26 10:45 [Buildroot] [PATCH][autobuild] Use last 4 lines of log instead of 3 when getting failure reason Vlad Zakharov
2016-10-26 11:52 ` Thomas Petazzoni
2016-10-26 12:29   ` Vlad Zakharov
2016-11-11 16:04     ` Vlad Zakharov
2017-04-14 22:48       ` Arnout Vandecappelle
2017-04-15  7:25         ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox