[OE-core] [PATCH]] python: Unbreak Python third-party extensions

Michael Lippautz michael.lippautz at gmail.com
Tue May 3 08:12:00 UTC 2011


On Mon, May 02, 2011 at 09:57:18AM -0700, Kamble, Nitin A wrote:
> Michael,
>    This patch is invasive for python recipe but looks fine to me. How much testing have you done? We have few python extensions in yocto repo, and none of them were hit by this issue. So which python extensions are seeing the issue?

Basically any package that uses Python extensions [1] including C libraries
should suffer from this. The compilation of the package issues a cross-compile
warning, but the packaging should fail due to QA checks.

Background [once more]:
When building Python packages that contain C extensions, distutils has to figure
out the compiler/linker options. Distutils utilizes its own sysconfig module to
do so. However, this distutils.sysconfig module fetches the variables from the
sysrooted Makefile (of the target). Without this patch this results in
-I/usr/include and -L/usr/lib in the compiler/linker execution. (Python C
extension are linked against -lpython2.6 for various reasons.)

The patches shuffles the Makefiles (sysroot/target) around in a way that for
each bitbake step the right file is in place.

I did test this with some (private) packages and a gpsd build (2.96) that I have
not yet pushed somewhere. Everything works as expected so far.

> Thanks,
> Nitin
> 

Regards,
Michael

[1] http://docs.python.org/distutils/setupscript.html#describing-extension-modules




More information about the Openembedded-core mailing list