[oe-commits] Richard Purdie : insane: Split do_package_qa into a separate task ( from do_package)

git at git.openembedded.org git at git.openembedded.org
Thu Jul 10 16:40:08 UTC 2014


Module: openembedded-core.git
Branch: master
Commit: d31f75a72cb2322f753d945da86d5f3287eef06b
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=d31f75a72cb2322f753d945da86d5f3287eef06b

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Wed Jul  9 21:15:34 2014 +0100

insane: Split do_package_qa into a separate task (from do_package)

Its possible to run the package QA checks as a separate task rather than
as part of the do_package task. This offers more parallelism but the
fact that made me propose this is that ideally we'd like to access
pkgdata to help add new tests and to do that, we need to run later in
the task list. We also need to add in RDEPENDS to the task which apply
to do_package_write_* but not do_package. See the subsequent patches
for why this is desireable.

If we split into a separate task, we need to add in calls to read
the sub package data, build the cache structure used by do_package and
cover the task with sstate (which is empty and just acts as a stamp
saying it passed package QA). We also need to handle our own
dependencies.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/insane.bbclass | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index c8fa711..9ffe675 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -17,9 +17,6 @@
 #   files under exec_prefix
 
 
-PACKAGE_DEPENDS += "${QADEPENDS}"
-PACKAGEFUNCS += " do_package_qa "
-
 # unsafe-references-in-binaries requires prelink-rtld from
 # prelink-native, but we don't want this DEPENDS for -native builds
 QADEPENDS = "prelink-native"
@@ -828,6 +825,8 @@ python do_package_qa () {
 
     bb.note("DO PACKAGE QA")
 
+    bb.build.exec_func("read_subpackage_metadata", d)
+
     logdir = d.getVar('T', True)
     pkg = d.getVar('PN', True)
 
@@ -855,6 +854,15 @@ python do_package_qa () {
     pkgdest = d.getVar('PKGDEST', True)
     packages = d.getVar('PACKAGES', True)
 
+    cpath = oe.cachedpath.CachedPath()
+    global pkgfiles
+    pkgfiles = {}
+    for pkg in (packages or "").split():
+        pkgfiles[pkg] = []
+        for walkroot, dirs, files in cpath.walk(pkgdest + "/" + pkg):
+            for file in files:
+                pkgfiles[pkg].append(walkroot + os.sep + file)
+
     # no packages should be scanned
     if not packages:
         return
@@ -909,6 +917,15 @@ python do_package_qa () {
     bb.note("DONE with PACKAGE QA")
 }
 
+addtask do_package_qa after do_package before do_build
+
+SSTATETASKS += "do_package_qa"
+do_package_qa[sstate-inputdirs] = ""
+do_package_qa[sstate-outputdirs] = ""
+python do_package_qa_setscene () {
+    sstate_setscene(d)
+}
+addtask do_package_qa_setscene
 
 python do_qa_staging() {
     bb.note("QA checking staging")
@@ -1018,6 +1035,8 @@ python () {
 
     issues = []
     if (d.getVar('PACKAGES', True) or "").split():
+        for dep in (d.getVar('QADEPENDS', True) or "").split():
+            d.appendVarFlag('do_package_qa', 'depends', " %s:do_populate_sysroot" % dep)
         for var in 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RCONFLICTS', 'RPROVIDES', 'RREPLACES', 'FILES', 'pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm', 'ALLOW_EMPTY':
             if d.getVar(var):
                 issues.append(var)



More information about the Openembedded-commits mailing list