classes/insane.bbclass: Grep through config.log to check for CROSS Compile errors
authorHolger Freyther <zecke@selfish.org>
Fri, 16 Feb 2007 15:45:38 +0000 (15:45 +0000)
committerHolger Freyther <zecke@selfish.org>
Fri, 16 Feb 2007 15:45:38 +0000 (15:45 +0000)
-Inspired by doku's work on mpd's buildsystem grep through
 the config.log and find broken autotools tests
-Make errors fatal so we will notice these things more quickly.

classes/insane.bbclass

index e303752..2599348 100644 (file)
@@ -9,6 +9,7 @@
 #  -Check if .la files wrongly point to workdir
 #  -Check if .pc files wrongly point to workdir
 #  -Check if packages contains .debug directories  or .so files where they should be in -dev or -dbg
+#  -Check if config.log contains traces to broken autoconf tests
 #
 
 
@@ -33,12 +34,12 @@ def package_qa_check_rpath(file,name,d):
     if not os.path.exists(scanelf):
         bb.note("Can not check RPATH scanelf not found")
     if not bad_dir in bb.data.getVar('WORKDIR', d, True):
-        bb.error("This class assumed that WORKDIR is ${TMPDIR}/work... Not doing any check")
+        bb.fatal("This class assumed that WORKDIR is ${TMPDIR}/work... Not doing any check")
 
     output = os.popen("%s -Byr %s" % (scanelf,file))
     txt    = output.readline().rsplit()
     if bad_dir in txt:
-        bb.error("QA Issue package %s contains bad RPATH %s in file %s" % (name, txt, file))
+        bb.fatal("QA Issue package %s contains bad RPATH %s in file %s" % (name, txt, file))
 
     pass
 
@@ -51,11 +52,11 @@ def package_qa_check_devdbg(path, name,d):
     import bb
     if not "-dev" in name:
         if path[-3:] == ".so":
-            bb.error("QA Issue: non dev package contains .so: %s" % name)
+            bb.fatal("QA Issue: non dev package contains .so: %s" % name)
 
     if not "-dbg" in name:
         if '.debug' in path:
-            bb.error("QA Issue: non debug package contains .debug directory: %s" % name)
+            bb.fatal("QA Issue: non debug package contains .debug directory: %s" % name)
 
 def package_qa_check_perm(path,name,d):
     """
@@ -121,7 +122,7 @@ def package_qa_check_rdepends(pkg, workdir, d):
         # Now do the sanity check!!!
         for rdepend in rdepends:
             if "-dbg" in rdepend:
-                bb.error("QA issue, koen give us a better msg!!!")
+                bb.fatal("QA issue, koen give us a better msg!!!")
 
 # The PACKAGE FUNC to scan each package
 python do_package_qa () {
@@ -149,3 +150,14 @@ python do_qa_staging() {
 
     package_qa_check_staged(bb.data.getVar('STAGING_DIR',d,True), d)
 }
+
+# Check broken config.log files
+addtask qa_configure after do_configure before do_compile
+python do_qa_configure() {
+    bb.note("Checking sanity of the config.log file")
+    import os
+    for root, dirs, files in os.walk(bb.data.getVar('S', d, True)):
+        if "config.log" in files:
+            if os.system("grep 'CROSS COMPILE Badness:' %s > /dev/null" % (os.path.join(root,"config.log"))) == 0:
+                bb.fatal("This autoconf log indicates errors, it looked at host includes")
+}