]> code.ossystems Code Review - openembedded-core.git/commit
distutils: Run python from the PATH in the -native case as well
authorDouglas Royds <douglas.royds@taitradio.com>
Mon, 6 May 2019 06:47:25 +0000 (18:47 +1200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 8 May 2019 11:12:30 +0000 (12:12 +0100)
commit0a5bd4f30182a3d55153e5ade76f1dfd5b52b482
tree0f959107e4743404b684477fb0c19ede4b2b0bbd
parent8e4b301573071ea04911b0df6533c25bc4596b93
distutils: Run python from the PATH in the -native case as well

The python distutils generate a python wrapper script for each package,
containing shebang lines pointing to the python executable.
In our case, this is a fully-qualified path to python-native in the
recipe-sysroot-native.

Ubuntu 18.04 restricts the useful length of the shebang line to 125
characters, and Ubuntu 16.04 restricts it to 77. In both cases, the
staged python script fails to run due to the length of the path to
the python-native executable.

Replace the shebang line with nativepython or nativepython3 as appropriate.
The nativepython symlink is installed by the python-native recipe:

    #!/usr/bin/env nativepython

We were already doing this for on-target distutils components.
This change applies the sed-line to -native distutils components as well.
In this way, -native clients of these components can invoke the wrapper scripts
directly, without themselves needing to inherit pythonnative.

This works around a known setuptools issue:
https://github.com/pypa/setuptools/issues/494
Even once this issue has been resolved upstream,
we will still need to replace `python` with `nativepython`

Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/distutils.bbclass
meta/classes/distutils3.bbclass