From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH RFC 1/3] insane: Split do_package_qa into a separate task (from do_package)
Date: Wed, 09 Jul 2014 21:15:34 +0100 [thread overview]
Message-ID: <1404936934.15985.48.camel@ted> (raw)
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@linuxfoundation.org>
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 825ff04..2c60917 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"
@@ -831,6 +828,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)
@@ -858,6 +857,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
@@ -912,6 +920,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")
@@ -1021,6 +1038,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)
next reply other threads:[~2014-07-09 20:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-09 20:15 Richard Purdie [this message]
2014-07-11 2:43 ` [PATCH RFC 1/3] insane: Split do_package_qa into a separate task (from do_package) Otavio Salvador
2014-07-11 8:27 ` Richard Purdie
2014-07-11 12:14 ` Otavio Salvador
2014-07-11 13:22 ` Richard Purdie
2014-07-11 16:46 ` Otavio Salvador
2014-07-11 17:40 ` Richard Purdie
2014-07-11 19:37 ` Burton, Ross
2014-07-11 19:46 ` Otavio Salvador
2014-07-11 21:11 ` Richard Purdie
2014-07-18 10:26 ` Martin Jansa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1404936934.15985.48.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox