[OE-core] [RFC 1/2] scripts: use python2 explicitly in shebangs

Mark Hatle mark.hatle at windriver.com
Thu Oct 30 13:06:38 UTC 2014


On 10/30/14, 7:39 AM, Burton, Ross wrote:
> On 29 October 2014 13:18, Martin Hundebøll <martin at hundeboll.net
> <mailto:martin at hundeboll.net>> wrote:
>
>         I used to use a virtualenv to temporarily set Python 2 as the default
>         for the shell in which I ran bitbake commands. That was a while ago
>         though, all my current builds are running on Ubuntu 12.04/14.04 server
>         instances which I access via ssh from my Arch Linux box.
>
>
>     Using a compatible distro-install is of course the easiest way to get going.
>     Could also work with a virtual machine.
>
>
> Paul meant the Python tool virtualenv,
> http://virtualenv.readthedocs.org/en/latest/virtualenv.html.  This can be used
> to create an environment where "python" on the search path is python 2, on a
> system where /usr/bin/ is python 3.
>
> I admit that I'm leaning towards thinking that we just say bitbake requires
> "python" to be 2.7+ and if your host distribution uses python 3 by default, use
> virtualenv.  The logic being added to the V2 series to generate symlinks and
> drop them into the bitbake source tree isn't very elegant.
>
> Obviously using virtualenv means you need to use /usr/bin/env in the shebangs,
> so that part of the series is still needed.

Everything should be using the /usr/bin/env python mechanism.  So that is correct.

For Yocto Project's poky, we've already said that python 2.7.3 or newer (and not 
3) is required.  If your system doesn't have this you can download the 
buildtools-tarball 'sdk', install that and source it first.

No need for third party things like virtualenv, we already provide the capabilities!

(And since this is oe-core, the components to build the special 
buildtools-tarball SDK are available in the tree.. just build it on a supported 
python 2.7.x machine and re-use it on a python3 machine.)

--Mark

> Ross
>
>




More information about the Openembedded-core mailing list