A number of xorg dev packages are uninstallable
[ This is all also available at
http://bugs.openembedded.net/show_bug.cgi?id=4549 ]
A number of xorg dev packages (both literally -dev and util-macros) are uninstallable on the target. The problem is that by default (with ipk) any given -dev package will depend on the main package, for example xproto-dev depends on xproto. But in these packages case, there is no main package (no xproto). The following patch fixes the issue.
This is important in the case of SDK users.
#
# old_revision [e5b917e5de77a3e1e649867986fdd33f141c7bd3] # # patch "packages/xorg-lib/xtrans_1.0.3.bb" # from [5adfa3a5c753b71a9a61e266569ccbd26e940b09] # to [6d46e0050d376534a486d2d6bbf3316fc0eea221] # # patch "packages/xorg-lib/xtrans_1.0.4.bb" # from [5adfa3a5c753b71a9a61e266569ccbd26e940b09] # to [6d46e0050d376534a486d2d6bbf3316fc0eea221] # # patch "packages/xorg-lib/xtrans_1.1.bb" # from [5adfa3a5c753b71a9a61e266569ccbd26e940b09] # to [6d46e0050d376534a486d2d6bbf3316fc0eea221] # # patch "packages/xorg-lib/xtrans_1.2.bb" # from [5adfa3a5c753b71a9a61e266569ccbd26e940b09] # to [6d46e0050d376534a486d2d6bbf3316fc0eea221] # # patch "packages/xorg-proto/xorg-proto-common.inc" # from [2f88e96e17c9a539cf5bf9383cad1500375eae86] # to [5c6754f960805e8352b7d28a498e98a4fb1a46be] # # patch "packages/xorg-util/util-macros_1.1.5.bb" # from [e4dba9f37b257cea60724c9fd34b82e27e27e349] # to [f33bcbd1e083dce6f243c7a9ca7b908c33868ad8] # # patch "packages/xorg-util/util-macros_1.1.6.bb" # from [9dd3c08d7715e6e845ab141fd67cbb4e3a962977] # to [0d3b638b2967a60b38c2603dad643c7325d70ae2] # ============================================================ --- packages/xorg-lib/xtrans_1.0.3.bb 5adfa3a5c753b71a9a61e266569ccbd26e940b09 +++ packages/xorg-lib/xtrans_1.0.3.bb 6d46e0050d376534a486d2d6bbf3316fc0eea221 @@ -1,5 +1,7 @@ require xorg-lib-common.inc require xorg-lib-common.inc
+RDEPENDS_${PN}-dev = ""
+
DESCRIPTION = "network API translation layer to insulate X applications and \
libraries from OS network vageries."
PE = "1"
============================================================
xorg-lib/xtrans_1.0.4.bb +2 -0
@@ -1,5 +1,7 @@ require xorg-lib-common.inc require xorg-lib-common.inc +RDEPENDS_${PN}-dev = "" + DESCRIPTION = "network API translation layer to insulate X applications and \ libraries from OS network vageries." PE = "1"
============================================================
xorg-lib/xtrans_1.1.bb +2 -0
@@ -1,5 +1,7 @@ require xorg-lib-common.inc require xorg-lib-common.inc +RDEPENDS_${PN}-dev = "" + DESCRIPTION = "network API translation layer to insulate X applications and \ libraries from OS network vageries." PE = "1"
============================================================
xorg-lib/xtrans_1.2.bb +2 -0
@@ -1,5 +1,7 @@ require xorg-lib-common.inc require xorg-lib-common.inc +RDEPENDS_${PN}-dev = "" + DESCRIPTION = "network API translation layer to insulate X applications and \ libraries from OS network vageries." PE = "1"
============================================================
xorg-proto/xorg-proto-common.inc +1 -0
@@ -1,9 +1,10 @@ XORG_PN = "${PN}" DESCRIPTION = "X protocol headers: ${XORG_PN}" HOMEPAGE = "http://www.x.org" SECTION = "x11/libs" LICENSE = "MIT-X" XORG_PN = "${PN}" +RDEPENDS_${PN}-dev = "" SRC_URI = "${XORG_MIRROR}/individual/proto/${XORG_PN}-${PV}.tar.bz2"
============================================================
xorg-util/util-macros_1.1.5.bb +2 -0
@@ -1,5 +1,7 @@ require xorg-util-common.inc require xorg-util-common.inc +RDEPENDS_${PN}-dev = "" + DESCRIPTION = "X autotools macros" PR = "r1" PE = "1"
============================================================
xorg-util/util-macros_1.1.6.bb +2 -0
@@ -1,4 +1,6 @@ require xorg-util-common.inc require xorg-util-common.inc +RDEPENDS_${PN}-dev = "" + DESCRIPTION = "X autotools macros" PE = "1"
Signature · 1 line
Tom Rini
Quoted 8 lines · Tom Rini
[ This is all also available at
http://bugs.openembedded.net/show_bug.cgi?id=4549 ]A number of xorg dev packages (both literally -dev and util-macros) are uninstallable on the target. The problem is that by default (with ipk) any given -dev package will depend on the main package, for example xproto-dev depends on xproto. But in these packages case, there is no main package (no xproto). The following patch fixes the issue.
No, it doesn't, your patch actually *breaks* the depends chaining, the real fix would be to do ALLOW_EMPTY_${PN} = "1" in the recipes.
regards,
Koen
Quoted 114 lines
This is important in the case of SDK users.
#
# old_revision [e5b917e5de77a3e1e649867986fdd33f141c7bd3] # # patch "packages/xorg-lib/xtrans_1.0.3.bb" # from [5adfa3a5c753b71a9a61e266569ccbd26e940b09] # to [6d46e0050d376534a486d2d6bbf3316fc0eea221] # # patch "packages/xorg-lib/xtrans_1.0.4.bb" # from [5adfa3a5c753b71a9a61e266569ccbd26e940b09] # to [6d46e0050d376534a486d2d6bbf3316fc0eea221] # # patch "packages/xorg-lib/xtrans_1.1.bb" # from [5adfa3a5c753b71a9a61e266569ccbd26e940b09] # to [6d46e0050d376534a486d2d6bbf3316fc0eea221] # # patch "packages/xorg-lib/xtrans_1.2.bb" # from [5adfa3a5c753b71a9a61e266569ccbd26e940b09] # to [6d46e0050d376534a486d2d6bbf3316fc0eea221] # # patch "packages/xorg-proto/xorg-proto-common.inc" # from [2f88e96e17c9a539cf5bf9383cad1500375eae86] # to [5c6754f960805e8352b7d28a498e98a4fb1a46be] # # patch "packages/xorg-util/util-macros_1.1.5.bb" # from [e4dba9f37b257cea60724c9fd34b82e27e27e349] # to [f33bcbd1e083dce6f243c7a9ca7b908c33868ad8] # # patch "packages/xorg-util/util-macros_1.1.6.bb" # from [9dd3c08d7715e6e845ab141fd67cbb4e3a962977] # to [0d3b638b2967a60b38c2603dad643c7325d70ae2] # ============================================================xorg-lib/xtrans_1.0.3.bb +2
-0@@ -1,5 +1,7 @@ require xorg-lib-common.inc require xorg-lib-common.inc +RDEPENDS_${PN}-dev = "" + DESCRIPTION = "network API translation layer to insulate X applications and \ libraries from OS network vageries." PE = "1"============================================================
xorg-lib/xtrans_1.0.4.bb +2
-0@@ -1,5 +1,7 @@ require xorg-lib-common.inc require xorg-lib-common.inc +RDEPENDS_${PN}-dev = "" + DESCRIPTION = "network API translation layer to insulate X applications and \ libraries from OS network vageries." PE = "1"============================================================
xorg-lib/xtrans_1.1.bb +2
-0@@ -1,5 +1,7 @@ require xorg-lib-common.inc require xorg-lib-common.inc +RDEPENDS_${PN}-dev = "" + DESCRIPTION = "network API translation layer to insulate X applications and \ libraries from OS network vageries." PE = "1"============================================================
xorg-lib/xtrans_1.2.bb +2
-0@@ -1,5 +1,7 @@ require xorg-lib-common.inc require xorg-lib-common.inc +RDEPENDS_${PN}-dev = "" + DESCRIPTION = "network API translation layer to insulate X applications and \ libraries from OS network vageries." PE = "1"============================================================
xorg-proto/xorg-proto-common.inc +1
-0@@ -1,9 +1,10 @@ XORG_PN = "${PN}" DESCRIPTION = "X protocol headers: ${XORG_PN}" HOMEPAGE = "http://www.x.org" SECTION = "x11/libs" LICENSE = "MIT-X" XORG_PN = "${PN}" +RDEPENDS_${PN}-dev = "" SRC_URI = "${XORG_MIRROR}/individual/proto/${XORG_PN}-${PV}.tar.bz2"============================================================
xorg-util/util-macros_1.1.5.bb +2
-0@@ -1,5 +1,7 @@ require xorg-util-common.inc require xorg-util-common.inc +RDEPENDS_${PN}-dev = "" + DESCRIPTION = "X autotools macros" PR = "r1" PE = "1"============================================================
xorg-util/util-macros_1.1.6.bb +2
-0@@ -1,4 +1,6 @@ require xorg-util-common.inc require xorg-util-common.inc +RDEPENDS_${PN}-dev = "" + DESCRIPTION = "X autotools macros" PE = "1"
Quoted 4 lines · Koen Kooi
Quoted 3 lines · Tom Rini
[ This is all also available at
http://bugs.openembedded.net/show_bug.cgi?id=4549 ]
Quoted 8 lines
Quoted 5 lines
A number of xorg dev packages (both literally -dev and util-macros) are uninstallable on the target. The problem is that by default (with ipk) any given -dev package will depend on the main package, for example xproto-dev depends on xproto. But in these packages case, there is no main package (no xproto). The following patch fixes the issue.
No, it doesn't, your patch actually *breaks* the depends chaining, the real fix would be to do ALLOW_EMPTY_${PN} = "1" in the recipes.
Well, they did all suddenly actually install. I'll rework the patch per your suggestion, make sure that works too and re-post. Thanks.
Signature · 1 line
Tom Rini
Quoted 11 lines · Tom Rini
Quoted 10 lines · Koen Kooi
Quoted 8 lines · Tom Rini
[ This is all also available at
http://bugs.openembedded.net/show_bug.cgi?id=4549 ]A number of xorg dev packages (both literally -dev and util-macros) are uninstallable on the target. The problem is that by default (with ipk) any given -dev package will depend on the main package, for example xproto-dev depends on xproto. But in these packages case, there is no main package (no xproto). The following patch fixes the issue.
Quoted 5 lines
Quoted 2 lines
No, it doesn't, your patch actually *breaks* the depends chaining, the real fix would be to do ALLOW_EMPTY_${PN} = "1" in the recipes.
Well, they did all suddenly actually install. I'll rework the patch per your suggestion, make sure that works too and re-post. Thanks.
Actually, I think your original patch was the right thing. I can't think of any benefit from having a pile of empty ??proto packages; they obviously don't contain any files, and they won't have any meaningful dependencies either, so it seems like they would just be a waste of space.
Of course, even better would be to teach package.bbclass to spot this situation and not output the spurious dependency in the first place. I don't think that should be terribly difficult to arrange, since it knows by the time population is finished whether it is going to generate a binary for ${PN} or not, and this gives plenty of time to adjust the dependencies on ${PN}-dev.
p.
Quoted 11 lines · Tom Rini
Quoted 10 lines · Koen Kooi
Quoted 8 lines · Tom Rini
[ This is all also available at
http://bugs.openembedded.net/show_bug.cgi?id=4549 ]A number of xorg dev packages (both literally -dev and util-macros) are uninstallable on the target. The problem is that by default (with ipk) any given -dev package will depend on the main package, for example xproto-dev depends on xproto. But in these packages case, there is no main package (no xproto). The following patch fixes the issue.
Quoted 5 lines
Quoted 2 lines
No, it doesn't, your patch actually *breaks* the depends chaining, the real fix would be to do ALLOW_EMPTY_${PN} = "1" in the recipes.
Well, they did all suddenly actually install. I'll rework the patch per your suggestion, make sure that works too and re-post. Thanks.
Same problem as before, Koen's solution instead:
#
# old_revision [e5b917e5de77a3e1e649867986fdd33f141c7bd3] # # patch "packages/xorg-lib/xtrans_1.0.3.bb" # from [5adfa3a5c753b71a9a61e266569ccbd26e940b09] # to [4326a8948884215174299f16364f47e8b6c07295] # # patch "packages/xorg-lib/xtrans_1.0.4.bb" # from [5adfa3a5c753b71a9a61e266569ccbd26e940b09] # to [4326a8948884215174299f16364f47e8b6c07295] # # patch "packages/xorg-lib/xtrans_1.1.bb" # from [5adfa3a5c753b71a9a61e266569ccbd26e940b09] # to [4326a8948884215174299f16364f47e8b6c07295] # # patch "packages/xorg-lib/xtrans_1.2.bb" # from [5adfa3a5c753b71a9a61e266569ccbd26e940b09] # to [4326a8948884215174299f16364f47e8b6c07295] # # patch "packages/xorg-proto/xorg-proto-common.inc" # from [2f88e96e17c9a539cf5bf9383cad1500375eae86] # to [aa528c4cf7863704e0d3ae2a0203fe669205bc06] # # patch "packages/xorg-util/util-macros_1.1.5.bb" # from [e4dba9f37b257cea60724c9fd34b82e27e27e349] # to [4ba31d550f6c3a239d2a4ed31e41804281401a41] # # patch "packages/xorg-util/util-macros_1.1.6.bb" # from [9dd3c08d7715e6e845ab141fd67cbb4e3a962977] # to [89aa974c4232d1c544e4924996946a514b924bb6] # ============================================================ --- packages/xorg-lib/xtrans_1.0.3.bb 5adfa3a5c753b71a9a61e266569ccbd26e940b09 +++ packages/xorg-lib/xtrans_1.0.3.bb 4326a8948884215174299f16364f47e8b6c07295 @@ -1,5 +1,7 @@ require xorg-lib-common.inc require xorg-lib-common.inc
+ALLOW_EMPTY_${PN} = "1"
+
DESCRIPTION = "network API translation layer to insulate X applications and \
libraries from OS network vageries."
PE = "1"
============================================================
xorg-lib/xtrans_1.0.4.bb +2 -0
@@ -1,5 +1,7 @@ require xorg-lib-common.inc require xorg-lib-common.inc +ALLOW_EMPTY_${PN} = "1" + DESCRIPTION = "network API translation layer to insulate X applications and \ libraries from OS network vageries." PE = "1"
============================================================
xorg-lib/xtrans_1.1.bb +2 -0
@@ -1,5 +1,7 @@ require xorg-lib-common.inc require xorg-lib-common.inc +ALLOW_EMPTY_${PN} = "1" + DESCRIPTION = "network API translation layer to insulate X applications and \ libraries from OS network vageries." PE = "1"
============================================================
xorg-lib/xtrans_1.2.bb +2 -0
@@ -1,5 +1,7 @@ require xorg-lib-common.inc require xorg-lib-common.inc +ALLOW_EMPTY_${PN} = "1" + DESCRIPTION = "network API translation layer to insulate X applications and \ libraries from OS network vageries." PE = "1"
============================================================
xorg-proto/xorg-proto-common.inc +1 -0
@@ -1,9 +1,10 @@ XORG_PN = "${PN}" DESCRIPTION = "X protocol headers: ${XORG_PN}" HOMEPAGE = "http://www.x.org" SECTION = "x11/libs" LICENSE = "MIT-X" XORG_PN = "${PN}" +ALLOW_EMPTY_${PN} = "1" SRC_URI = "${XORG_MIRROR}/individual/proto/${XORG_PN}-${PV}.tar.bz2"
============================================================
xorg-util/util-macros_1.1.5.bb +2 -0
@@ -1,5 +1,7 @@ require xorg-util-common.inc require xorg-util-common.inc +ALLOW_EMPTY_${PN} = "1" + DESCRIPTION = "X autotools macros" PR = "r1" PE = "1"
============================================================
xorg-util/util-macros_1.1.6.bb +2 -0
@@ -1,4 +1,6 @@ require xorg-util-common.inc require xorg-util-common.inc +ALLOW_EMPTY_${PN} = "1" + DESCRIPTION = "X autotools macros" PE = "1"
Signature · 1 line
Tom Rini
Quoted 10 lines · Tom Rini
[ This is all also available at
http://bugs.openembedded.net/show_bug.cgi?id=4549 ]A number of xorg dev packages (both literally -dev and util-macros) are uninstallable on the target. The problem is that by default (with ipk) any given -dev package will depend on the main package, for example xproto-dev depends on xproto. But in these packages case, there is no main package (no xproto). The following patch fixes the issue.
This is important in the case of SDK users.
So, there's three ways to fix this:
- Fix these recipes to have RDEPENDS_${PN}-dev = ""
- Fix these recipes to build empty main packages.
- Fix package.bbclass to do the 1st option, automatically (not put the dependency in to start with).
How do we get going ahead with one of these? I could take a stab at the 3rd option, with some hints.
Signature · 1 line
Tom Rini
Quoted 8 lines · Tom Rini
So, there's three ways to fix this:
- Fix these recipes to have RDEPENDS_${PN}-dev = ""
- Fix these recipes to build empty main packages.
- Fix package.bbclass to do the 1st option, automatically (not put the dependency in to start with).How do we get going ahead with one of these? I could take a stab at the 3rd option, with some hints.
For #3, I would start by looking at populate_packages(). This is where the files get moved into the individual packages, and is the first point at which you get to find out whether any given package is going to be empty or not. As luck would have it this method also contains some existing code to bash RDEPENDS around, which you should be able to extend and adapt for your own purposes.
I suggest an approach along the lines of:
- extend the loop that does the initial population to notice when it is populating ${PN}, and set a flag according to whether it has any files in it or not.
- then, add something along the lines of:
if pn_was_empty and "${PN}" in rdepends:
rdepends.remove("${PN}")to the RDEPENDS-processing loop near the bottom of the function.
p.
Quoted 10 lines · Phil Blundell
Quoted 8 lines · Tom Rini
So, there's three ways to fix this:
- Fix these recipes to have RDEPENDS_${PN}-dev = ""
- Fix these recipes to build empty main packages.
- Fix package.bbclass to do the 1st option, automatically (not put the dependency in to start with).How do we get going ahead with one of these? I could take a stab at the 3rd option, with some hints.
Quoted 6 lines
For #3, I would start by looking at
populate_packages(). This is where the files get moved into the individual packages, and is the first point at which you get to find out whether any given package is going to be empty or not. As luck would have it this method also contains some existing code to bash RDEPENDS around, which you should be able to extend and adapt for your own purposes.
[snip]
OK. I'm not a big python guy, but the following has been tested with both xproto (no main) and zeroconf (has a main) and the control file looked correct in both cases. I've also rebuilt glibc and poked a few packages.
#
# old_revision [4ac14ced8bc6330634ea2b24a201a4f6a556ef24]
#
# patch "classes/package.bbclass"
# from [6f3deeb912b24b09204110bd00e94e30f64d3936]
# to [8919fc454501458d13509de4a3a62fad8c68ceac]
#
============================================================
--- classes/package.bbclass 6f3deeb912b24b09204110bd00e94e30f64d3936
+++ classes/package.bbclass 8919fc454501458d13509de4a3a62fad8c68ceac
@@ -351,6 +351,8 @@ python populate_packages () {
os.system('rm -rf %s' % pkgdest) seen = []
+ main_is_empty = 1
+ main_pkg = bb.data.expand("${PN}" , d)
for pkg in package_list:
localdata = bb.data.createCopy(d)
@@ -395,6 +397,8 @@ python populate_packages () {
ret = bb.copyfile(file, fpath)
if ret is False or ret == 0:
raise bb.build.FuncFailed("File population failed")
+ if pkg == main_pkg and main_is_empty:
+ main_is_empty = 0
del localdata
os.chdir(workdir)
@@ -440,6 +444,11 @@ python populate_packages () {
for pkg in package_list:
rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 1) or bb.data.getVar('RDEPENDS', d, 1) or "")
+
+ if main_is_empty:
+ for rdep in rdepends:
+ if rdep.find(main_pkg + " ") != -1:
+ rdepends.remove(rdep)
for l in dangling_links[pkg]:
found = False
bb.debug(1, "%s contains dangling link %s" % (pkg, l))
Signature · 1 line
Tom Rini
Review
Quoted 10 lines · Tom Rini
(quoted diff) +5
-0for pkg in package_list: rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 1) or bb.data.getVar('RDEPENDS', d, 1) or "") + + if main_is_empty: + for rdep in rdepends: + if rdep.find(main_pkg + " ") != -1: + rdepends.remove(rdep) for l in dangling_links[pkg]: found = False bb.debug(1, "%s contains dangling link %s" % (pkg, l))
If you change that 1 to 0 in the first bb.data.getVar() call, the package names should be left in their unexpanded form and you can then safely match against a literal '${PN} (= ${PV})' as found in bitbake.conf. That's still a bit yucky but probably better than what you have there.
Other than that, yeah, this looks fine to me.
p.
Quoted 18 lines · Phil Blundell
Review
Quoted 10 lines · Tom Rini
(quoted diff) +5
-0for pkg in package_list: rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 1) or bb.data.getVar('RDEPENDS', d, 1) or "") + + if main_is_empty: + for rdep in rdepends: + if rdep.find(main_pkg + " ") != -1: + rdepends.remove(rdep) for l in dangling_links[pkg]: found = False bb.debug(1, "%s contains dangling link %s" % (pkg, l))If you change that 1 to 0 in the first
bb.data.getVar()call, the package names should be left in their unexpanded form and you can then safely match against a literal '${PN} (= ${PV})' as found in bitbake.conf. That's still a bit yucky but probably better than what you have there.
Quoted 1 line
Other than that, yeah, this looks fine to me.
OK, done. Checked with zeroconf and we can get away with not expanding rdepends in that case.
#
# old_revision [4ac14ced8bc6330634ea2b24a201a4f6a556ef24]
#
# patch "classes/package.bbclass"
# from [6f3deeb912b24b09204110bd00e94e30f64d3936]
# to [0255f64eac991d83a518c70b907131f1d30bfc58]
#
============================================================
--- classes/package.bbclass 6f3deeb912b24b09204110bd00e94e30f64d3936
+++ classes/package.bbclass 0255f64eac991d83a518c70b907131f1d30bfc58
@@ -351,6 +351,8 @@ python populate_packages () {
os.system('rm -rf %s' % pkgdest) seen = []
+ main_is_empty = 1
+ main_pkg = bb.data.getVar('PN', d, 1)
for pkg in package_list:
localdata = bb.data.createCopy(d)
@@ -395,6 +397,8 @@ python populate_packages () {
ret = bb.copyfile(file, fpath)
if ret is False or ret == 0:
raise bb.build.FuncFailed("File population failed")
+ if pkg == main_pkg and main_is_empty:
+ main_is_empty = 0
del localdata
os.chdir(workdir)
@@ -439,7 +443,11 @@ python populate_packages () {
dangling_links[pkg].append(os.path.normpath(target))
for pkg in package_list:
- rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 1) or bb.data.getVar('RDEPENDS', d, 1) or "")
+ rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "")
+
+ remstr = "${PN} (= ${DEBPV})"
+ if main_is_empty and remstr in rdepends:
+ rdepends.remove(remstr)
for l in dangling_links[pkg]:
found = False
bb.debug(1, "%s contains dangling link %s" % (pkg, l))
Signature · 1 line
Tom Rini
Quoted 11 lines · Tom Rini
OK, done. Checked with zeroconf and we can get away with not expanding rdepends in that case.
Signed-off-by Tom Rini <[email protected]>#
# old_revision [4ac14ced8bc6330634ea2b24a201a4f6a556ef24] # # patch "classes/package.bbclass" # from [6f3deeb912b24b09204110bd00e94e30f64d3936] # to [0255f64eac991d83a518c70b907131f1d30bfc58]
OK, great. This patch looks fine. I think you can go ahead and check that in.
p.