Bug 9212

Summary: rework oe-core's handling of python and sysroots
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Alexander Kanavin <alex.kanavin>
Component: devtools / tool chainAssignee: Alexander Kanavin <alex.kanavin>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher, ross.burton
Version: unspecified   
Target Milestone: 2.2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Alexander Kanavin 2016-03-04 10:44:19 UTC
Current support for python and sysroots and target build utilizing native python to run scripts was written long time ago, isn't designed well and no one really understands it. It also contains incorrect code, such as:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch#n15
(HOST_SYS does not necessarily map directly to sysroot name).

We need to re-do it so that it's clean, simple and as free of side effects as possible.
Comment 1 Alexander Kanavin 2016-06-16 14:28:24 UTC
I have fixed the HOST_SYS issue in 4977a0743ba439a46716c6ef10c5958d5a561115.

After looking at this a bit closer (as a part of moving recipes to use python 3 where possible), I still don't have a clear idea how the redesign could look like. There is a million ways that software determines what the 'system' Python is, and there is no single way to take care of them all.

Also, determining the system directories through patching distutils to use STAGING_INCDIR/STAGING_LIBDIR when building for target is not a bad approach, and I don't know how to replace it with something better. One incremental improvement is no longer force recipes to export these variables - the python(3)native class should take care of it.
Comment 2 Alexander Kanavin 2016-06-22 12:10:47 UTC
Patch that moves staging_inc/libdir to python(3)native.bbclass submitted.
Comment 3 Alexander Kanavin 2016-07-04 10:03:31 UTC
Patch merged.