Bug 10908

Summary: devtool needs to check to see if locales are set properly for utf-8
Product: [Yocto Project Subprojects] eSDK Reporter: brian avery <brian.avery>
Component: eSDKAssignee: Paul Eggleton <bluelightning>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: henry.bruce
Version: 2.2   
Target Milestone: 2.3 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description brian avery 2017-01-10 22:15:13 UTC
Using either :
http://downloads.yoctoproject.org/releases/yocto/yocto-2.2/toolchain/x86_64/poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-2.2.sh

or building an esdk from morty and installing it result in  the following failure if locales are not set:


[cow@6a64b6e9c963 ~]$ . ./poky_sdk-morty/environment-setup-i586-poky-linux               
[cow@6a64b6e9c963 ~]$ devtool build-image core-image-minimal 
Parsing recipes..Traceback (most recent call last):
  File "/home/cow/poky_sdk-morty/sysroots/x86_64-pokysdk-linux/usr/bin/devtool", line 344, in <module>
    ret = main()
  File "/home/cow/poky_sdk-morty/sysroots/x86_64-pokysdk-linux/usr/bin/devtool", line 331, in main
    ret = args.func(args, config, basepath, workspace)
  File "/home/cow/poky_sdk-morty/layers/poky/scripts/lib/devtool/build_image.py", line 63, in build_image
    result, outputdir = build_image_task(config, basepath, workspace, image, add_packages)
  File "/home/cow/poky_sdk-morty/layers/poky/scripts/lib/devtool/build_image.py", line 88, in build_image_task
    tinfoil = setup_tinfoil(basepath=basepath)
  File "/home/cow/poky_sdk-morty/layers/poky/scripts/lib/devtool/__init__.py", line 116, in setup_tinfoil
    tinfoil.prepare(config_only)
  File "/home/cow/poky_sdk-morty/layers/poky/bitbake/lib/bb/tinfoil.py", line 91, in prepare
    self.parseRecipes()
  File "/home/cow/poky_sdk-morty/layers/poky/bitbake/lib/bb/tinfoil.py", line 74, in parseRecipes
    self.cooker.updateCache()
  File "/home/cow/poky_sdk-morty/layers/poky/bitbake/lib/bb/cooker.py", line 1602, in updateCache
    raise bb.BBHandledException()
bb.BBHandledException

-------
The cause of this was not evident to me at first glance.
[cow@6a64b6e9c963 ~]$ export LANG=en_US.UTF-8                                                       

fixes it.
Comment 1 Paul Eggleton 2017-01-16 20:04:02 UTC
What is LANG set to on your system if not en_US.UTF-8?
Comment 2 brian avery 2017-01-17 16:48:30 UTC
Containers typically come with locales unset. Before I changes it on my ubuntu box it was either C or POSIX.

That's why bitbake does:
bitbake/bin/bitbake:    sys.exit("Please use a locale setting which supports utf-8.\nPython can't change the filesystem locale after loading so we need a utf-8 when python starts or things won't work.")
bitbake/bin/bitbake-worker:    sys.exit("Please use a locale setting which supports utf-8.\nPython can't change the filesystem locale after loading so we need a utf-8 when python starts or things won't work.")

Before that was added in, bitbake also errorred out in a hard to follow fashion.
Comment 4 Paul Eggleton 2017-01-24 21:44:47 UTC
*** Bug 10892 has been marked as a duplicate of this bug. ***