diff mbox series

[2/2] default-distrovars: Include "c" in IMAGE_LINGUAS for glibc

Message ID 20230102224744.287985-2-alex.kiernan@gmail.com
State Accepted, archived
Commit f930da7c41491a5556827dc2ff66f3d3c0e95df8
Headers show
Series [1/2] classes: image: Set empty weak default IMAGE_LINGUAS | expand

Commit Message

Alex Kiernan Jan. 2, 2023, 10:47 p.m. UTC
glibc 2.35 introduced C.UTF-8, we should include this by default.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---

 meta/conf/distro/include/default-distrovars.inc | 2 ++
 1 file changed, 2 insertions(+)

Comments

Richard Purdie Jan. 2, 2023, 11:03 p.m. UTC | #1
On Mon, 2023-01-02 at 22:47 +0000, Alex Kiernan wrote:
> glibc 2.35 introduced C.UTF-8, we should include this by default.
> 
> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> ---
> 
>  meta/conf/distro/include/default-distrovars.inc | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/meta/conf/distro/include/default-distrovars.inc b/meta/conf/distro/include/default-distrovars.inc
> index abf48f79f08a..5324bd543d22 100644
> --- a/meta/conf/distro/include/default-distrovars.inc
> +++ b/meta/conf/distro/include/default-distrovars.inc
> @@ -5,6 +5,8 @@ KERNEL_CONSOLE ?= "ttyS0"
>  KEEPUIMAGE ??= "yes"
>  
>  IMAGE_LINGUAS ?= "en-us en-gb"
> +IMAGE_LINGUAS:libc-glibc ?= "c en-us en-gb"
> +
>  ENABLE_BINARY_LOCALE_GENERATION ?= "1"
>  LOCALE_UTF8_ONLY ?= "0"
>  LOCALE_UTF8_IS_DEFAULT ?= "1"

I suspect this will catch people out since if someone does:

IMAGE_LINGUAS = "xxx"

then it won't work for glibc due to the override. I suspect what we
need will be more like:

DEFAULT_IMAGE_LINGUAS = "en-us en-gb"
DEFAULT_IMAGE_LINGUAS:libc-glibc = "c en-us en-gb"
IMAGE_LINGUAS ?= "${DEFAULT_IMAGE_LINGUAS}"

?

Cheers,

Richard
Alex Kiernan Jan. 3, 2023, 7:45 a.m. UTC | #2
On Mon, Jan 2, 2023 at 11:03 PM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Mon, 2023-01-02 at 22:47 +0000, Alex Kiernan wrote:
> > glibc 2.35 introduced C.UTF-8, we should include this by default.
> >
> > Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> > ---
> >
> >  meta/conf/distro/include/default-distrovars.inc | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/meta/conf/distro/include/default-distrovars.inc b/meta/conf/distro/include/default-distrovars.inc
> > index abf48f79f08a..5324bd543d22 100644
> > --- a/meta/conf/distro/include/default-distrovars.inc
> > +++ b/meta/conf/distro/include/default-distrovars.inc
> > @@ -5,6 +5,8 @@ KERNEL_CONSOLE ?= "ttyS0"
> >  KEEPUIMAGE ??= "yes"
> >
> >  IMAGE_LINGUAS ?= "en-us en-gb"
> > +IMAGE_LINGUAS:libc-glibc ?= "c en-us en-gb"
> > +
> >  ENABLE_BINARY_LOCALE_GENERATION ?= "1"
> >  LOCALE_UTF8_ONLY ?= "0"
> >  LOCALE_UTF8_IS_DEFAULT ?= "1"
>
> I suspect this will catch people out since if someone does:
>
> IMAGE_LINGUAS = "xxx"
>
> then it won't work for glibc due to the override. I suspect what we
> need will be more like:
>
> DEFAULT_IMAGE_LINGUAS = "en-us en-gb"
> DEFAULT_IMAGE_LINGUAS:libc-glibc = "c en-us en-gb"
> IMAGE_LINGUAS ?= "${DEFAULT_IMAGE_LINGUAS}"
>
> ?

I was slightly surprised when it did appear to work,expecting the
override to win - but I guess that's possibly because I've set it in
local.conf and not an image recipe:

#
# $IMAGE_LINGUAS [4 operations]
#   set /home/alexk/poky/build/conf/local.conf:303
#     ""
#   set? /home/alexk/poky/meta/conf/distro/include/default-distrovars.inc:7
#     "en-us en-gb"
#   set /home/alexk/poky/meta/conf/documentation.conf:218
#     [doc] "Specifies the list of locales to install into the image
during the root filesystem construction process."
#   override[libc-glibc]:set?
/home/alexk/poky/meta/conf/distro/include/default-distrovars.inc:8
#     "c en-us en-gb"
# pre-expansion value:
#   ""
IMAGE_LINGUAS=""

But the DEFAULT_IMAGE_LINGUAS is much more obvious and for some reason
simply didn't occur when I wrote this! I'll send a v2.
diff mbox series

Patch

diff --git a/meta/conf/distro/include/default-distrovars.inc b/meta/conf/distro/include/default-distrovars.inc
index abf48f79f08a..5324bd543d22 100644
--- a/meta/conf/distro/include/default-distrovars.inc
+++ b/meta/conf/distro/include/default-distrovars.inc
@@ -5,6 +5,8 @@  KERNEL_CONSOLE ?= "ttyS0"
 KEEPUIMAGE ??= "yes"
 
 IMAGE_LINGUAS ?= "en-us en-gb"
+IMAGE_LINGUAS:libc-glibc ?= "c en-us en-gb"
+
 ENABLE_BINARY_LOCALE_GENERATION ?= "1"
 LOCALE_UTF8_ONLY ?= "0"
 LOCALE_UTF8_IS_DEFAULT ?= "1"