cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
wzab
Mentor
Mentor
12,631 Views
Registered: ‎08-24-2011

Petalinux 2017.4 - "petalinux-build" fails on the newest Debian/testing

Jump to solution

I was not using Petalinux on my Debian/testing box for a few weeks, but when I tried to recompile the design yesterday, I've got the following error:

[INFO] building project
[INFO] sourcing bitbake
INFO: bitbake petalinux-user-image
ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    You system needs to support the en_US.UTF-8 locale.

Summary: There was 1 ERROR message shown, returning a non-zero exit code.
ERROR: Failed to build project

I have traced down the proble to the sanity.bbclass file with the following procedure:

def sanity_check_locale(d):
    """
    Currently bitbake switches locale to en_US.UTF-8 so check that this locale a
ctually exists.
    """
    import locale
    try:
        locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
    except locale.Error:
        raise_sanity_error("You system needs to support the en_US.UTF-8 locale.", d)

When I run the above code in the Python, everything works perfectly. However in Petalinux it generates the above error...

1 Solution

Accepted Solutions
wzab
Mentor
Mentor
13,931 Views
Registered: ‎08-24-2011

I have made a silly workaround. I have simply disabled the locale check in all  4 sanity.bbclass files:

def sanity_check_locale(d):
    """
    Currently bitbake switches locale to en_US.UTF-8 so check that this locale actually exists.
    """
    return # disabled by WZab due to problems with Debian/testing
    import locale
    try:
        locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
    except locale.Error:
        raise_sanity_error("You system needs to support the en_US.UTF-8 locale.", d)

The above eliminated the error. The rest of the building process worked flawlessly, so it looks that it is only the sanity check that is not able to set the locales to en_US.UTF-8. Why?

View solution in original post

7 Replies
wzab
Mentor
Mentor
13,932 Views
Registered: ‎08-24-2011

I have made a silly workaround. I have simply disabled the locale check in all  4 sanity.bbclass files:

def sanity_check_locale(d):
    """
    Currently bitbake switches locale to en_US.UTF-8 so check that this locale actually exists.
    """
    return # disabled by WZab due to problems with Debian/testing
    import locale
    try:
        locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
    except locale.Error:
        raise_sanity_error("You system needs to support the en_US.UTF-8 locale.", d)

The above eliminated the error. The rest of the building process worked flawlessly, so it looks that it is only the sanity check that is not able to set the locales to en_US.UTF-8. Why?

View solution in original post

bigtastyrich
Visitor
Visitor
12,103 Views
Registered: ‎06-19-2018

I had this same problem, but fixed it more directly.  This seems to be an issue with how the setlocale() function is implemented in Debian vs Ubuntu.  Bash seems to intercept the LC_ macros when you want to set them directly using an export command.

 

Simple way to reproduce the problem:

sudo dpkg-reconfigure locales

You should see the same errors for LC_ALL, etc that stopped PetaLinux, even though the locale was effectively updated.

 

The fix:

sudo vim /etc/default/locale

Add the following lines:

LC_ALL="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LANGUAGE="en_US.UTF-8"

Now re-run dpkg-reconfigure locales and see the error messages are gone.

0 Kudos
ruhul
Contributor
Contributor
10,641 Views
Registered: ‎05-03-2016

I am facing the same problem.

Want to disable sanity checker BUT failed to find where is sanity.bbclass

 

Please help me to overcome this problem

 

Thanks 

Ruhul Amin

 

igorg
Contributor
Contributor
10,377 Views
Registered: ‎10-05-2017

It depends on the target CPU architecture, e.g. for zynqmp (aarch64) it will be:

 

<petalinux_install_dir>/components/yocto/source/aarch64/layers/core/meta/classes/sanity.bbclass

 

Regards,

Igor

0 Kudos
zc102test
Visitor
Visitor
9,909 Views
Registered: ‎11-19-2018

I am facing the same issue, but I only find two sanity.bbclass files:

sudo vim /opt/pkg/petalinux/components/yocto/source/layers/core/meta/classes/sanity.bbclass
sudo vim /opt/pkg/petalinux/components/yocto/source/aarch64/layers/core/meta/classes/sanity.bbclass

, after disabled sanity_check_locale,  the errors are still there:

utf8.png

 

0 Kudos
zc102test
Visitor
Visitor
9,903 Views
Registered: ‎11-19-2018

Please refer to Attila's solution at this link: https://forums.xilinx.com/t5/Embedded-Linux/PetaLinux-build-fails-with-locale-errors-How-to-disable-locale/m-p/894431/highlight/false#M28960

I have already verified on my Ubuntu18.10, it worked well.

Best Regards,

Jianhua

 

0 Kudos
yashaswini.shankar
Participant
Participant
6,559 Views
Registered: ‎07-24-2019

Diabling the sanity_check_locale in the sense. Since im new to petalinux i would like know about this.Beacuse even Im facing the same issue..

0 Kudos