UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Scholar wzab
Scholar
6,770 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...

0 Kudos
1 Solution

Accepted Solutions
Scholar wzab
Scholar
8,070 Views
Registered: ‎08-24-2011

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

Jump to solution

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?

7 Replies
Scholar wzab
Scholar
8,071 Views
Registered: ‎08-24-2011

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

Jump to solution

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?

Visitor bigtastyrich
Visitor
6,242 Views
Registered: ‎06-19-2018

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

Jump to solution

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
Contributor
Contributor
4,780 Views
Registered: ‎05-03-2016

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

Jump to solution

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

 

Contributor
Contributor
4,516 Views
Registered: ‎10-05-2017

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

Jump to solution

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
Visitor zc102test
Visitor
4,048 Views
Registered: ‎11-19-2018

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

Jump to solution

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
Visitor zc102test
Visitor
4,042 Views
Registered: ‎11-19-2018

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

Jump to solution

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
Participant yashaswini.shankar
Participant
698 Views
Registered: ‎07-24-2019

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

Jump to solution

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