<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>10165</bug_id>
          
          <creation_ts>2016-08-19 16:08:28 +0000</creation_ts>
          <short_desc>Check that the locale en_US.UTF-8 is available</short_desc>
          <delta_ts>2022-12-08 14:58:05 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>NEWCOMER</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Frey">dfrey</reporter>
          <assigned_to name="Frank de Brabander">debrabander</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>debrabander</cc>
    
    <cc>Falital</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>ross.burton</cc>
    
    <cc>sgw</cc>
    
    <cc>vincent.libre</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>65357</commentid>
    <comment_count>0</comment_count>
    <who name="David Frey">dfrey</who>
    <bug_when>2016-08-19 16:08:28 +0000</bug_when>
    <thetext>I was trying to follow the &apos;hello world&apos; example of the Bitbake documentation from appendix a.

This is the output from my Bitbake run:
$ bitbake printHello
Parsing recipes: 100% |#########################################################################################################################################################################################################################################################################################| Time: 0:00:00
Parsing of 1 .bb files complete (0 cached, 1 parsed). 1 targets, 0 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |######################################################################################################################################################################################################################################################################################| Time: 0:00:00
NOTE: Executing RunQueue Tasks
Please use a locale setting which supports utf-8.
Python can&apos;t change the filesystem locale after loading so we need a utf-8 when python starts or things won&apos;t work.
NOTE: Tasks Summary: Attempted 1 tasks of which 1 didn&apos;t need to be rerun and all succeeded.

$ locale
LANG=en_CA.UTF-8
LANGUAGE=en_CA:en
LC_CTYPE=&quot;en_CA.UTF-8&quot;
LC_NUMERIC=&quot;en_CA.UTF-8&quot;
LC_TIME=&quot;en_CA.UTF-8&quot;
LC_COLLATE=&quot;en_CA.UTF-8&quot;
LC_MONETARY=&quot;en_CA.UTF-8&quot;
LC_MESSAGES=&quot;en_CA.UTF-8&quot;
LC_PAPER=&quot;en_CA.UTF-8&quot;
LC_NAME=&quot;en_CA.UTF-8&quot;
LC_ADDRESS=&quot;en_CA.UTF-8&quot;
LC_TELEPHONE=&quot;en_CA.UTF-8&quot;
LC_MEASUREMENT=&quot;en_CA.UTF-8&quot;
LC_IDENTIFICATION=&quot;en_CA.UTF-8&quot;
LC_ALL=

I am running from the master branch of bitbake which is currently version 3ff1c66.

I did a bit of investigation and bitbake-worker&apos;s call to sys.getfilesystemencoding() is returning &quot;ascii&quot;.  Interestingly, if I just run &quot;/usr/bin/env python3&quot; and then call sys.getfilesystemencoding(), I get &quot;utf-8&quot;.

I asked about this problem in #oe on freenode and Richard Purdie asked if I have the en_US locale installed.  I did not.  I ran dpkg-reconfigure locales and selected en_US.utf-8 to be generated and the problem went away.  I still had en_CA.utf-8 as my default locale though.

Suggestion: If bitbake requires en_US.utf-8, then the error message should indicate that.  If bitbake only requires any utf-8 locale then it should work with en_CA.utf-8 (and any other utf-8 locale).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65494</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-08-24 21:15:22 +0000</bug_when>
    <thetext>bitbake itself doesn&apos;t care what locale as long as UTF-8 is supported, so this is odd.  Are you using buildtools?  What release/git SHA are you using of OE?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65510</commentid>
    <comment_count>2</comment_count>
    <who name="David Frey">dfrey</who>
    <bug_when>2016-08-25 16:20:04 +0000</bug_when>
    <thetext>This is the version of bitbake that I am using:

$ git remote -v
origin  git://git.openembedded.org/bitbake (fetch)
origin  git://git.openembedded.org/bitbake (push)

$ git log -n 1 HEAD
commit 3ff1c66e6f336e5de7dcbc983a97fcd19ddc6b81
Author: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
Date:   Thu Aug 18 10:05:26 2016 +0100

    bitbake: Update version to 1.31.1
    
    Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65511</commentid>
    <comment_count>3</comment_count>
    <who name="David Frey">dfrey</who>
    <bug_when>2016-08-25 16:22:31 +0000</bug_when>
    <thetext>And no, I am not using buildtools.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.5 (jessie)
Release:        8.5
Codename:       jessie</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65512</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-08-25 16:50:04 +0000</bug_when>
    <thetext>I&apos;ve a slightly newer version of bitbake locally and the same release of Debian.

Are you using oe-core, or your own metadata layer?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65513</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-08-25 16:51:08 +0000</bug_when>
    <thetext>Whilst the check shouldn&apos;t be failing, we should extend the check in bitbake to be &quot;is current locale utf-8 and is en_US.UTF-8 available?&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65560</commentid>
    <comment_count>6</comment_count>
    <who name="David Frey">dfrey</who>
    <bug_when>2016-08-26 15:36:30 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; I&apos;ve a slightly newer version of bitbake locally and the same release of
&gt; Debian.
&gt; 
&gt; Are you using oe-core, or your own metadata layer?

I am pretty new to bitbake, so I don&apos;t even really understand the question.  What I can tell you is that I just cloned the bitbake repository and then wrote a few .bb and .conf files as directed by the &quot;hello world&quot; example from appendix A of the bitbake documentation.

Relevant files in my directory are:
conf/bitbake.conf
conf/bblayers.conf
classes/base.bbclass
mainLayer/printHello.bb
mainLayer/conf/layer.conf</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71499</commentid>
    <comment_count>7</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-03-21 03:27:17 +0000</bug_when>
    <thetext>We are actually setting LC_ALL in a couple of places to en_US.UTF-8. I think that&apos;s unfortunate, but that probably does mean we need to state that that&apos;s what we need installed (but not selected).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77478</commentid>
    <comment_count>8</comment_count>
    <who name="Vincent Rubiolo">vincent.libre</who>
    <bug_when>2017-10-10 05:52:13 +0000</bug_when>
    <thetext>I encountered the same problem today when building Pyro from the git tree within a Fedora 23 Docker container:
[yocto@abf49f8bb774 build]$ bitbake -h
Please use a locale setting which supports utf-8.
Python can&apos;t change the filesystem locale after loading so we need a utf-8 when python starts or things won&apos;t work.

The locale is set to POSIX by default:
$ locale
LANG=
LC_CTYPE=&quot;POSIX&quot;
LC_NUMERIC=&quot;POSIX&quot;
LC_TIME=&quot;POSIX&quot;
LC_COLLATE=&quot;POSIX&quot;
LC_MONETARY=&quot;POSIX&quot;
LC_MESSAGES=&quot;POSIX&quot;
LC_PAPER=&quot;POSIX&quot;
LC_NAME=&quot;POSIX&quot;
LC_ADDRESS=&quot;POSIX&quot;
LC_TELEPHONE=&quot;POSIX&quot;
LC_MEASUREMENT=&quot;POSIX&quot;
LC_IDENTIFICATION=&quot;POSIX&quot;
LC_ALL=


My HEAD is at:
commit 717303e6fbcbbe181ad9645d762eb5a85d934523 (HEAD -&gt; pyro, origin/pyro)
Author: Gerson Fernando Budke &lt;nandojve@gmail.com&gt;
Date:   Fri Sep 22 07:29:08 2017 +0200

    image.bbclass: Sorted ctypes to avoid basehash error
[...]

The workaround for me was to export LANG=en.US_utf-8 via Docker ENV, as suggested by https://github.com/fedora-cloud/docker-brew-fedora/issues/14:


It would be nice if the bitbake error message was more explicit indeed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77480</commentid>
    <comment_count>9</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-10-10 09:10:09 +0000</bug_when>
    <thetext>Vincent, your situation isn&apos;t the same.  In your case you started with a non-UTF8 locale, and were told by bitbake to use a UTF-8 locale.  I don&apos;t think we want to start telling people to use en_US.UTF-8 as that is only relevant for Americans.

(This bug is about the obscure error you get if en_US.UTF-8 isn&apos;t available at all)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94478</commentid>
    <comment_count>10</comment_count>
    <who name="Sawas Etairidis">Falital</who>
    <bug_when>2022-12-07 11:04:19 +0000</bug_when>
    <thetext>Hi Frank, 

I also wanted to start with this one but you beat me to it :). I would like to share what I found in my investigation. The reason for this happens is that the LC_ALL enviroment variable is set to en_US.UTF-8 if the system does not support this encoding all processes started by bitbake revert to a filesystem encoding ascii. The line which does this is in ./bitbake/lib/bb/utils.py::622 of source rev a0dcf93bc919757b23a52597eacb1777df4adf24

Regards
Savvas</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94495</commentid>
    <comment_count>11</comment_count>
    <who name="Frank de Brabander">debrabander</who>
    <bug_when>2022-12-08 14:58:05 +0000</bug_when>
    <thetext>Check added, fix merged in master/master-next as a4ce040a.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>