summaryrefslogtreecommitdiffstats
path: root/meta/classes/python3targetconfig.bbclass
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2020-11-13 20:48:50 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-11-16 14:27:46 +0000
commitc9f7ed88a946078c27fa1a62d54d6310fad9d37a (patch)
tree13a911e8c43d5fa48975b891a0859b75f85d5894 /meta/classes/python3targetconfig.bbclass
parent029c05595e8e3110c7855f33a3f9a1ebd159fc6b (diff)
downloadpoky-c9f7ed88a946078c27fa1a62d54d6310fad9d37a.tar.gz
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. (From OE-Core rev: 5a118d4e7985fa88f04c3611f8db813f0dafce75) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/python3targetconfig.bbclass')
-rw-r--r--meta/classes/python3targetconfig.bbclass15
1 files changed, 15 insertions, 0 deletions
diff --git a/meta/classes/python3targetconfig.bbclass b/meta/classes/python3targetconfig.bbclass
new file mode 100644
index 0000000000..640d0c97b6
--- /dev/null
+++ b/meta/classes/python3targetconfig.bbclass
@@ -0,0 +1,15 @@
1inherit python3native
2
3DEPENDS_append = " python3"
4
5do_configure_prepend() {
6 export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
7}
8
9do_compile_prepend() {
10 export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
11}
12
13do_install_prepend() {
14 export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
15}