Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix issue when locale related distro features missing
@ 2018-12-05 13:00 kai.kang
  2018-12-05 13:00 ` [PATCH 1/3] glibc-locale: fix installed-vs-shipped qa issue kai.kang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: kai.kang @ 2018-12-05 13:00 UTC (permalink / raw)
  To: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

The original problem is when distro features libc-charsets libc-locale-code and
libc-locales are missing, it has installed-vs-shipped qa issue. Then fix for
image and other packages depends on glibc locale packages too.

Build image and sdk for qemux86 and qemuarm64 with and without in local.conf:

DISTRO_FEATURES_remove = "libc-charsets libc-locales libc-locale-code"


The following changes since commit 016e3dda2d6acc9b457079d11b5346a5352a431d:

  btrfs-tools: update to 4.19 (2018-12-03 12:20:01 +0000)

are available in the Git repository at:

  git://git.pokylinux.org/poky-contrib kangkai/glibc-locale
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/glibc-locale

Kai Kang (3):
  glibc-locale: fix installed-vs-shipped qa issue
  image.bbclass: respect PACKAGE_NO_GCONV
  packages: respect PACKAGE_NO_GCONV

 meta/classes/image.bbclass                    |  5 +++++
 meta/classes/libc-package.bbclass             |  4 +---
 meta/conf/distro/include/tclibc-glibc.inc     |  2 +-
 meta/recipes-core/glib-2.0/glib.inc           |  4 +++-
 meta/recipes-core/glibc/glibc-locale.inc      | 15 +++++++++------
 meta/recipes-core/libxml/libxml2_2.9.8.bb     |  4 +++-
 meta/recipes-devtools/mtools/mtools_4.0.19.bb |  4 +++-
 7 files changed, 25 insertions(+), 13 deletions(-)

-- 
2.19.0.rc2



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] glibc-locale: fix installed-vs-shipped qa issue
  2018-12-05 13:00 [PATCH 0/3] Fix issue when locale related distro features missing kai.kang
@ 2018-12-05 13:00 ` kai.kang
  2018-12-05 13:00 ` [PATCH 2/3] image.bbclass: respect PACKAGE_NO_GCONV kai.kang
  2018-12-05 13:00 ` [PATCH 3/3] packages: " kai.kang
  2 siblings, 0 replies; 4+ messages in thread
From: kai.kang @ 2018-12-05 13:00 UTC (permalink / raw)
  To: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

Variable PACKAGE_NO_GCONV is set in libc-package.bbclass when none of
libc-charsets, libc-locales and libc-locale-code set in DISTRO_FEATURES.
Then it causes installed-vs-shipped qa issue of glibc-locale:

| ERROR: glibc-locale-2.28-r0 do_package: QA Issue: glibc-locale:
| Files/directories were installed but not shipped in any package:
|   /usr/share/i18n
|   /usr/share/i18n/charmaps
|   /usr/share/i18n/locales
|   /usr/share/i18n/charmaps/CP737.gz
|   ...
|   /usr/share/i18n/locales/ru_RU
|   ...
|   /usr/lib64/gconv/gconv-modules
| Please set FILES such that these items are packaged. Alternatively if they
| are unneeded, avoid installing them or delete them within do_install.
| glibc-locale: 843 installed and not shipped files. [installed-vs-shipped]

So check PACKAGE_NO_GCONV during do_install and not copy those files if
PACKAGE_NO_GCONV has been set.

Simplify call of bb.utils.contains() in libc-package.bbclass as well.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/classes/libc-package.bbclass        |  4 +---
 meta/recipes-core/glibc/glibc-locale.inc | 15 +++++++++------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass
index 6b1e84ef7e..82d642e15e 100644
--- a/meta/classes/libc-package.bbclass
+++ b/meta/classes/libc-package.bbclass
@@ -39,9 +39,7 @@ python __anonymous () {
                 break
 
     # try to fix disable charsets/locales/locale-code compile fail
-    if bb.utils.contains('DISTRO_FEATURES', 'libc-charsets', True, False, d) and \
-            bb.utils.contains('DISTRO_FEATURES', 'libc-locales', True, False, d) and \
-            bb.utils.contains('DISTRO_FEATURES', 'libc-locale-code', True, False, d):
+    if bb.utils.contains('DISTRO_FEATURES', 'libc-charsets libc-locales libc-locale-code', True, False, d):
         d.setVar('PACKAGE_NO_GCONV', '0')
     else:
         d.setVar('PACKAGE_NO_GCONV', '1')
diff --git a/meta/recipes-core/glibc/glibc-locale.inc b/meta/recipes-core/glibc/glibc-locale.inc
index 57b465dd5d..6384f9cbf1 100644
--- a/meta/recipes-core/glibc/glibc-locale.inc
+++ b/meta/recipes-core/glibc/glibc-locale.inc
@@ -72,7 +72,7 @@ FILES_localedef = "${bindir}/localedef"
 LOCALETREESRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale"
 
 do_install () {
-	mkdir -p ${D}${bindir} ${D}${datadir} ${D}${libdir}
+	mkdir -p ${D}${bindir} ${D}${datadir}
 	if [ -n "$(ls ${LOCALETREESRC}/${bindir})" ]; then
 		cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${bindir}/* ${D}${bindir}
 	fi
@@ -80,11 +80,14 @@ do_install () {
 		mkdir -p ${D}${localedir}
 		cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${localedir}/* ${D}${localedir}
 	fi
-	if [ -e ${LOCALETREESRC}/${libdir}/gconv ]; then
-		cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${libdir}/gconv ${D}${libdir}
-	fi
-	if [ -e ${LOCALETREESRC}/${datadir}/i18n ]; then
-		cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${datadir}/i18n ${D}${datadir}
+	if [ ${@d.getVar('PACKAGE_NO_GCONV')} -eq 0 ]; then
+		mkdir -p ${D}${libdir}
+		if [ -e ${LOCALETREESRC}/${libdir}/gconv ]; then
+			cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${libdir}/gconv ${D}${libdir}
+		fi
+		if [ -e ${LOCALETREESRC}/${datadir}/i18n ]; then
+			cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${datadir}/i18n ${D}${datadir}
+		fi
 	fi
 	if [ -e ${LOCALETREESRC}/${datadir}/locale ]; then
 		cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${datadir}/locale ${D}${datadir}
-- 
2.19.0.rc2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] image.bbclass: respect PACKAGE_NO_GCONV
  2018-12-05 13:00 [PATCH 0/3] Fix issue when locale related distro features missing kai.kang
  2018-12-05 13:00 ` [PATCH 1/3] glibc-locale: fix installed-vs-shipped qa issue kai.kang
@ 2018-12-05 13:00 ` kai.kang
  2018-12-05 13:00 ` [PATCH 3/3] packages: " kai.kang
  2 siblings, 0 replies; 4+ messages in thread
From: kai.kang @ 2018-12-05 13:00 UTC (permalink / raw)
  To: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

It installs locale-base-* packages according to var IMAGE_LINGUAS.
Packages locale-base-* are split in libc-package.bbclass if variable
PACKAGE_NO_GCONV is not set. When none of ditro features libc-charsets
libc-locales and libc-locale-code is set, PACKAGE_NO_GCONV is set. Then
no locale-base-* is created and fails to create image.

Clear IMAGE_LINGUAS in such situation.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/classes/image.bbclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 276d0d31f4..11927f39f5 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -176,6 +176,11 @@ IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
 
 LINGUAS_INSTALL ?= "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IMAGE_LINGUAS').split()))}"
 
+python () {
+    if not bb.utils.contains('DISTRO_FEATURES', 'libc-charsets libc-locale-code libc-locales', True, False, d):
+        d.setVar('IMAGE_LINGUAS', '')
+}
+
 # Prefer image, but use the fallback files for lookups if the image ones
 # aren't yet available.
 PSEUDO_PASSWD = "${IMAGE_ROOTFS}:${STAGING_DIR_NATIVE}"
-- 
2.19.0.rc2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] packages: respect PACKAGE_NO_GCONV
  2018-12-05 13:00 [PATCH 0/3] Fix issue when locale related distro features missing kai.kang
  2018-12-05 13:00 ` [PATCH 1/3] glibc-locale: fix installed-vs-shipped qa issue kai.kang
  2018-12-05 13:00 ` [PATCH 2/3] image.bbclass: respect PACKAGE_NO_GCONV kai.kang
@ 2018-12-05 13:00 ` kai.kang
  2 siblings, 0 replies; 4+ messages in thread
From: kai.kang @ 2018-12-05 13:00 UTC (permalink / raw)
  To: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

PACKAGE_NO_GCONV is set in libc-package.bbclass if not all of
'libc-charsets libc-locale-code libc-locales' included in
DISTRO_FEATURES. And then no packages glibc-gconv-* glibc-charmap-* and
glibc-localedata-* is created. Update recipes and conf file which depend
on these packages to check required distro features.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/conf/distro/include/tclibc-glibc.inc     | 2 +-
 meta/recipes-core/glib-2.0/glib.inc           | 4 +++-
 meta/recipes-core/libxml/libxml2_2.9.8.bb     | 4 +++-
 meta/recipes-devtools/mtools/mtools_4.0.19.bb | 4 +++-
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/meta/conf/distro/include/tclibc-glibc.inc b/meta/conf/distro/include/tclibc-glibc.inc
index 8d1076440f..abe619aaac 100644
--- a/meta/conf/distro/include/tclibc-glibc.inc
+++ b/meta/conf/distro/include/tclibc-glibc.inc
@@ -32,7 +32,7 @@ LIBC_LOCALE_DEPENDENCIES = "\
 	glibc-gconv-iso8859-15"
 
 def get_libc_locales_dependencies(d):
-    if 'libc-locales' in (d.getVar('DISTRO_FEATURES') or '').split() :
+    if bb.utils.contains('DISTRO_FEATURES', 'libc-charsets libc-locale-code libc-locales', True, False, d):
         return d.getVar('LIBC_LOCALE_DEPENDENCIES') or ''
     else:
         return ''
diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc
index e8215da583..a868b6df23 100644
--- a/meta/recipes-core/glib-2.0/glib.inc
+++ b/meta/recipes-core/glib-2.0/glib.inc
@@ -29,7 +29,9 @@ PACKAGES += "${PN}-codegen ${PN}-utils"
 
 LEAD_SONAME = "libglib-2.0.*"
 
-inherit autotools gettext gtk-doc pkgconfig ptest-gnome upstream-version-is-even bash-completion gio-module-cache manpages
+inherit autotools gettext gtk-doc pkgconfig ptest-gnome upstream-version-is-even bash-completion gio-module-cache manpages distro_features_check
+
+REQUIRED_DISTRO_FEATURES_libc-glibc = "${@'libc-charsets libc-locale-code libc-locales' if bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d) else ''}"
 
 S = "${WORKDIR}/glib-${PV}"
 
diff --git a/meta/recipes-core/libxml/libxml2_2.9.8.bb b/meta/recipes-core/libxml/libxml2_2.9.8.bb
index 740bf56a5a..0e2461154b 100644
--- a/meta/recipes-core/libxml/libxml2_2.9.8.bb
+++ b/meta/recipes-core/libxml/libxml2_2.9.8.bb
@@ -38,10 +38,12 @@ PACKAGECONFIG ??= "python \
 PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python3"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
 
-inherit autotools pkgconfig binconfig-disabled ptest
+inherit autotools pkgconfig binconfig-disabled ptest distro_features_check
 
 inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)}
 
+REQUIRED_DISTRO_FEATURES_libc-glibc = "${@'libc-charsets libc-locale-code libc-locales' if bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d) else ''}"
+
 RDEPENDS_${PN}-ptest += "make ${@bb.utils.contains('PACKAGECONFIG', 'python', 'libgcc python3-core python3-logging python3-shell  python3-stringold python3-threading python3-unittest ${PN}-python', '', d)}"
 
 RDEPENDS_${PN}-python += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}"
diff --git a/meta/recipes-devtools/mtools/mtools_4.0.19.bb b/meta/recipes-devtools/mtools/mtools_4.0.19.bb
index 09742773e0..9972762b4e 100644
--- a/meta/recipes-devtools/mtools/mtools_4.0.19.bb
+++ b/meta/recipes-devtools/mtools/mtools_4.0.19.bb
@@ -37,7 +37,9 @@ SRC_URI = "${GNU_MIRROR}/mtools/mtools-${PV}.tar.bz2 \
 
 SRC_URI_append_class-native = " file://disable-hardcoded-configs.patch"
 
-inherit autotools texinfo
+inherit autotools texinfo distro_features_check
+
+REQUIRED_DISTRO_FEATURES_libc-glibc = "libc-charsets libc-locale-code libc-locales"
 
 EXTRA_OECONF = "--without-x"
 
-- 
2.19.0.rc2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-05 13:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-05 13:00 [PATCH 0/3] Fix issue when locale related distro features missing kai.kang
2018-12-05 13:00 ` [PATCH 1/3] glibc-locale: fix installed-vs-shipped qa issue kai.kang
2018-12-05 13:00 ` [PATCH 2/3] image.bbclass: respect PACKAGE_NO_GCONV kai.kang
2018-12-05 13:00 ` [PATCH 3/3] packages: " kai.kang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox