]> code.ossystems Code Review - openembedded-core.git/commitdiff
insane: Update the insane class to check for host contamination
authorMark Hatle <mark.hatle@windriver.com>
Thu, 30 Sep 2010 20:50:42 +0000 (15:50 -0500)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 1 Oct 2010 17:45:32 +0000 (18:45 +0100)
[BUGID #376]

Update to the insane class to detect the new gcc and binutils poison
messages located within the config.log.  (Continue to scan for the old
style message.)

Add a new compile and install log check to the package_qa that scans the
logs for the same types of messages "unsafe for cross-compilation".

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
meta/classes/insane.bbclass

index f59860b18b170cd38c9c464a6500330173ff947f..2696a6fc087097b1a2fdd941e0739f0cdfd7ca4e 100644 (file)
@@ -503,6 +503,28 @@ def package_qa_check_rdepends(pkg, pkgdest, d):
 # The PACKAGE FUNC to scan each package
 python do_package_qa () {
     bb.note("DO PACKAGE QA")
+
+    logdir = bb.data.getVar('T', d, True)
+    pkg = bb.data.getVar('PN', d, True)
+
+    # Check the compile log for host contamination
+    compilelog = os.path.join(logdir,"log.do_compile")
+
+    statement = "grep -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s > /dev/null" % compilelog
+    if os.system(statement) == 0:
+        bb.warn("%s: The compile log indicates that host include and/or library paths were used.  Please check the log '%s' for more information." % \
+                (pkg, compilelog))
+
+
+    # Check the install log for host contamination
+    installlog = os.path.join(logdir,"log.do_install")
+
+    statement = "grep -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s > /dev/null" % installlog
+    if os.system(statement) == 0:
+        bb.warn("%s: The install log indicates that host include and/or library paths were used.  Please check the log '%s' for more information." % \
+                (pkg, installlog))
+
+    # Scan the packages...
     pkgdest = bb.data.getVar('PKGDEST', d, True)
     packages = bb.data.getVar('PACKAGES',d, True)
 
@@ -537,7 +559,8 @@ python do_package_qa () {
 
 
 # The Staging Func, to check all staging
-addtask qa_staging after do_populate_sysroot before do_build
+#addtask qa_staging after do_populate_sysroot before do_build
+do_populate_sysroot[postfunc] += "do_qa_staging"
 python do_qa_staging() {
     bb.note("QA checking staging")
 
@@ -547,13 +570,14 @@ python do_qa_staging() {
 
 # Check broken config.log files, for packages requiring Gettext which don't
 # have it in DEPENDS and for correct LIC_FILES_CHKSUM
-addtask qa_configure after do_configure before do_compile
+#addtask qa_configure after do_configure before do_compile
+do_configure[postfunc] += "do_qa_configure"
 python do_qa_configure() {
     configs = []
     workdir = bb.data.getVar('WORKDIR', d, True)
     bb.note("Checking autotools environment for common misconfiguration")
     for root, dirs, files in os.walk(workdir):
-        statement = "grep 'CROSS COMPILE Badness:' %s > /dev/null" % \
+        statement = "grep -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s > /dev/null" % \
                     os.path.join(root,"config.log")
         if "config.log" in files:
             if os.system(statement) == 0: