]> code.ossystems Code Review - openembedded-core.git/commit
python3: split python target configuration into own class
authorAlexander Kanavin <alex.kanavin@gmail.com>
Fri, 13 Nov 2020 19:48:50 +0000 (20:48 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Nov 2020 14:27:42 +0000 (14:27 +0000)
commit5a118d4e7985fa88f04c3611f8db813f0dafce75
tree2e6fd8f9683d8cea2ddf1ba571f5497e21672f62
parentcdabc65298f58b3d0ae0de187a7114dd0c445846
python3: split python target configuration into own class

Setting _PYTHON_SYSCONFIGDATA_NAME in python3native class globally was
problematic as it was leaking into host python environment, which
was causing tracebacks depending on host distro and action
(typically anything involving importing sysconfig module).

The new class sets the variable only in specific tasks where it is needed,
and should be inherited explicitly:
- use python3native to run scripts with native python
- use python3targetconfig to run scripts with native python
if those scripts need to access target config data (such
as correct installation directories). This also adds a dependency
on target python, so should be used carefully to avoid lengthening builds.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/python3native.bbclass
meta/classes/python3targetconfig.bbclass [new file with mode: 0644]