]> 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>
Thu, 11 Feb 2021 17:44:11 +0000 (17:44 +0000)
commit386c5d3f2283bc16cdab32bd4a5397dc0ef0a5c1
treeae6a8166c212aeb8ee1e00ca9c00ea374a9ec16a
parent2b0577ae97366bd8c90387406e4a23fd15672518
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>
(cherry picked from commit 823cbf815d6984e813f0ae812f6a14469150eeff)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
meta/classes/python3native.bbclass
meta/classes/python3targetconfig.bbclass [new file with mode: 0644]