'devtool modify' fails for packages that inherit python3native (e.g. gpgme or systemd, via meson class): | Exception: ModuleNotFoundError: No module named '_sysconfigdata'
After commit 02714c105426 ("python3: upgrade to 3.7.2") python3native class exports _PYTHON_SYSCONFIGDATA_NAME = '_sysconfigdata'. I think the expectation is that it will find usr/lib/python-sysconfigdata/_sysconfigdata.py prepared by the same commit. But some places seems to still use host python3 which doesn't have _sysconfigdata.py. This leads to "No module named '_sysconfigdata'" errors. E.g. commit 4b26eaf7152f ("prservice.py: fix do_package with newer Python in Ubuntu 20.04") recently tried to workaround it for PR service. And now we see similar issue in devtool. To unblock devtool apply similar workaround here. But looks like there is some deeper issue here. I haven't fully grasped the purpose of _sysconfigdata.py yet. It is copied from _sysconfigdata_m_linux_x86_64-linux-gnu.py and then some variables are modified. But new values seems to be wrong. For example: In _sysconfigdata_m_linux_x86_64-linux-gnu.py: 'INCLUDEPY': 'FIXMESTAGINGDIRHOST/usr/include/python3.7m', While in _sysconfigdata.py: 'INCLUDEPY': 'FIXMESTAGINGDIRHOSTFIXMESTAGINGDIRHOST/usr/include/python3.7m', When FIXMESTAGINGDIRHOST is replaces by staging.bbclass, the path in _sysconfigdata.py points to nowhere while _sysconfigdata_m_linux_x86_64-linux-gnu.py has a correct path. Signed-off-by: Taras Kondratiuk <takon...@cisco.com> --- meta/classes/devtool-source.bbclass | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meta/classes/devtool-source.bbclass b/meta/classes/devtool-source.bbclass index 280d6009f3c2..4a469bfacad7 100644 --- a/meta/classes/devtool-source.bbclass +++ b/meta/classes/devtool-source.bbclass @@ -65,6 +65,11 @@ python() { python devtool_post_unpack() { + # Otherwise this fails when called from recipes which e.g. inherit + # python3native (which sets _PYTHON_SYSCONFIGDATA_NAME) with: No module + # named '_sysconfigdata' + if '_PYTHON_SYSCONFIGDATA_NAME' in os.environ: + del os.environ['_PYTHON_SYSCONFIGDATA_NAME'] import oe.recipeutils import shutil sys.path.insert(0, os.path.join(d.getVar('COREBASE'), 'scripts', 'lib')) -- 2.25.1
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#140536): https://lists.openembedded.org/g/openembedded-core/message/140536 Mute This Topic: https://lists.openembedded.org/mt/75425436/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-