pythonnative version mismatch?

Kun Yi kunyi at google.com
Thu Oct 12 04:32:33 AEDT 2017


Wow, thanks for the super helpful and comprehensive answer, Rick!!

On Mon, Oct 9, 2017 at 1:51 PM, Rick Altherr <raltherr at google.com> wrote:

> This was a really good question.  I wrote a blog post to document the
> answer: https://www.kc8apf.net/2017/10/snakes-in-a-sysroot/.
>
> On Fri, Oct 6, 2017 at 11:00 AM, Kun Yi <kunyi at google.com> wrote:
>
>> Hello folks,
>>
>> I searched through the mailing list but haven't seen anyone brought up.
>> Here's a weird bug I found on my setup: pythonnative seems to be using
>> python3.4.3 whereas the recipe specified 2.7.
>>
>> Before diving into the layers of bitbake recipes to root cause what
>> caused this, I want to post on the mailing list to see if it is
>> reproducible on other setups, and if people have ideas why this went wrong
>> (environment variable accidentally being overwritten?)
>>
>> *What I tested:*
>> I found the code in phosphor-settings-manager, which inherits
>> pythonnative, seems to be working per python 3, so added the following line
>> into a native python function:
>>
>> python do_check_version () {
>>   import sys
>>   bb.warn(sys.version)
>> }
>> addtask check_version after do_configure before do_compile
>>
>> WARNING: phosphor-settings-manager-1.0-r1 do_check_version: 3.4.3
>> (default, Nov 17 2016, 01:08:31)
>>
>> This is with openbmc git tip, building MACHINE=zaius
>>
>> *What the recipe should be using is seemingly 2.7:*
>> $ cat ../import-layers/yocto-poky/meta/classes/pythonnative.bbclass
>>
>> inherit python-dir
>> [...]
>>
>> $ cat ../import-layers/yocto-poky/meta/classes/python-dir.bbclass
>> PYTHON_BASEVERSION = "2.7"
>> PYTHON_ABI = ""
>> PYTHON_DIR = "python${PYTHON_BASEVERSION}"
>> PYTHON_PN = "python"
>> PYTHON_SITEPACKAGES_DIR = "${libdir}/${PYTHON_DIR}/site-packages"
>>
>> *Why this is bad:*
>> well, python2.7 and python3 have a ton of differences. A bug I discovered
>> is due to usage of filter(), which returns different objects between
>> Python2/3.
>>
>> --
>> Regards,
>> Kun
>>
>
>


-- 
Regards,
Kun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20171011/50a759e4/attachment.html>


More information about the openbmc mailing list