Skip to contentSkip to conversation

netbase: inherit allarch

PATCH/RFC In review Andreas Oberritter 4 participants 8 messages Mar 20, 2013 – Apr 4, 2013

lore
Share & tools
lore
#0 lore raw

It doesn't ship any binaries, so it should use allarch, now that ifupdown has been moved to another recipe.

---
This causes the following error on my system. Notice the "r0" in the failed path. Running "bitbake -ccleansstate netbase" doesn't help.

ERROR: Error executing a python function in /build/openembedded-core/meta/recipes-core/netbase/netbase_5.0.bb:
OSError: [Errno 2] No such file or directory: '/build/tmp/work/all-oe-linux/netbase/netbase-1_5.0-r0/packages-split/netbase-dbg'

ERROR: The stack trace of python calls that resulted in this exception/failure was:
ERROR: File "do_package_ipk", line 194, in <module>
ERROR:
ERROR: File "do_package_ipk", line 45, in do_package_ipk
ERROR:

ERROR: The code that was being executed was:
ERROR:      0190:        bb.utils.unlockfile(lf)
ERROR:      0191:
ERROR:      0192:
ERROR:      0193:
ERROR:  *** 0194:do_package_ipk(d)
ERROR:      0195:
ERROR: [From file: 'do_package_ipk', lineno: 194, function: <module>]
ERROR:      0041:        basedir = os.path.join(os.path.dirname(root))
ERROR:      0042:        arch = localdata.getVar('PACKAGE_ARCH', True)
ERROR:      0043:        pkgoutdir = "%s/%s" % (outdir, arch)
ERROR:      0044:        bb.mkdirhier(pkgoutdir)
ERROR:  *** 0045:        os.chdir(root)
ERROR:      0046:        from glob import glob
ERROR:      0047:        g = glob('*')
ERROR:      0048:        try:
ERROR:      0049:            del g[g.index('CONTROL')]
ERROR: [From file: 'do_package_ipk', lineno: 45, function: do_package_ipk]
ERROR: Function failed: do_package_ipk
ERROR: Execution of event handler 'run_buildstats' failed

Traceback (most recent call last):
File "run_buildstats(e)", line 104, in run_buildstats(e=<bb.build.TaskFailed object at 0x73d7810>)
File "buildstats.bbclass", line 5, in write_task_data(status='failed', logfile='/build/tmp/buildstats/netbase-qemumipsel/201303202017/netbase-1_5.0-r0/do_package_write_ipk', dev='dm-1', e=<bb.build.TaskFailed object at 0x73d7810>)
IOError: [Errno 2] No such file or directory: '/build/tmp/buildstats/netbase-qemumipsel/201303202017/netbase-1_5.0-r0/do_package_write_ipk'

ERROR: Logfile of failure stored in: /build/tmp/work/all-oe-linux/netbase/netbase-1_5.0-r1/temp/log.do_package_write_ipk.27140
ERROR: Task 13 (/build/openembedded-core/meta/recipes-core/netbase/netbase_5.0.bb, do_package_write_ipk) failed with exit code '1'

 meta/recipes-core/netbase/netbase_5.0.bb |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-core/netbase/netbase_5.0.bb +3 -1
index 03fdc38..673a139 100644
@@ -4,7 +4,7 @@ HOMEPAGE = "http://packages.debian.org/netbase"
 SECTION = "base"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://debian/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
-PR = "r0"
+PR = "r1"
 PE = "1"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.gz \
@@ -13,6 +13,8 @@ SRC_URI = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.gz \
 SRC_URI[md5sum] = "a379d9199d44d817543eddc211a29b70"
 SRC_URI[sha256sum] = "ac9424d3cb2bd3c07b6c5bc5875c434d3bc687a73cd7c54b7dc7122308afa9dc"
 
+inherit allarch
+
 do_install () {
 	install -d ${D}/${mandir}/man8 ${D}${sysconfdir}
 	install -m 0644 ${WORKDIR}/hosts ${D}${sysconfdir}/hosts
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 7 lines · Andreas Oberritter

It doesn't ship any binaries, so it should use allarch, now that ifupdown has been moved to another recipe.

---
This causes the following error on my system. Notice the "r0" in the failed path. Running "bitbake -ccleansstate netbase" doesn't help.

You need to remove tmpdir-eglibc/pkgdata for netbase too and don't forget to remove all .ipk files from deploy/ipk too, because opkg will prefer "higher" architecture instead of higher version, so you'll get different (older) netbase installed in do_rootfs and then upgraded on target on first opkg upgrade, sigh.

Quoted 69 lines

ERROR: Error executing a python function in /build/openembedded-core/meta/recipes-core/netbase/netbase_5.0.bb:
OSError: [Errno 2] No such file or directory: '/build/tmp/work/all-oe-linux/netbase/netbase-1_5.0-r0/packages-split/netbase-dbg'

ERROR: The stack trace of python calls that resulted in this exception/failure was:
ERROR: File "do_package_ipk", line 194, in <module>
ERROR:
ERROR: File "do_package_ipk", line 45, in do_package_ipk
ERROR:

ERROR: The code that was being executed was:
ERROR:      0190:        bb.utils.unlockfile(lf)
ERROR:      0191:
ERROR:      0192:
ERROR:      0193:
ERROR:  *** 0194:do_package_ipk(d)
ERROR:      0195:
ERROR: [From file: 'do_package_ipk', lineno: 194, function: <module>]
ERROR:      0041:        basedir = os.path.join(os.path.dirname(root))
ERROR:      0042:        arch = localdata.getVar('PACKAGE_ARCH', True)
ERROR:      0043:        pkgoutdir = "%s/%s" % (outdir, arch)
ERROR:      0044:        bb.mkdirhier(pkgoutdir)
ERROR:  *** 0045:        os.chdir(root)
ERROR:      0046:        from glob import glob
ERROR:      0047:        g = glob('*')
ERROR:      0048:        try:
ERROR:      0049:            del g[g.index('CONTROL')]
ERROR: [From file: 'do_package_ipk', lineno: 45, function: do_package_ipk]
ERROR: Function failed: do_package_ipk
ERROR: Execution of event handler 'run_buildstats' failed

Traceback (most recent call last):
File "run_buildstats(e)", line 104, in run_buildstats(e=<bb.build.TaskFailed object at 0x73d7810>)
File "buildstats.bbclass", line 5, in write_task_data(status='failed', logfile='/build/tmp/buildstats/netbase-qemumipsel/201303202017/netbase-1_5.0-r0/do_package_write_ipk', dev='dm-1', e=<bb.build.TaskFailed object at 0x73d7810>)
IOError: [Errno 2] No such file or directory: '/build/tmp/buildstats/netbase-qemumipsel/201303202017/netbase-1_5.0-r0/do_package_write_ipk'

ERROR: Logfile of failure stored in: /build/tmp/work/all-oe-linux/netbase/netbase-1_5.0-r1/temp/log.do_package_write_ipk.27140
ERROR: Task 13 (/build/openembedded-core/meta/recipes-core/netbase/netbase_5.0.bb, do_package_write_ipk) failed with exit code '1'

 meta/recipes-core/netbase/netbase_5.0.bb |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-core/netbase/netbase_5.0.bb +3 -1
index 03fdc38..673a139 100644
@@ -4,7 +4,7 @@ HOMEPAGE = "http://packages.debian.org/netbase"
 SECTION = "base"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://debian/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
-PR = "r0"
+PR = "r1"
 PE = "1"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.gz \
@@ -13,6 +13,8 @@ SRC_URI = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.gz \
 SRC_URI[md5sum] = "a379d9199d44d817543eddc211a29b70"
 SRC_URI[sha256sum] = "ac9424d3cb2bd3c07b6c5bc5875c434d3bc687a73cd7c54b7dc7122308afa9dc"
 
+inherit allarch
+
 do_install () {
 	install -d ${D}/${mandir}/man8 ${D}${sysconfdir}
 	install -m 0644 ${WORKDIR}/hosts ${D}${sysconfdir}/hosts
Signature · 7 lines
1.7.10.4


_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#2 lore raw
Quoted 9 lines · Martin Jansa
Quoted 7 lines · Andreas Oberritter

It doesn't ship any binaries, so it should use allarch, now that ifupdown has been moved to another recipe.

---
This causes the following error on my system. Notice the "r0" in the failed path. Running "bitbake -ccleansstate netbase" doesn't help.

Quoted 5 lines

You need to remove tmpdir-eglibc/pkgdata for netbase too and don't forget to remove all .ipk files from deploy/ipk too, because opkg will prefer "higher" architecture instead of higher version, so you'll get different (older) netbase installed in do_rootfs and then upgraded on target on first opkg upgrade, sigh.

Ah and also netbase stamps.

I've reported the same when netbase was changed from MACHINE_ARCH to TUNE_PKGARCH:
http://www.mail-archive.com/[email protected]/msg34318.html

Quoted 72 lines
Quoted 69 lines

ERROR: Error executing a python function in /build/openembedded-core/meta/recipes-core/netbase/netbase_5.0.bb:
OSError: [Errno 2] No such file or directory: '/build/tmp/work/all-oe-linux/netbase/netbase-1_5.0-r0/packages-split/netbase-dbg'

ERROR: The stack trace of python calls that resulted in this exception/failure was:
ERROR: File "do_package_ipk", line 194, in <module>
ERROR:
ERROR: File "do_package_ipk", line 45, in do_package_ipk
ERROR:

ERROR: The code that was being executed was:
ERROR:      0190:        bb.utils.unlockfile(lf)
ERROR:      0191:
ERROR:      0192:
ERROR:      0193:
ERROR:  *** 0194:do_package_ipk(d)
ERROR:      0195:
ERROR: [From file: 'do_package_ipk', lineno: 194, function: <module>]
ERROR:      0041:        basedir = os.path.join(os.path.dirname(root))
ERROR:      0042:        arch = localdata.getVar('PACKAGE_ARCH', True)
ERROR:      0043:        pkgoutdir = "%s/%s" % (outdir, arch)
ERROR:      0044:        bb.mkdirhier(pkgoutdir)
ERROR:  *** 0045:        os.chdir(root)
ERROR:      0046:        from glob import glob
ERROR:      0047:        g = glob('*')
ERROR:      0048:        try:
ERROR:      0049:            del g[g.index('CONTROL')]
ERROR: [From file: 'do_package_ipk', lineno: 45, function: do_package_ipk]
ERROR: Function failed: do_package_ipk
ERROR: Execution of event handler 'run_buildstats' failed

Traceback (most recent call last):
File "run_buildstats(e)", line 104, in run_buildstats(e=<bb.build.TaskFailed object at 0x73d7810>)
File "buildstats.bbclass", line 5, in write_task_data(status='failed', logfile='/build/tmp/buildstats/netbase-qemumipsel/201303202017/netbase-1_5.0-r0/do_package_write_ipk', dev='dm-1', e=<bb.build.TaskFailed object at 0x73d7810>)
IOError: [Errno 2] No such file or directory: '/build/tmp/buildstats/netbase-qemumipsel/201303202017/netbase-1_5.0-r0/do_package_write_ipk'

ERROR: Logfile of failure stored in: /build/tmp/work/all-oe-linux/netbase/netbase-1_5.0-r1/temp/log.do_package_write_ipk.27140
ERROR: Task 13 (/build/openembedded-core/meta/recipes-core/netbase/netbase_5.0.bb, do_package_write_ipk) failed with exit code '1'

 meta/recipes-core/netbase/netbase_5.0.bb |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-core/netbase/netbase_5.0.bb +3 -1
index 03fdc38..673a139 100644
@@ -4,7 +4,7 @@ HOMEPAGE = "http://packages.debian.org/netbase"
 SECTION = "base"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://debian/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
-PR = "r0"
+PR = "r1"
 PE = "1"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.gz \
@@ -13,6 +13,8 @@ SRC_URI = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.gz \
 SRC_URI[md5sum] = "a379d9199d44d817543eddc211a29b70"
 SRC_URI[sha256sum] = "ac9424d3cb2bd3c07b6c5bc5875c434d3bc687a73cd7c54b7dc7122308afa9dc"
 
+inherit allarch
+
 do_install () {
 	install -d ${D}/${mandir}/man8 ${D}${sysconfdir}
 	install -m 0644 ${WORKDIR}/hosts ${D}${sysconfdir}/hosts
Signature · 7 lines
1.7.10.4


_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#3 lore raw

RFC PATCH 1/2 packagedata: show error when there are multiple pkgdata directories

* when PACKAGE_ARCH is changed e.g. from MACHINE_ARCH to TUNE_PKGARCH get_subpkgedata_fn is still reading old MACHINE_ARCH directory instead of newer with TUNE_PKGARCH

---
 meta/lib/oe/packagedata.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
meta/lib/oe/packagedata.py +11 -2
index 62fd718..2533700 100644
@@ -34,11 +34,18 @@ def get_subpkgedata_fn(pkg, d):
     dirs = all_pkgdatadirs(d)
 
     pkgdata = d.expand('${TMPDIR}/pkgdata/')
+    found = None
     for dir in dirs:
         fn = pkgdata + dir + pkg
         if os.path.exists(fn):
-            return fn
-    return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg)
+	    if found:
+                bb.error("More then one pkgdata dir found for pkg '%s' ('%s', '%s'), returning first" % (pkg, found, fn))
+                continue
+            found = fn
+    if found:
+        return found
+    else:
+        return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg)
 
 def has_subpkgdata(pkg, d):
     return os.access(get_subpkgedata_fn(pkg, d), os.R_OK)
@@ -68,6 +75,7 @@ def read_subpkgdata_dict(pkg, d):
     return ret
 
 def _pkgmap(d):
+    import bb
     """Return a dictionary mapping package to recipe name."""
 
     target_os = d.getVar("TARGET_OS", True)
@@ -85,6 +93,7 @@ def _pkgmap(d):
             continue
 
         for pn in filter(lambda f: not os.path.isdir(os.path.join(pkgdatadir, f)), files):
+            bb.warn("Trying path '%s'" % os.path.join(pkgdatadir, pn))
             try:
                 pkgdata = read_pkgdatafile(os.path.join(pkgdatadir, pn))
             except OSError:
Signature · 1 line
1.8.1.5
#4 lore raw

RFC PATCH 2/2 packagedata: Show error when trying to change PE/PV/PR from runtime/pkgdata

* causes build failure before do_package_write_ipk fails when trying to use wrong WORKDIR

---
 meta/classes/packagedata.bbclass | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
meta/classes/packagedata.bbclass +15 -0
index 120cd64..b22458e 100644
@@ -1,7 +1,10 @@
 python read_subpackage_metadata () {
     import oe.packagedata
 
+    pe = d.getVar('PE', True)
     pn = d.getVar('PN', True)
+    pr = d.getVar('PR', True)
+    pv = d.getVar('PV', True)
     data = oe.packagedata.read_pkgdata(pn, d)
 
     for key in data.keys():
@@ -14,5 +17,17 @@ python read_subpackage_metadata () {
                 if sdata[key] != pn:
                     bb.fatal("Recipe %s is trying to create package %s which was already written by recipe %s. This will cause corruption, please resolve this and only provide the package from one recipe or the other or only build one of the recipes." % (pn, pkg, sdata[key]))
                 continue
+            if key == "PE":
+                if sdata[key] != pe:
+                    bb.fatal("Recipe %s is trying to change PE from '%s' to '%s'. This will cause do_package_write_ipk failing to find right workdir." % (pn, pe, sdata[key]))
+                continue
+            if key == "PV":
+                if sdata[key] != pv:
+                    bb.fatal("Recipe %s is trying to change PV from '%s' to '%s'. This will cause do_package_write_ipk failing to find right workdir." % (pn, pv, sdata[key]))
+                continue
+            if key == "PR":
+                if sdata[key] != pr:
+                    bb.fatal("Recipe %s is trying to change PR from '%s' to '%s'. This will cause do_package_write_ipk failing to find right workdir." % (pn, pr, sdata[key]))
+                continue
             d.setVar(key, sdata[key])
 }
Signature · 1 line
1.8.1.5
#5 lore raw

Re: [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories

In reply to Martin Jansa
Quoted 2 lines · Martin Jansa

* when PACKAGE_ARCH is changed e.g. from MACHINE_ARCH to TUNE_PKGARCH get_subpkgedata_fn is still reading old MACHINE_ARCH directory instead of newer with TUNE_PKGARCH

This is too strict in some cases, e.g.:

ERROR: More then one pkgdata dir found for pkg 'opkg-collateral'
( '/OE/shr-core/tmp-eglibc/pkgdata/cortexa8-vfp-neon-oe-linux-gnueabi/runtime/opkg-collateral', '/OE/shr-core/tmp-eglibc/pkgdata/armv5te-oe-linux-gnueabi/runtime/opkg-collateral'), returning first

Why do we need to look in all pkgdatadirs? Why not just PACKAGE_ARCH?

Quoted 48 lines
---
 meta/lib/oe/packagedata.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
meta/lib/oe/packagedata.py +11 -2
index 62fd718..2533700 100644
@@ -34,11 +34,18 @@ def get_subpkgedata_fn(pkg, d):
     dirs = all_pkgdatadirs(d)
 
     pkgdata = d.expand('${TMPDIR}/pkgdata/')
+    found = None
     for dir in dirs:
         fn = pkgdata + dir + pkg
         if os.path.exists(fn):
-            return fn
-    return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg)
+	    if found:
+                bb.error("More then one pkgdata dir found for pkg '%s' ('%s', '%s'), returning first" % (pkg, found, fn))
+                continue
+            found = fn
+    if found:
+        return found
+    else:
+        return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg)
 
 def has_subpkgdata(pkg, d):
     return os.access(get_subpkgedata_fn(pkg, d), os.R_OK)
@@ -68,6 +75,7 @@ def read_subpkgdata_dict(pkg, d):
     return ret
 
 def _pkgmap(d):
+    import bb
     """Return a dictionary mapping package to recipe name."""
 
     target_os = d.getVar("TARGET_OS", True)
@@ -85,6 +93,7 @@ def _pkgmap(d):
             continue
 
         for pn in filter(lambda f: not os.path.isdir(os.path.join(pkgdatadir, f)), files):
+            bb.warn("Trying path '%s'" % os.path.join(pkgdatadir, pn))
             try:
                 pkgdata = read_pkgdatafile(os.path.join(pkgdatadir, pn))
             except OSError:
Signature · 1 line
1.8.1.5
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#6 lore raw

Re: [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories

Quoted 7 lines · On Thursday 04 April 2013 17:39:30 Martin Jansa wrote:
Quoted 4 lines · Martin Jansa

* when PACKAGE_ARCH is changed e.g. from MACHINE_ARCH to TUNE_PKGARCH

get_subpkgedata_fn is still reading old MACHINE_ARCH directory instead of newer with TUNE_PKGARCH

This is too strict in some cases, e.g.:

Quoted 8 lines

ERROR: More then one pkgdata dir found for pkg 'opkg-collateral' ( '/OE/shr-core/tmp-eglibc/pkgdata/cortexa8-vfp-neon-oe-linux-gnueabi/runtime/ opkg-collateral', '/OE/shr-core/tmp-eglibc/pkgdata/armv5te-oe-linux-gnueabi/runtime/opkg-coll ateral'), returning first

Why do we need to look in all pkgdatadirs? Why not just PACKAGE_ARCH?

So this code may well not be doing the right thing, but PACKAGE_ARCH won't work either because this is called to get a list of all packages not just one, and we therefore have no context to know PACKAGE_ARCH.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#7 lore raw

Re: [RFC][PATCH 1/2] packagedata: show error when there are multiple pkgdata directories

In reply to Martin Jansa
Quoted 6 lines · Martin Jansa
Quoted 2 lines · Martin Jansa

* when PACKAGE_ARCH is changed e.g. from MACHINE_ARCH to TUNE_PKGARCH get_subpkgedata_fn is still reading old MACHINE_ARCH directory instead of newer with TUNE_PKGARCH

This is too strict in some cases, e.g.:

Quoted 7 lines

ERROR: More then one pkgdata dir found for pkg 'opkg-collateral'
( '/OE/shr-core/tmp-eglibc/pkgdata/cortexa8-vfp-neon-oe-linux-gnueabi/runtime/opkg-collateral', '/OE/shr-core/tmp-eglibc/pkgdata/armv5te-oe-linux-gnueabi/runtime/opkg-collateral'), returning first

Why do we need to look in all pkgdatadirs? Why not just PACKAGE_ARCH?

It needs to do resolution, so for example you might have a machine specific library you'd expect the code to find it first, then architecture specific and finally all arch only if the others don't work out.

Having said that, I've had thoughts about making this just look at machine, package_arch and allarch, not everything. It also gets more complicated with multilibs.

It may be the different callers might need to specify more about what exactly they're after as they may want different things.

Cheers,

Richard