Skip to contentSkip to conversation

coreutils-native and gettext fixes

PATCH In review Tom Rini 3 participants 6 messages Mar 22, 2011 – Mar 23, 2011

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

cover coreutils-native and gettext fixes

They following changes do two things. First up, this re-syncs coreutils-native with the changes I just made in openembedded.master to opt out of gmp-native rather than DEPEND on it (oe.master had neither previously). The second change was that in testing the above I ran into gettext.bbclass + BBCLASSEXTEND breakage that I had fixed in oe.master previously. I've extended what I did slightly to also cover crosssdk here. After talking with Khem there's further cleanups that we can do but are separate.

Pull URL: git://git.openembedded.org/openembedded-core-contrib
Branch: trini/misc-fixes
Browse: http://git.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=trini/misc-fixes

Thanks,
Tom Rini <[email protected]>
---

Tom Rini (2):
coreutils: Switch to disabling gmp support gettext.bbclass: Fix cases where we lost DEPENDS_GETTEXT

 meta/classes/gettext.bbclass                 |    8 ++++++--
 meta/recipes-core/coreutils/coreutils_8.9.bb |    6 ++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
author
#1 lore raw

PATCH 1/2 coreutils: Switch to disabling gmp support

Coreutils can optionally build with libgmp support and for our uses it's fine to just not build it rather than add the dependency.

---
 meta/recipes-core/coreutils/coreutils_8.9.bb |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
meta/recipes-core/coreutils/coreutils_8.9.bb +4 -2
index 4b9a655..d75c080 100644
@@ -7,9 +7,9 @@ BUGTRACKER = "http://debbugs.gnu.org/coreutils"
 LICENSE = "GPLv3+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
                     file://src/ls.c;startline=5;endline=16;md5=e1a509558876db58fb6667ba140137ad"
-PR = "r0"
+PR = "r1"
 DEPENDS = "perl-native gmp"
-DEPENDS_virtclass-native = "perl-native gmp-native"
+DEPENDS_virtclass-native = "perl-native"
 
 inherit autotools gettext
 
@@ -18,6 +18,8 @@ SRC_URI = "http://ftp.gnu.org/gnu/coreutils/${BP}.tar.gz"
 SRC_URI[md5sum] = "36909ae68840d73a800120cf74af794a"
 SRC_URI[sha256sum] = "aa991fa4296b22ff929a31a5cb5528bb783c84cdef4503c4ff311cfbeaebf50a"
 
+EXTRA_OECONF_virtclass-native = "--without-gmp"
+
 # [ gets a special treatment and is not included in this
 bindir_progs = "base64 basename chcon cksum comm csplit cut dir dircolors dirname du \
                 env expand expr factor fmt fold groups head hostid id install \
Signature · 1 line
1.7.0.4
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] coreutils: Switch to disabling gmp support

Quoted 3 lines · Tom Rini

Coreutils can optionally build with libgmp support and for our uses it's fine to just not build it rather than add the dependency.

To be clear What we lose here is entry for coreutils release notes

* Noteworthy changes in release 7.0 (2008-10-05) [beta]

If the GNU MP library is available at configure time, factor and expr support arbitrarily large numbers. Pollard's rho algorithm is used to factor large numbers.

and I think we never intended to use it. Its just that now it finds the library staged due to gcc requiring it.

Quoted 38 lines
---
 meta/recipes-core/coreutils/coreutils_8.9.bb |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
meta/recipes-core/coreutils/coreutils_8.9.bb +4 -2
index 4b9a655..d75c080 100644
@@ -7,9 +7,9 @@ BUGTRACKER = "http://debbugs.gnu.org/coreutils"
 LICENSE = "GPLv3+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
                     file://src/ls.c;startline=5;endline=16;md5=e1a509558876db58fb6667ba140137ad"
-PR = "r0"
+PR = "r1"
 DEPENDS = "perl-native gmp"
-DEPENDS_virtclass-native = "perl-native gmp-native"
+DEPENDS_virtclass-native = "perl-native"
 
 inherit autotools gettext
 
@@ -18,6 +18,8 @@ SRC_URI = "http://ftp.gnu.org/gnu/coreutils/${BP}.tar.gz"
 SRC_URI[md5sum] = "36909ae68840d73a800120cf74af794a"
 SRC_URI[sha256sum] = "aa991fa4296b22ff929a31a5cb5528bb783c84cdef4503c4ff311cfbeaebf50a"
 
+EXTRA_OECONF_virtclass-native = "--without-gmp"
+
 # [ gets a special treatment and is not included in this
 bindir_progs = "base64 basename chcon cksum comm csplit cut dir dircolors dirname du \
                 env expand expr factor fmt fold groups head hostid id install \
Signature · 7 lines
1.7.0.4


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

PATCH 2/2 gettext.bbclass: Fix cases where we lost DEPENDS_GETTEXT

In reply to Tom Rini

This is a partial sync-up with 2a9a834ce426f4dc97162870ef1632540ff044f1 of openembedded master. After consulting with Khem there's a few things that we can do to further improve the situation but doing this fixes the cases such as BBCLASSEXTEND where we can loose DEPENDS_GETTEXT and trigger the QA error about missing inherit gettext (when we aren't).

---
 meta/classes/gettext.bbclass |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
meta/classes/gettext.bbclass +6 -2
index a40e74f..45e883f 100644
@@ -4,7 +4,7 @@ def gettext_after_parse(d):
         cfg = oe_filter_out('^--(dis|en)able-nls$', bb.data.getVar('EXTRA_OECONF', d, 1) or "", d)
         cfg += " --disable-nls"
         depends = bb.data.getVar('DEPENDS', d, 1) or ""
-        bb.data.setVar('DEPENDS', oe_filter_out('^(virtual/libiconv|virtual/libintl)$', depends, d), d)
+        bb.data.setVar('DEPENDS', oe_filter_out('^(gettext|gettext-native|virtual/libiconv|virtual/libintl)$', depends, d), d)
         bb.data.setVar('EXTRA_OECONF', cfg, d)
 
 python () {
@@ -13,5 +13,9 @@ python () {
 
 DEPENDS_GETTEXT = "gettext gettext-native"
 
-DEPENDS =+ "${DEPENDS_GETTEXT}"
+DEPENDS_prepend += "${DEPENDS_GETTEXT} "
+DEPENDS_virtclass-native_prepend = "${DEPENDS_GETTEXT} "
+DEPENDS_virtclass-nativesdk_prepend = "${DEPENDS_GETTEXT} "
+DEPENDS_virtclass-cross_prepend = "${DEPENDS_GETTEXT} "
+DEPENDS_virtclass-crosssdk_prepend = "${DEPENDS_GETTEXT} "
 EXTRA_OECONF += "--enable-nls"
Signature · 1 line
1.7.0.4
#4 lore raw

Re: [PATCH 2/2] gettext.bbclass: Fix cases where we lost DEPENDS_GETTEXT

Quoted 7 lines · Tom Rini

This is a partial sync-up with 2a9a834ce426f4dc97162870ef1632540ff044f1 of openembedded master. After consulting with Khem there's a few things that we can do to further improve the situation but doing this fixes the cases such as BBCLASSEXTEND where we can loose DEPENDS_GETTEXT and trigger the QA error about missing inherit gettext (when we aren't).

I think this one needs testing patch looks ok though

Quoted 36 lines
---
 meta/classes/gettext.bbclass |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
meta/classes/gettext.bbclass +6 -2
index a40e74f..45e883f 100644
@@ -4,7 +4,7 @@ def gettext_after_parse(d):
         cfg = oe_filter_out('^--(dis|en)able-nls$', bb.data.getVar('EXTRA_OECONF', d, 1) or "", d)
         cfg += " --disable-nls"
         depends = bb.data.getVar('DEPENDS', d, 1) or ""
-        bb.data.setVar('DEPENDS', oe_filter_out('^(virtual/libiconv|virtual/libintl)$', depends, d), d)
+        bb.data.setVar('DEPENDS', oe_filter_out('^(gettext|gettext-native|virtual/libiconv|virtual/libintl)$', depends, d), d)
         bb.data.setVar('EXTRA_OECONF', cfg, d)
 
 python () {
@@ -13,5 +13,9 @@ python () {
 
 DEPENDS_GETTEXT = "gettext gettext-native"
 
-DEPENDS =+ "${DEPENDS_GETTEXT}"
+DEPENDS_prepend += "${DEPENDS_GETTEXT} "
+DEPENDS_virtclass-native_prepend = "${DEPENDS_GETTEXT} "
+DEPENDS_virtclass-nativesdk_prepend = "${DEPENDS_GETTEXT} "
+DEPENDS_virtclass-cross_prepend = "${DEPENDS_GETTEXT} "
+DEPENDS_virtclass-crosssdk_prepend = "${DEPENDS_GETTEXT} "
 EXTRA_OECONF += "--enable-nls"
Signature · 7 lines
1.7.0.4


_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Signature · 1 line
-Khem
#5 lore raw
In reply to Tom Rini
Quoted 13 lines · Tom Rini

They following changes do two things. First up, this re-syncs coreutils-native with the changes I just made in openembedded.master to opt out of gmp-native rather than DEPEND on it (oe.master had neither previously). The second change was that in testing the above I ran into gettext.bbclass + BBCLASSEXTEND breakage that I had fixed in oe.master previously. I've extended what I did slightly to also cover crosssdk here. After talking with Khem there's further cleanups that we can do but are separate.

Pull URL: git://git.openembedded.org/openembedded-core-contrib
Branch: trini/misc-fixes
Browse: http://git.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=trini/misc-fixes

Quoted 8 lines

Thanks,
Tom Rini <[email protected]>
---

Tom Rini (2):
coreutils: Switch to disabling gmp support gettext.bbclass: Fix cases where we lost DEPENDS_GETTEXT

I've taken the coreutils change, thanks.

For gettext, we chatted on IRC but to summarise:

a) Poky went about addressing the problem slightly differently. Bottom line is the situation was worked around when DEPENDS_virtclass was used by manually specifying the gettext dependency.

If we go for a new way to fix this in the class like Tom is proposing, I'd like to remove the other workaround so we have one clear way of doing things.

b) This just highlights what a mess changing DEPENDS is at the moment. Every time we want a virtclass we shouldn't have to add more items to lists, it just feels wrong. Over time this has all the makings of an unmaintainable disaster.

The root of the problem is what BBCLASSEXTEND does, or more specifically the code in native.bbclass which needs to manipulate DEPENDS. There are the following constraints on DEPENDS:

* Its set in recipes with a "=", i.e. a hard assignment. Ideally it would be += to append to a core set of dependencies but that isn't the way it works.

* We add in "core" dependencies such as the toolchain with a DEPENDS_prepend = "xxx", e.g. from base.bbclass:

DEPENDS_prepend="${@base_dep_prepend(d)} " DEPENDS_virtclass-native_prepend="${@base_dep_prepend(d)} " DEPENDS_virtclass-nativesdk_prepend="${@base_dep_prepend(d)} "

This shows one other place where this virtclass workaround has had to be applied :(.

The problem is that if someone sets:

DEPENDS_virtclass-native = "xxx"

this wipes out the original DEPENDS when you perhaps only wanted to wipe out the recipe specific dependencies, not the core additional ones.

I don't have any better way to fix this at the moment but it does highlight an easy solution to improve Tom's patch. We should define this in base.bbclass:

BASEDEPENDS = "${@base_dep_prepend(d)}" DEPENDS_prepend="${BASEDEPENDS} " DEPENDS_virtclass-native_prepend="${BASEDEPENDS} " DEPENDS_virtclass-nativesdk_prepend="${BASEDEPENDS} "

and then gettext.bbclass should just do:

BASEDEPENDS += "<gettext depenedncies>"

Whilst this is still ugly, its less ugly at least...

Cheers,

Richard