[yocto] Yocto Python Issue

Ilya Dmitrichenko errordeveloper at gmail.com
Mon Mar 16 14:18:54 PDT 2015


Darcy,

Thank you for this post, it just saved me more hours of headache. I was
struggling to understand the purpose of `EXTRANATIVEPATH`, and
`pythonnative.bbclass` with `perlnative.bbclass`. Well, there are a few
other things when grep `EXTRANATIVEPATH` for, but I think I am happy to
hear the reason for this to exist, which your post and Richard Purdie's
commit message [1] are starting to explain.

[1]:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=5157c85776bb8bd7315ef42e6e622aae27ebc79e

If anyone has more to say on the motivation for these things to exist,
please do let us know. To me this seemed like a terrible hack of sorts at
first, now I can (sort of) see the some reason for it.

Cheers,
—
Ilya Dmitrichenko

On 6 March 2014 at 23:42, Darcy Watkins <
darcy.watkins at inmotiontechnology.com> wrote:

> Hi,
>
> This is followup to...
>
> https://lists.yoctoproject.org/pipermail/yocto/2014-February/018209.html
>
> ...for others dealing with 'cross-python' like issues.
>
> This is the python equivalent to cross compiling.  I found a number of
> resources related to python cross-compiling and even a pycon talk where
> the presenter covers the hurdles involved to get distutil to “cross”
> build as well.
>
> http://stackoverflow.com/questions/19120938/cross-compiling-python-2-7-4
> http://www.droboports.com/app-repository/python-2-7-5
> http://www.youtube.com/watch?v=nhr-YErfW8k
> http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html
>
> Fortunately the Yocto/OpenEmbedded folk have these sorted out - you just
> have to look in the right place.
>
> My resolution was to ensure that the correct native python is used.
> There is the host's native python that is used to run the tools of the
> build system (including 'bitbake' itself).
>
> Then there is a python-native that gets symlinked as 'nativepython' into
> the native sysroot.  This 'nativepython' is setup sort of as a
> crosscompiler python if you want to compile .py to .pyo/.pyc and put the
> compiled files on your target.
>
> Finally, there is the python that runs on the target system.
>
> ---
>
> My headache was due to using the host's native python (actually ADT
> bundled python on CentOS) when I needed to use 'nativepython'.  With a
> small amount of shoehorn work, I was readily able to get make rules and
> recipes to swig wrap some libraries as python extensions and to build
> using nativepython.
>
> There are a couple of variables you have to ensure get passed/exported
> through your make to be available to 'nativepython' to point it to the
> right sysroot locations of your target.
>
> BUILD_SYS=${BUILD_SYS}
> HOST_SYS=${HOST_SYS}
> STAGING_LIBDIR=${STAGING_LIBDIR}
> STAGING_INCDIR=${STAGING_INCDIR}
>
> If you are using swig-native, you also need to use "-I" to get your
> target sysroot include directories to it as well.
>
>
> --
>
> Regards,
>
> Darcy
>
> ---
>
> Darcy Watkins
> Senior Software Developer
> In Motion Technology, Inc.
> 350-625 Agnes St. New Westminster, BC
> Canada, V3M 5Y4
> [P1]
>
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20150316/7a326c99/attachment.html>


More information about the yocto mailing list