Summary: | dev-lang/python: fails to cross-compile for aarch64_be-unknown-linux-gnu (AssertionError: SRE module mismatch, generate-posix-vars failed) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Sam James <sam> |
Component: | Current packages | Assignee: | Python Gentoo Team <python> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | PullRequest |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=847910 https://github.com/gentoo/gentoo/pull/27740 https://bugs.gentoo.org/show_bug.cgi?id=880059 https://bugs.gentoo.org/show_bug.cgi?id=705970 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | build.log |
Description
Sam James
![]() ![]() ![]() ![]() >_PYTHON_PROJECT_BASE=/usr/aarch64_be-unknown-linux-gnu/tmp/portage/dev-lang/python-3.10.6_p2/work/Python-3.10.6 _PYTHON_HOST_PLATFORM=linux-aarch64_be PYTHONPATH=./Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__linux_aarch64_be-linux-gnu python -S -m sysconfig --generate-posix-vars ;\
Note that it's calling 'python'. 'python' here for me is Python 3.11.
Now, if I do EPYTHON=python3.10 aarch64_be-unknown-linux-gnu-emerge -v1 dev-lang/python:3.10, it works!
So, we need a CBUILD Python which is the same version, apparently. Or at least not newer, but I'm guessing we actually do need the same version?
(Note that we've already implemented this logic for Python 3.11.)
See also: https://github.com/openembedded/openembedded-core/blob/master/meta/recipes-devtools/python/python3/crosspythonpath.patch https://cgit.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch?h=pyro https://cgit.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python3/000-cross-compile.patch?h=pyro But yeah, we get the problem. We just need to do the Python 3.11-style build-a-Python-for-CBUILD, I think, possibly with a minor build system tweak, but PATH may be enough. We can set PYTHON_FOR_BUILD. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29d2314810bd8e1de73df5c3ebe30c826281c253 commit 29d2314810bd8e1de73df5c3ebe30c826281c253 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-10-11 14:18:03 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-10-11 17:53:26 +0000 dev-lang/python: build CBUILD Python for cross in older versions See bug 864911 for details. Bug: https://bugs.gentoo.org/847910 Closes: https://bugs.gentoo.org/864911 Signed-off-by: Sam James <sam@gentoo.org> dev-lang/python/python-3.10.7.ebuild | 45 ++++++++++++++++++++++++++++++++++++ dev-lang/python/python-3.8.14.ebuild | 45 ++++++++++++++++++++++++++++++++++++ dev-lang/python/python-3.9.14.ebuild | 45 ++++++++++++++++++++++++++++++++++++ 3 files changed, 135 insertions(+) The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3478cabb5f94e9d90ae1ed9e3f7909a1146aa471 commit 3478cabb5f94e9d90ae1ed9e3f7909a1146aa471 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-12-06 19:35:41 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-12-06 19:38:51 +0000 dev-lang/python: disable _ctypes, _crypt for cross (CBUILD) Python * Use a hack to deduce libdir to nudge the build system in the right direction because get_libdir can't handle BROOT/CBUILD right now. * Disable _ctypes (libffi) and _crypt (lib(x)crypt) modules for cross (CBUILD) Python as they're not needed and Python struggles to find the libraries correctly. This avoids an issue where setup.py can't handle deducing libdir (or even being passed it) for cross-compilation. Fortunately, cpython is migrating away from setup.py to autotools. Note that this isn't the same as what bug 633712 would've been at the time it was reported, but it certainly showed up the same way on more modern Pythons since we introduced the CBUILD part a few months ago. Bug: https://bugs.gentoo.org/633712 Bug: https://bugs.gentoo.org/794181 Bug: https://bugs.gentoo.org/864911 Signed-off-by: Sam James <sam@gentoo.org> dev-lang/python/python-3.10.8_p3.ebuild | 13 +++++++++++-- dev-lang/python/python-3.11.0_p2.ebuild | 13 +++++++++++-- dev-lang/python/python-3.12.0_alpha2.ebuild | 13 +++++++++++-- dev-lang/python/python-3.8.15_p3.ebuild | 13 +++++++++++-- dev-lang/python/python-3.9.15_p3.ebuild | 13 +++++++++++-- 5 files changed, 55 insertions(+), 10 deletions(-) |