insane: Update the insane class to check for host contamination

[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>
This commit is contained in:
Mark Hatle 2010-09-30 15:50:42 -05:00 committed by Richard Purdie
parent 8e429accb8
commit dd81d5882b
1 changed files with 27 additions and 3 deletions

View 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: