[yocto] How does python-native work?

Chris Larson clarson at kergoth.com
Wed Apr 23 08:37:22 PDT 2014


On Wed, Apr 23, 2014 at 7:57 AM, Gary Thomas <gary at mlbassoc.com> wrote:

> On 2014-04-23 08:21, Chris Larson wrote:
>
>  On Wed, Apr 23, 2014 at 7:15 AM, Gary Thomas <gary at mlbassoc.com <mailto:
>> gary at mlbassoc.com>> wrote:
>>
>>     How is python-native supposed to work?  I can see that it's
>>     built and installed in my tmp/sysroots/HOST but it's installed
>>     in a sub-directory which is not found by normal means.
>>
>>
>> inherit pythonnative (or one of the classes that inherit it)
>>
>
> Thanks, I imported 'distutils' and that helped, but I still have problems
> with it.  Looking
> at log.do_configure:
>   checking for python... /local/rpi_2014-04-10/tmp/
> sysroots/x86_64-linux/usr/bin/python-native/python
>   checking for python-config... /local/rpi_2014-04-10/tmp/
> sysroots/x86_64-linux/usr/bin/python-native/python-config
>   Traceback (most recent call last):
>     File "/local/rpi_2014-04-10/tmp/sysroots/x86_64-linux/usr/bin/python-native/python-config",
> line 6, in <module>
>       from distutils import sysconfig
>     File "/local/rpi_2014-04-10/tmp/sysroots/x86_64-linux/usr/lib/
> python2.7/distutils/sysconfig.py", line 22, in <module>
>       PREFIX = os.path.normpath(sys.prefix).replace(
> os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
>   TypeError: expected a character buffer object
>
> When I ran python-config before (original email), the results
> were from outside the build environment, i.e. the command line
> where I run 'bitbake'.  When do_configure() runs in my recipe,
> the environment seems to be quite different.  If I try to run
> python-config from devshell (for my recipe), it fails as above.
>

First, it's a bit worrisome that you're inheriting a class for distutils
when your build doesn't actually use distutils.. but beyond that, I don't
think the classes inherited by distutils assume you'll be running
python-config. Add this:

    export BUILD_SYS
    export HOST_SYS
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20140423/766e62fc/attachment.html>


More information about the yocto mailing list