Return-Path: Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by mail.openembedded.org (Postfix) with ESMTP id 2252E6AC4B for ; Thu, 14 Jul 2016 18:57:59 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id u6EIvx43016358 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 14 Jul 2016 11:57:59 -0700 (PDT) Received: from soho-mhatle-m.corp.ad.wrs.com (147.11.4.176) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.3.248.2; Thu, 14 Jul 2016 11:57:59 -0700 To: Ross Burton , References: <1468514260-5560-1-git-send-email-ross.burton@intel.com> From: Mark Hatle Organization: Wind River Systems Message-ID: <1ce58e9f-a312-dd9a-d1b2-d787773fa18e@windriver.com> Date: Thu, 14 Jul 2016 11:58:00 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1468514260-5560-1-git-send-email-ross.burton@intel.com> Subject: Re: [PATCH] glibc: use the host locale archive in nativesdk builds X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2016 18:58:01 -0000 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit On 7/14/16 9:37 AM, Ross Burton wrote: > The nativesdk libc when used by buildtools has a hard requirement on supporting > a UTF-8 locale because Python 3 needs a UTF-8 locale. However we currently only > ship the C locale, which means that Python attempts to lookup the user's locale > (for example, en_NZ.UTF-8) in the locale archive under it's prefix it fails and > falls back to C. This the results in Python using ASCII instead of UTF-8 for > file encoding, and bitbake breaks. Have you considered shipping a single C.UTF-8 local? (Not all distributions have this.) Then defaulting to that for the buildtools usage. This would keep things small and contained. > Th obvious solution would be to ship all locales, but this would add > approximately 250MB to the size of the buildtools tarball (which is currently > around 30MB). Generating a binary locale archive reduces this down to 100MB, > but this is still a drastic increase in footprint. If we ship a subset of > locales in the tarball then there will be users whose locale isn't in the > tarball, and they'll have to change their locale to an "approved" one, which > isn't the best of messages to send to new users. > > The alternative is to tell the nativesdk libc that the locale archive isn't > under it own prefix but is in fact at /usr/lib/locale/locale-archive, so the > buildtools libc uses the host locale archive. The locale archive format appears > to be at least fairly stable: our glibc 2.24 can read the locale archive > generated by glibc 2.17 (Centos 7). Patching glibc to use the host system as a backup for the locales makes sense to me as well. However it is definitely more work and may not be worth it... In the buildtools case, do any of the other components we ship actually have localized content? If we're shipping message catalogs for non-english systems -- then we definitely need non-english locale to work. But if we're only shipping english -- C.utf-8 might be enough. --Mark > [ YOCTO #9775 ] > > Signed-off-by: Ross Burton > --- > meta/recipes-core/glibc/glibc_2.24.bb | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/meta/recipes-core/glibc/glibc_2.24.bb b/meta/recipes-core/glibc/glibc_2.24.bb > index 456f206..4bc6443 100644 > --- a/meta/recipes-core/glibc/glibc_2.24.bb > +++ b/meta/recipes-core/glibc/glibc_2.24.bb > @@ -129,6 +129,12 @@ do_compile () { > > } > > +# Use the host locale archive when built for nativesdk so that we don't need to > +# ship a complete (100MB) locale set. > +do_compile_prepend_class-nativesdk() { > + echo "complocaledir=/usr/lib/locale" >> ${S}/configparms > +} > + > require glibc-package.inc > > BBCLASSEXTEND = "nativesdk" >