QA Warnings Cleanup
cover QA Warnings Cleanup
The following changes since commit 40ecaf6a59ba61e72d29d7e677197ef37c998408:
uclibc: Add default uClibc.machine files (2011-07-01 00:40:10 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib rpurdie/master
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rpurdie/master
and clean up a variety of different QA warning issues
Richard Purdie (6):
cairo: Clean up packaging and fix warnings
kernel.bbclass: Ensure kernel/* internal sysroot working directory
don't get packaged
libpcre: Fix QA warnings
python: Ensure libpython.so ends up in the .dev package
beecrypt: Fix up packaging QA warnings
insane.bbclass: Start to rework this so specific checks can be easily
made warnings/errors
meta/classes/insane.bbclass | 216 +++++++++-------------- meta/classes/kernel.bbclass | 6 + meta/recipes-devtools/python/python_2.6.6.bb | 4 +- meta/recipes-graphics/cairo/cairo_1.10.2.bb | 44 ++--- meta/recipes-support/beecrypt/beecrypt_4.2.1.bb | 4 + meta/recipes-support/libpcre/libpcre_8.12.bb | 8 +- 6 files changed, 112 insertions(+), 170 deletions(-)
Signature · 1 line
1.7.4.1
PATCH 1/6 cairo: Clean up packaging and fix warnings
From: Richard Purdie <[email protected]>
There were a number of QA errors being reported when packaging cairo. This patch ensures the debug files go in the -dbg package, the .so development links go into the -dev package, .a files into -staticdev.
It also switches back to relying on debian package naming for the library name. Since this is working correctly now the files are in the correct packages, we can simplify the recipe and there is no change in the resulting package names from a package feed perspective.
--- meta/recipes-graphics/cairo/cairo_1.10.2.bb | 44 +++++++++----------------- 1 files changed, 15 insertions(+), 29 deletions(-)
meta/recipes-graphics/cairo/cairo_1.10.2.bb +15 -29
@@ -2,31 +2,17 @@ require cairo.inc LIC_FILES_CHKSUM = "file://COPYING;md5=e73e999e0c72b5ac9012424fa157ad77" -PR = "r0" +PR = "r1" SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.gz" SRC_URI[md5sum] = "f101a9e88b783337b20b2e26dfd26d5f" SRC_URI[sha256sum] = "32018c7998358eebc2ad578ff8d8559d34fc80252095f110a572ed23d989fc41" -RDEPENDS_${PN} += "libcairo2 libcairo-gobject2 libcairo-script-interpreter2 \ - cairo-perf-utils" +PACKAGES =+ "cairo-gobject cairo-script-interpreter cairo-perf-utils" -ALLOW_EMPTY = "1" - -# -# Old version (1.8.10 or below) is automatically named as libcairo2 by -# debian_package_name_hook. To keep backword compatibility, -# it is necessary to explicitly name the package as libcairo2 here -# -PACKAGES =+ "libcairo2 libcairo2-dev libcairo2-dbg \ - libcairo-gobject2 \ - libcairo-script-interpreter2 \ - cairo-perf-utils \ - " - -SUMMARY_libcairo2 = "The Cairo 2D vector graphics library" -DESCRIPTION_libcairo2 = "Cairo is a multi-platform library providing anti-aliased \ +SUMMARY_${PN} = "The Cairo 2D vector graphics library" +DESCRIPTION_${PN} = "Cairo is a multi-platform library providing anti-aliased \ vector-based rendering for multiple target backends. Paths consist \ of line segments and cubic splines and can be rendered at any width \ with various join and cap styles. All colors may be specified with \
@@ -34,20 +20,20 @@ optional translucence (opacity/alpha) and combined using the \ extended Porter/Duff compositing algebra as found in the X Render \ Extension." -SUMMARY_libcairo-gobject2 = "The Cairo library GObject wrapper library" -DESCRIPTION_libcairo-gobject2 = "A GObject wrapper library for the Cairo API." +SUMMARY_cairo-gobject = "The Cairo library GObject wrapper library" +DESCRIPTION_cairo-gobject = "A GObject wrapper library for the Cairo API." -SUMMARY_libcairo-script-interpreter2 = "The Cairo library script interpreter" -DESCRIPTION_libcairo-script-interpreter2 = "The Cairo script interpreter implements \ +SUMMARY_cairo-script-interpreter = "The Cairo library script interpreter" +DESCRIPTION_cairo-script-interpreter = "The Cairo script interpreter implements \ CairoScript. CairoScript is used by tracing utilities to enable the ability \ to replay rendering." DESCRIPTION_cairo-perf-utils = "The Cairo library performance utilities" -FILES_libcairo2 = "${libdir}/libcairo.so*" -FILES_libcairo2-dev = "${includedir} ${libdir}/*.la ${libdir}/*.a \ - ${libdir}/*.o ${libdir}/pkgconfig" -FILES_libcairo2-dbg = "${libdir}/.debug ${libdir}/cairo/.debug" -FILES_libcairo-gobject2 = "${libdir}/libcairo-gobject.so*" -FILES_libcairo-script-interpreter2 = "${libdir}/libcairo-script-interpreter.so*" -FILES_cairo-perf-utils = "${bindir}/cairo-trace ${libdir}/cairo/libcairo-trace.*" +FILES_${PN} = "${libdir}/libcairo.so.*" +FILES_${PN}-dev += "${libdir}/cairo/*.la ${libdir}/cairo/*.so" +FILES_${PN}-dbg += "${libdir}/cairo/.debug" +FILES_${PN}-staticdev += "${libdir}/cairo/*.a" +FILES_cairo-gobject = "${libdir}/libcairo-gobject.so.*" +FILES_cairo-script-interpreter = "${libdir}/libcairo-script-interpreter.so.*" +FILES_cairo-perf-utils = "${bindir}/cairo-trace ${libdir}/cairo/libcairo-trace.so.*"
Signature · 1 line
1.7.4.1
PATCH 2/6 kernel.bbclass: Ensure kernel/* internal sysroot working directory don't get packaged
From: Richard Purdie <[email protected]>
This removes a couple of megabytes of QA warnings!
--- meta/classes/kernel.bbclass | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
meta/classes/kernel.bbclass +6 -0
@@ -168,6 +168,12 @@ kernel_do_install() { done } +PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess" + +kernel_package_preprocess () { + rm -rf ${PKGD}/kernel +} + sysroot_stage_all_append() { sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel }
Signature · 1 line
1.7.4.1
PATCH 3/6 libpcre: Fix QA warnings
In reply to Richard PurdieFrom: Richard Purdie <[email protected]>
This drops the split -dev packaging since it was broken and overcomplex. It ensures .so symlinks end up in the correct package.
--- meta/recipes-support/libpcre/libpcre_8.12.bb | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-)
meta/recipes-support/libpcre/libpcre_8.12.bb +2 -6
@@ -5,7 +5,7 @@ provides a POSIX calling interface to PCRE; the regular expressions \ themselves still follow Perl syntax and semantics. The header file for \ the POSIX-style functions is called pcreposix.h." SECTION = "devel" -PR = "r0" +PR = "r1" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://LICENCE;md5=77f9b14fe707d0376d89bc162e6c54ff" SRC_URI = "${SOURCEFORGE_MIRROR}/pcre/pcre-${PV}.tar.bz2 \
@@ -45,11 +45,7 @@ do_compile () { python populate_packages_prepend () { pcre_libdir = bb.data.expand('${libdir}', d) - pcre_libdir_dbg = bb.data.expand('${libdir}/.debug', d) - do_split_packages(d, pcre_libdir, '^lib(.*)\.so$', 'lib%s-dev', 'libpcre %s development package', extra_depends='${PN}-dev', allow_links=True) - do_split_packages(d, pcre_libdir, '^lib(.*)\.la$', 'lib%s-dev', 'libpcre %s development package', extra_depends='${PN}-dev') - do_split_packages(d, pcre_libdir, '^lib(.*)\.a$', 'lib%s-dev', 'libpcre %s development package', extra_depends='${PN}-dev') - do_split_packages(d, pcre_libdir, '^lib(.*)\.so\.*', 'lib%s', 'libpcre %s library', extra_depends='', allow_links=True) + do_split_packages(d, pcre_libdir, '^lib(.*)\.so\.+', 'lib%s', 'libpcre %s library', extra_depends='', allow_links=True) } FILES_${PN} = "${libdir}/libpcre.so.*"
Signature · 1 line
1.7.4.1
PATCH 4/6 python: Ensure libpython.so ends up in the .dev package
In reply to Richard PurdieFrom: Richard Purdie <[email protected]>
--- meta/recipes-devtools/python/python_2.6.6.bb | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
meta/recipes-devtools/python/python_2.6.6.bb +2 -2
@@ -1,7 +1,7 @@ require python.inc DEPENDS = "python-native db gdbm openssl readline sqlite3 zlib" DEPENDS_sharprom = "python-native db readline zlib gdbm openssl" -PR = "${INC_PR}.5" +PR = "${INC_PR}.6" LIC_FILES_CHKSUM = "file://LICENSE;md5=38fdd546420fab09ac6bd3d8a1c83eb6" DISTRO_SRC_URI ?= "file://sitecustomize.py"
@@ -113,7 +113,7 @@ FILES_${PN}-core += "${bindir}/2to3" # package libpython2 PACKAGES =+ "lib${PN}2" -FILES_lib${PN}2 = "${libdir}/libpython*.so*" +FILES_lib${PN}2 = "${libdir}/libpython*.so.*" # additional stuff -dev
Signature · 1 line
1.7.4.1
PATCH 5/6 beecrypt: Fix up packaging QA warnings
In reply to Richard PurdieFrom: Richard Purdie <[email protected]>
--- meta/recipes-support/beecrypt/beecrypt_4.2.1.bb | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
meta/recipes-support/beecrypt/beecrypt_4.2.1.bb +4 -0
@@ -24,4 +24,8 @@ acpaths="" EXTRA_OECONF="--without-python --enable-shared --enable-static --disable-openmp" +FILES_${PN} = "${sysconfdir} ${libdir}/*.so.* ${libdir}/${BPN}/*.so.*" +FILES_${PN}-dev += "${libdir}/${BPN}/*.so ${libdir}/${BPN}/*.la" +FILES_${PN}-staticdev += "${libdir}/${BPN}/*.a" + BBCLASSEXTEND = "native"
Signature · 1 line
1.7.4.1
Re: [PATCH 5/6] beecrypt: Fix up packaging QA warnings
Quoted 1 line · Richard Purdie
+FILES_${PN} = "${sysconfdir} ${libdir}/*.so.* ${libdir}/${BPN}/*.so.*"
You can use ${SOLIBS} there...
Quoted 1 line
+FILES_${PN}-dev += "${libdir}/${BPN}/*.so ${libdir}/${BPN}/*.la
... and ${SOLIBSDEV} there.
p.
Re: [PATCH 5/6] beecrypt: Fix up packaging QA warnings
Quoted 8 lines · Phil Blundell
Quoted 1 line · Richard Purdie
+FILES_${PN} = "${sysconfdir} ${libdir}/*.so.* ${libdir}/${BPN}/*.so.*"
You can use ${SOLIBS} there...
Quoted 1 line
+FILES_${PN}-dev += "${libdir}/${BPN}/*.so ${libdir}/${BPN}/*.la
... and ${SOLIBSDEV} there.
I'm in two minds on these. On the one hand they do make sense and have allowed us to build darwin targets in the past (and would extend to windows too). On the other hand nobody is using them outside the core metadata.
I think a global search and replace would likely be the best move if we decide they're a good thing...
Cheers,
Richard
Re: [PATCH 5/6] beecrypt: Fix up packaging QA warnings
Op 2 jul 2011, om 00:12 heeft Richard Purdie het volgende geschreven:
Quoted 7 lines · Phil Blundell
Quoted 6 lines · Richard Purdie
Quoted 2 lines
+FILES_${PN} = "${sysconfdir} ${libdir}/*.so.* ${libdir}/${BPN}/ *.so.*"
You can use ${SOLIBS} there...
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
+FILES_${PN}-dev += "${libdir}/${BPN}/*.so ${libdir}/${BPN}/*.la
... and ${SOLIBSDEV} there.
I'm in two minds on these. On the one hand they do make sense and have allowed us to build darwin targets in the past (and would extend to windows too). On the other hand nobody is using them outside the core metadata.
They would also be usefull for uclinux builds
Re: [PATCH 5/6] beecrypt: Fix up packaging QA warnings
In reply to Richard PurdieQuoted 6 lines · Richard Purdie
Quoted 5 lines · Phil Blundell
Quoted 1 line · Richard Purdie
+FILES_${PN} = "${sysconfdir} ${libdir}/*.so.* ${libdir}/${BPN}/*.so.*"
You can use ${SOLIBS} there...
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
+FILES_${PN}-dev += "${libdir}/${BPN}/*.so ${libdir}/${BPN}/*.la
... and ${SOLIBSDEV} there.
I'm in two minds on these. On the one hand they do make sense and have allowed us to build darwin targets in the past (and would extend to windows too). On the other hand nobody is using them outside the core metadata.
I'm not quite sure I understand what you mean by the "core metadata" in this context. There are a handful of uses (though admittedly not many) in meta-oe for example, so it is not quite true to say that their usage is restricted solely to oe-core.
Regardless, I don't think the fact that these are seldom used at present is a reason to not use them more in future. Aside from the darwin/windows/other OS issue, using the variables rather than writing out ".so.*" by hand is more robust in that it avoids the risk of typos causing packaging errors. We've had several instances in the past, for example, of people accidentally omitting the second dot and writing ".so*".
p.
PATCH 6/6 insane.bbclass: Start to rework this so specific checks can be easily made warnings/errors
In reply to Richard PurdieFrom: Richard Purdie <[email protected]>
This patch means the warning/error handling can be controlled from local.conf and/or from the distro level and no longer uses numbers but strings instead.
The system becomes extensible so that other classes can extend the path QA checks at least.
It also removes all th duplicate error message code, we should have *one* good error message.
Much work remains including making INSANE_SKIP take the classes of QA test to skip but its a start.
--- meta/classes/insane.bbclass | 216 +++++++++++++++++-------------------------- 1 files changed, 83 insertions(+), 133 deletions(-)
meta/classes/insane.bbclass +83 -133
@@ -91,83 +91,39 @@ def package_qa_get_machine_dict(): } -# Known Error classes -# 0 - non dev contains .so -# 1 - package contains a dangerous RPATH -# 2 - package depends on debug package -# 3 - non dbg contains .so -# 4 - wrong architecture -# 5 - .la contains installed=yes or reference to the workdir -# 6 - .pc contains reference to /usr/include or workdir -# 7 - the desktop file is not valid -# 8 - .la contains reference to the workdir -# 9 - LDFLAGS ignored -# 10 - Build paths in binaries +WARN_QA ?= "dev-so rpaths debug-deps debug-files arch la2 pkgconfig desktop la ldflags perms" +ERROR_QA ?= "" +#ERROR_QA ?= "rpaths debug-deps debug-files arch pkgconfig perms" def package_qa_clean_path(path,d): """ Remove the common prefix from the path. In this case it is the TMPDIR""" return path.replace(bb.data.getVar('TMPDIR',d,True),"") -def package_qa_make_fatal_error(error_class, name, path,d): - """ - decide if an error is fatal - - TODO: Load a whitelist of known errors - """ - return False - return not error_class in [0, 5, 7, 8, 9] - -def package_qa_write_error(error_class, name, path, d): - """ - Log the error - """ - - ERROR_NAMES =[ - "non dev contains .so", - "package contains RPATH", - "package depends on debug package", - "non dbg contains .debug", - "wrong architecture", - "evil hides inside the .la", - "evil hides inside the .pc", - "the desktop file is not valid", - ".la contains reference to the workdir", - "LDFLAGS ignored", - "package contains reference to tmpdir paths", - ] - - log_path = os.path.join( bb.data.getVar('T', d, True), "log.qa_package" ) - f = file( log_path, "a+") - print >> f, "%s, %s, %s" % \ - (ERROR_NAMES[error_class], name, package_qa_clean_path(path,d)) - f.close() - - logfile = bb.data.getVar('QA_LOGFILE', d, True) +def package_qa_write_error(error, d): + logfile = d.getVar('QA_LOGFILE', True) if logfile: - p = bb.data.getVar('P', d, True) + p = d.getVar('P', True) f = file( logfile, "a+") - print >> f, "%s, %s, %s, %s" % \ - (p, ERROR_NAMES[error_class], name, package_qa_clean_path(path,d)) + print >> f, "%s: %s" % (p, error) f.close() -def package_qa_handle_error(error_class, error_msg, name, path, d): - fatal = package_qa_make_fatal_error(error_class, name, path, d) - if fatal: +def package_qa_handle_error(error_class, error_msg, d): + package_qa_write_error(error_msg, d) + if error_class in (d.getVar("ERROR_QA", True) or "").split(): bb.error("QA Issue: %s" % error_msg) + return True else: bb.warn("QA Issue: %s" % error_msg) - package_qa_write_error(error_class, name, path, d) - - return not fatal + return False -def package_qa_check_rpath(file,name,d, elf): +QAPATHTEST[rpaths] = "package_qa_check_rpath" +def package_qa_check_rpath(file,name, d, elf, messages): """ Check for dangerous RPATHs """ if not elf: - return True + return - sane = True scanelf = os.path.join(bb.data.getVar('STAGING_BINDIR_NATIVE',d,True),'scanelf') bad_dirs = [bb.data.getVar('TMPDIR', d, True) + "/work", bb.data.getVar('STAGING_DIR_TARGET', d, True)] bad_dir_test = bb.data.getVar('TMPDIR', d, True)
@@ -182,67 +138,56 @@ def package_qa_check_rpath(file,name,d, elf): for line in txt: for dir in bad_dirs: if dir in line: - error_msg = "package %s contains bad RPATH %s in file %s" % (name, line, file) - sane = sane + package_qa_handle_error(1, error_msg, name, file, d) + messages.append("package %s contains bad RPATH %s in file %s" % (name, line, file)) - return sane - -def package_qa_check_dev(path, name,d, elf): +QAPATHTEST[dev-so] = "package_qa_check_dev" +def package_qa_check_dev(path, name, d, elf, messages): """ Check for ".so" library symlinks in non-dev packages """ - sane = True - if not name.endswith("-dev") and not name.endswith("-dbg") and path.endswith(".so") and os.path.islink(path): - error_msg = "non -dev/-dbg package contains symlink .so: %s path '%s'" % \ - (name, package_qa_clean_path(path,d)) - sane = package_qa_handle_error(0, error_msg, name, path, d) + messages.append("non -dev/-dbg package contains symlink .so: %s path '%s'" % \ + (name, package_qa_clean_path(path,d))) - return sane - -def package_qa_check_dbg(path, name,d, elf): +QAPATHTEST[debug-files] = "package_qa_check_dbg" +def package_qa_check_dbg(path, name, d, elf, messages): """ Check for ".debug" files or directories outside of the dbg package """ - sane = True - if not "-dbg" in name: if '.debug' in path.split(os.path.sep): - error_msg = "non debug package contains .debug directory: %s path %s" % \ - (name, package_qa_clean_path(path,d)) - sane = package_qa_handle_error(3, error_msg, name, path, d) + messages.append("non debug package contains .debug directory: %s path %s" % \ + (name, package_qa_clean_path(path,d))) - return sane - -def package_qa_check_perm(path,name,d, elf): +QAPATHTEST[perms] = "package_qa_check_perm" +def package_qa_check_perm(path,name,d, elf, messages): """ Check the permission of files """ - sane = True - return sane + return -def package_qa_check_arch(path,name,d, elf): +QAPATHTEST[arch] = "package_qa_check_arch" +def package_qa_check_arch(path,name,d, elf, messages): """ Check if archs are compatible """ if not elf: - return True + return - sane = True target_os = bb.data.getVar('TARGET_OS', d, True) target_arch = bb.data.getVar('TARGET_ARCH', d, True) # FIXME: Cross package confuse this check, so just skip them for s in ['cross', 'nativesdk', 'cross-canadian']: if bb.data.inherits_class(s, d): - return True + return # avoid following links to /usr/bin (e.g. on udev builds) # we will check the files pointed to anyway... if os.path.islink(path): - return True + return #if this will throw an exception, then fix the dict above (machine, osabi, abiversion, littleendian, bits) \
@@ -250,50 +195,44 @@ def package_qa_check_arch(path,name,d, elf): # Check the architecture and endiannes of the binary if not machine == elf.machine(): - error_msg = "Architecture did not match (%d to %d) on %s" % \ - (machine, elf.machine(), package_qa_clean_path(path,d)) - sane = package_qa_handle_error(4, error_msg, name, path, d) + messages.append("Architecture did not match (%d to %d) on %s" % \ + (machine, elf.machine(), package_qa_clean_path(path,d))) elif not bits == elf.abiSize(): - error_msg = "Bit size did not match (%d to %d) on %s" % \ - (bits, elf.abiSize(), package_qa_clean_path(path,d)) - sane = package_qa_handle_error(4, error_msg, name, path, d) + messages.append("Bit size did not match (%d to %d) on %s" % \ + (bits, elf.abiSize(), package_qa_clean_path(path,d))) elif not littleendian == elf.isLittleEndian(): - error_msg = "Endiannes did not match (%d to %d) on %s" % \ - (littleendian, elf.isLittleEndian(), package_qa_clean_path(path,d)) - sane = package_qa_handle_error(4, error_msg, name, path, d) + messages.append("Endiannes did not match (%d to %d) on %s" % \ + (littleendian, elf.isLittleEndian(), package_qa_clean_path(path,d))) - return sane - -def package_qa_check_desktop(path, name, d, elf): +QAPATHTEST[desktop] = "package_qa_check_desktop" +def package_qa_check_desktop(path, name, d, elf, messages): """ Run all desktop files through desktop-file-validate. """ - sane = True if path.endswith(".desktop"): desktop_file_validate = os.path.join(bb.data.getVar('STAGING_BINDIR_NATIVE',d,True),'desktop-file-validate') output = os.popen("%s %s" % (desktop_file_validate, path)) # This only produces output on errors for l in output: - sane = package_qa_handle_error(7, l.strip(), name, path, d) + messages.append("Desktop file issue: " + l.strip()) - return sane - -def package_qa_hash_style(path, name, d, elf): +QAPATHTEST[ldflags] = "package_qa_hash_style" +def package_qa_hash_style(path, name, d, elf, messages): """ Check if the binary has the right hash style... """ if not elf: - return True + return if os.path.islink(path): - return True + return gnu_hash = "--hash-style=gnu" in bb.data.getVar('LDFLAGS', d, True) if not gnu_hash: gnu_hash = "--hash-style=both" in bb.data.getVar('LDFLAGS', d, True) if not gnu_hash: - return True + return objdump = bb.data.getVar('OBJDUMP', d, True) env_path = bb.data.getVar('PATH', d, True)
@@ -314,31 +253,26 @@ def package_qa_hash_style(path, name, d, elf): sane = True if elf and not sane: - error_msg = "No GNU_HASH in the elf binary: '%s'" % path - return package_qa_handle_error(9, error_msg, name, path, d) + messages.append("No GNU_HASH in the elf binary: '%s'" % path) - return True -def package_qa_check_buildpaths(path, name, d, elf): +QAPATHTEST[buildpaths] = "package_qa_check_buildpaths" +def package_qa_check_buildpaths(path, name, d, elf, messages): """ Check for build paths inside target files and error if not found in the whitelist """ - sane = True - # Ignore .debug files, not interesting if path.find(".debug") != -1: - return True + return # Ignore symlinks if os.path.islink(path): - return True + return tmpdir = bb.data.getVar('TMPDIR', d, True) file_content = open(path).read() if tmpdir in file_content: - error_msg = "File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d) - sane = package_qa_handle_error(10, error_msg, name, path, d) - return sane + messages.append("File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d)) def package_qa_check_license(workdir, d): """
@@ -439,24 +373,25 @@ def package_qa_check_staged(path,d): file_content = open(path).read() if workdir in file_content: error_msg = "%s failed sanity test (workdir) in path %s" % (file,root) - sane = package_qa_handle_error(8, error_msg, "staging", path, d) + sane = package_qa_handle_error("la", error_msg, d) elif file.endswith(".pc"): file_content = open(path).read() if pkgconfigcheck in file_content: error_msg = "%s failed sanity test (tmpdir) in path %s" % (file,root) - sane = package_qa_handle_error(6, error_msg, "staging", path, d) + sane = package_qa_handle_error("pkgconfig", error_msg, d) return sane # Walk over all files in a directory and call func -def package_qa_walk(path, funcs, package,d): +def package_qa_walk(path, warnfuncs, errorfuncs, package, d): import oe.qa #if this will throw an exception, then fix the dict above target_os = bb.data.getVar('TARGET_OS', d, True) target_arch = bb.data.getVar('TARGET_ARCH', d, True) - sane = True + warnings = [] + errors = [] for root, dirs, files in os.walk(path): for file in files: path = os.path.join(root,file)
@@ -465,11 +400,19 @@ def package_qa_walk(path, funcs, package,d): elf.open() except: elf = None - for func in funcs: - if not func(path, package,d, elf): - sane = False + for func in warnfuncs: + func(path, package, d, elf, warnings) + for func in errorfuncs: + func(path, package, d, elf, errors) - return sane + for w in warnings: + bb.warn("QA Issue: %s" % w) + package_qa_write_error(w, d) + for e in errors: + bb.error("QA Issue: %s" % e) + package_qa_write_error(e, d) + + return len(errors) == 0 def package_qa_check_rdepends(pkg, pkgdest, d): sane = True
@@ -498,7 +441,7 @@ def package_qa_check_rdepends(pkg, pkgdest, d): for rdepend in rdepends: if "-dbg" in rdepend: error_msg = "%s rdepends on %s" % (pkgname,rdepend) - sane = package_qa_handle_error(2, error_msg, pkgname, rdepend, d) + sane = package_qa_handle_error("debug-deps", error_msg, d) return sane
@@ -534,11 +477,18 @@ python do_package_qa () { if not packages: return - checks = [package_qa_check_rpath, package_qa_check_dev, - package_qa_check_perm, package_qa_check_arch, - package_qa_check_desktop, package_qa_hash_style, - package_qa_check_dbg] - # package_qa_check_buildpaths, + testmatrix = d.getVarFlags("QAPATHTEST") + + g = globals() + warnchecks = [] + for w in (d.getVar("WARN_QA", True) or "").split(): + if w in testmatrix and testmatrix[w] in g: + warnchecks.append(g[testmatrix[w]]) + errorchecks = [] + for e in (d.getVar("ERROR_QA", True) or "").split(): + if e in testmatrix and testmatrix[e] in g: + errorchecks.append(g[testmatrix[e]]) + walk_sane = True rdepends_sane = True for package in packages.split():
@@ -548,7 +498,7 @@ python do_package_qa () { bb.note("Checking Package: %s" % package) path = "%s/%s" % (pkgdest, package) - if not package_qa_walk(path, checks, package, d): + if not package_qa_walk(path, warnchecks, errorchecks, package, d): walk_sane = False if not package_qa_check_rdepends(package, pkgdest, d): rdepends_sane = False
Signature · 1 line
1.7.4.1
Quoted 10 lines · Richard Purdie
The following changes since commit
40ecaf6a59ba61e72d29d7e677197ef37c998408:uclibc: Add default uClibc.machine files (2011-07-01 00:40:10 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contribrpurdie/master
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rpurdie/masterand clean up a variety of different QA warning issues
Quoted 9 lines
Richard Purdie (6):
cairo: Clean up packaging and fix warnings
kernel.bbclass: Ensurekernel/*internal sysroot working directory
don't get packaged
libpcre: Fix QA warnings
python: Ensure libpython.so ends up in the .dev package
beecrypt: Fix up packaging QA warnings
insane.bbclass: Start to rework this so specific checks can be easily
made warnings/errors
I've merged these to master since the work well with the other QA cleanups we're merging.
The SOLIBS variable discussion can happen and be followed up on later.
Cheers,
Richard