Skip to contentSkip to conversation

Split do_package_qa in insane.bbclass to be a new task

RFC PATCH In review Kang Kai 2 participants 4 messages Mar 11, 2013

lore
Share & tools
lore

Kang Kai

author
#0 lore raw

cover Split do_package_qa in insane.bbclass to be a new task

Hi Richard,

This patch is try to accomplish Yocto #3190, and you said:

"
The sanity tests in insane.bbclass need refactoring to make it easier to extend. In particular, some packaging tests are currently ending up in package.bbclass. These should be in insane.bbclass with hooks added as appropriate.

Further, all tests should honour the settings of QA_WARN and QA_ERROR. "

do_package_qa is splitted as a new task run after do_package. Then 'inherit package' could be removed from insane.bbclass, and do_package_qa doesn't end in package.bbclass.

I know this patch is not enough for this feature, but I want to make sure this is the right direction and hope to receive more guidance.

Would you like to give more guidance?

Thanks a lot.

Regards,
Kai

The following changes since commit 93ec7b4d1550e07caec86e2998d0f94a01c7e785:

xserver-xf86-config: atom-pc doesn't need a xorg.conf (2013-03-04 14:42:11 +0000)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib kangkai/insane
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/insane

Kang Kai (1):
insane.bbclass: make do_package_qa be a task

 meta/classes/insane.bbclass |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH 1/1 insane.bbclass: make do_package_qa be a task

do_package_qa is added to variable PACKAGEFUNCS and run after do_package. packaging tests should not ending up in package.bbclass. Split do_package_qa as a new task after do_package.

[YOCTO #3190]

---
 meta/classes/insane.bbclass |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
meta/classes/insane.bbclass +13 -2
index bd6f120..d7787ac 100644
@@ -17,9 +17,9 @@
 #   files under exec_prefix
 
 
-inherit package
+#inherit package
 PACKAGE_DEPENDS += "${QADEPENDS}"
-PACKAGEFUNCS += " do_package_qa "
+#PACKAGEFUNCS += " do_package_qa "
 
 # unsafe-references-in-binaries requires prelink-rtld from
 # prelink-native, but we don't want this DEPENDS for -native builds
@@ -654,6 +654,15 @@ def package_qa_walk(path, warnfuncs, errorfuncs, skip, package, d):
     target_os   = d.getVar('TARGET_OS', True)
     target_arch = d.getVar('TARGET_ARCH', True)
 
+    pkgfiles = {}
+    packages = d.getVar('PACKAGES', True).split()
+    pkgdest = d.getVar('PKGDEST', True)
+    for pkg in packages:
+        pkgfiles[pkg] = []
+        for walkroot, dirs, files in os.walk(pkgdest + "/" + pkg):
+            for file in files:
+                pkgfiles[pkg].append(walkroot + os.sep + file)
+
     warnings = []
     errors = []
     for path in pkgfiles[package]:
@@ -823,6 +832,8 @@ python do_package_qa () {
     bb.note("DONE with PACKAGE QA")
 }
 
+addtask package_qa after do_package before do_build
+EXPORT_FUNCTIONS do_package_qa
 
 python do_qa_staging() {
     bb.note("QA checking staging")
Signature · 1 line
1.7.5.4
#2 lore raw

Re: [PATCH 1/1] insane.bbclass: make do_package_qa be a task

Quoted 16 lines · On 11 March 2013 04:31:17 Kang Kai <[email protected]> wrote:

do_package_qa is added to variable PACKAGEFUNCS and run after do_package. packaging tests should not ending up in package.bbclass. Split do_package_qa as a new task after do_package.

[YOCTO #3190]

---
 meta/classes/insane.bbclass |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
meta/classes/insane.bbclass +0 -0
index bd6f120..d7787ac 100644

meta/classes/insane.bbclass line 22

Quoted 8 lines
meta/classes/insane.bbclass +2 -2
@@ -17,9 +17,9 @@
 #   files under exec_prefix
 
 
-inherit package
+#inherit package
 PACKAGE_DEPENDS += "${QADEPENDS}"
-PACKAGEFUNCS += " do_package_qa "
+#PACKAGEFUNCS += " do_package_qa "

I'd remove those lines, they are in the history anyway.

Quoted 8 lines
meta/classes/insane.bbclass +0 -0
 # unsafe-references-in-binaries requires prelink-rtld from
 # prelink-native, but we don't want this DEPENDS for -native builds
@@ -654,6 +654,15 @@ def package_qa_walk(path, warnfuncs, errorfuncs, 

skip, package, d):
target_os = d.getVar('TARGET_OS', True)
target_arch = d.getVar('TARGET_ARCH', True)

meta/classes/insane.bbclass def package_qa_walk(path, warnfuncs, errorfuncs, skip, package, d): · line 662

Quoted 6 lines
meta/classes/insane.bbclass +6 -0
+    pkgfiles = {}
+    packages = d.getVar('PACKAGES', True).split()
+    pkgdest = d.getVar('PKGDEST', True)
+    for pkg in packages:
+        pkgfiles[pkg] = []
+        for walkroot, dirs, files in os.walk(pkgdest + "/" + pkg):

I'd use os.sep above, too.
I would ACK the patch with these changes, fwiw.
Thanks,

Quoted 19 lines
meta/classes/insane.bbclass +5 -1
+            for file in files:
+                pkgfiles[pkg].append(walkroot + os.sep + file)
+
     warnings = []
     errors = []
     for path in pkgfiles[package]:
@@ -823,6 +832,8 @@ python do_package_qa () {
     bb.note("DONE with PACKAGE QA")
 }
 
+addtask package_qa after do_package before do_build
+EXPORT_FUNCTIONS do_package_qa
 
 python do_qa_staging() {
     bb.note("QA checking staging")
--

1.7.5.4

Quoted 4 lines

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Sent with AquaMail for Android
http://www.aqua-mail.com

author
#3 lore raw

Re: [PATCH 1/1] insane.bbclass: make do_package_qa be a task

Quoted 36 lines · Bernhard Reutner-Fischer
Quoted 22 lines · On 11 March 2013 04:31:17 Kang Kai <[email protected]> wrote:

do_package_qa is added to variable PACKAGEFUNCS and run after do_package. packaging tests should not ending up in package.bbclass. Split do_package_qa as a new task after do_package.

[YOCTO #3190]

---
meta/classes/insane.bbclass | 15 +++++++++++++--

1 files changed, 13 insertions(+), 2 deletions(-)
meta/classes/insane.bbclass +1 -1
index bd6f120..d7787ac 100644
@@ -17,9 +17,9 @@
 # files under exec_prefix
 
 
-inherit package
+#inherit package

PACKAGE_DEPENDS += "${QADEPENDS}"

meta/classes/insane.bbclass line 22

Quoted 2 lines
meta/classes/insane.bbclass +1 -1
-PACKAGEFUNCS += " do_package_qa "
+#PACKAGEFUNCS += " do_package_qa "

I'd remove those lines, they are in the history anyway.

Quoted 8 lines
# unsafe-references-in-binaries requires prelink-rtld from
# prelink-native, but we don't want this DEPENDS for -native builds
meta/classes/insane.bbclass +0 -0
@@ -654,6 +654,15 @@ def package_qa_walk(path, warnfuncs, errorfuncs, 

skip, package, d):
target_os = d.getVar('TARGET_OS', True)
target_arch = d.getVar('TARGET_ARCH', True)

Quoted 7 lines
Quoted 6 lines

+ pkgfiles = {}
+ packages = d.getVar('PACKAGES', True).split()
+ pkgdest = d.getVar('PKGDEST', True)
+ for pkg in packages:
+ pkgfiles[pkg] = []
+ for walkroot, dirs, files in os.walk(pkgdest + "/" + pkg):

Hi Bernhard,

Quoted 2 lines

I'd use os.sep above, too.
I would ACK the patch with these changes, fwiw.

Thanks for your review, and I will update patch.

Regards,
Kai

Quoted 31 lines

Thanks,

Quoted 23 lines

+ for file in files:
+ pkgfiles[pkg].append(walkroot + os.sep + file)
+
warnings = []
errors = []
for path in pkgfiles[package]:

meta/classes/insane.bbclass +2 -0
@@ -823,6 +832,8 @@ python do_package_qa () {
 bb.note("DONE with PACKAGE QA")
 }
 
+addtask package_qa after do_package before do_build
+EXPORT_FUNCTIONS do_package_qa
 
 python do_qa_staging() {
 bb.note("QA checking staging")
Signature · 7 lines
1.7.5.4


_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Sent with AquaMail for Android
http://www.aqua-mail.com