diff options
| author | Niko Mauno <niko.mauno@vaisala.com> | 2024-09-06 09:01:51 +0000 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-09-19 05:11:35 -0700 |
| commit | c5126983d918ccffc474c8a4a283acd9c6f8daa9 (patch) | |
| tree | e684580ca72e7260620f54c243c6d785bfe31b6b /meta/recipes-devtools/python/python3-maturin/0002-Fix-cross-compilation-issue-with-linux-armv7l-archit.patch | |
| parent | 585bd3edbafaa6e95958e28984c399dcf4a9c422 (diff) | |
| download | poky-c5126983d918ccffc474c8a4a283acd9c6f8daa9.tar.gz | |
python3-maturin: Fix cross compilation issue for armv7l, mips64, ppc
When bitbaking python3-rpds-py it built extension module as:
site-packages/rpds/rpds.cpython-312-armv7l-linux-gnueabihf.so
Which caused error on target:
root@qemuarm:~# python3 -c "from rpds import HashTrieMap, HashTrieSet, List"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.12/site-packages/rpds/__init__.py", line 1, in <module>
from .rpds import *
ModuleNotFoundError: No module named 'rpds.rpds'
Where as it should have been:
site-packages/rpds/rpds.cpython-312-arm-linux-gnueabihf.so
Associated upstream bug report:
https://github.com/PyO3/maturin/issues/2203
Associated upstream pull request:
https://github.com/PyO3/maturin/pull/2204
Note - mitigation has not been tested with musl:
https://github.com/PyO3/maturin/pull/2204#issuecomment-2323952320
(From OE-Core rev: 32a8a7379008cc6e367b7664c5b10b29f0bb8136)
(From OE-Core rev: d2f73e3840c21997b918d1f1cfae965c618c1076)
Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-devtools/python/python3-maturin/0002-Fix-cross-compilation-issue-with-linux-armv7l-archit.patch')
| -rw-r--r-- | meta/recipes-devtools/python/python3-maturin/0002-Fix-cross-compilation-issue-with-linux-armv7l-archit.patch | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-maturin/0002-Fix-cross-compilation-issue-with-linux-armv7l-archit.patch b/meta/recipes-devtools/python/python3-maturin/0002-Fix-cross-compilation-issue-with-linux-armv7l-archit.patch new file mode 100644 index 0000000000..4366dde111 --- /dev/null +++ b/meta/recipes-devtools/python/python3-maturin/0002-Fix-cross-compilation-issue-with-linux-armv7l-archit.patch | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | From 0c6b8cc84eff72ed21098029aaba079b899dbee2 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Vesa=20J=C3=A4=C3=A4skel=C3=A4inen?= | ||
| 3 | <vesa.jaaskelainen@vaisala.com> | ||
| 4 | Date: Sun, 1 Sep 2024 09:23:40 +0300 | ||
| 5 | Subject: [PATCH 2/5] Fix cross compilation issue with linux-armv7l | ||
| 6 | architecture | ||
| 7 | MIME-Version: 1.0 | ||
| 8 | Content-Type: text/plain; charset=UTF-8 | ||
| 9 | Content-Transfer-Encoding: 8bit | ||
| 10 | |||
| 11 | When compiling under Yocto project for linux-armv7l target architecture | ||
| 12 | .so files were generated incorrectly as: | ||
| 13 | |||
| 14 | rpds.cpython-312-armv7l-linux-gnueabihf.so | ||
| 15 | |||
| 16 | Where as platform and EXT_SUFFIX are defined as: | ||
| 17 | |||
| 18 | >>> sysconfig.get_platform() | ||
| 19 | 'linux-armv7l' | ||
| 20 | >>> sysconfig.get_config_vars()['EXT_SUFFIX'] | ||
| 21 | '.cpython-312-arm-linux-gnueabihf.so' | ||
| 22 | |||
| 23 | Which should have caused the .so files as: | ||
| 24 | |||
| 25 | rpds.cpython-312-arm-linux-gnueabihf.so | ||
| 26 | |||
| 27 | Upstream-Status: Backport [https://github.com/PyO3/maturin/commit/0c6b8cc84eff72ed21098029aaba079b899dbee2] | ||
| 28 | |||
| 29 | Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com> | ||
| 30 | --- | ||
| 31 | src/python_interpreter/config.rs | 8 ++++---- | ||
| 32 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
| 33 | |||
| 34 | diff --git a/src/python_interpreter/config.rs b/src/python_interpreter/config.rs | ||
| 35 | index d76606f2..5736aedc 100644 | ||
| 36 | --- a/src/python_interpreter/config.rs | ||
| 37 | +++ b/src/python_interpreter/config.rs | ||
| 38 | @@ -306,7 +306,7 @@ impl InterpreterConfig { | ||
| 39 | format!( | ||
| 40 | ".cpython-{}-{}-{}-{}.{}", | ||
| 41 | abi_tag, | ||
| 42 | - target.get_python_arch(), | ||
| 43 | + target.get_python_ext_arch(interpreter_kind), | ||
| 44 | target.get_python_os(), | ||
| 45 | target_env, | ||
| 46 | file_ext, | ||
| 47 | @@ -319,7 +319,7 @@ impl InterpreterConfig { | ||
| 48 | major, | ||
| 49 | minor, | ||
| 50 | abi_tag, | ||
| 51 | - target.get_python_arch(), | ||
| 52 | + target.get_python_ext_arch(interpreter_kind), | ||
| 53 | target.get_python_os(), | ||
| 54 | target_env, | ||
| 55 | file_ext, | ||
| 56 | @@ -330,7 +330,7 @@ impl InterpreterConfig { | ||
| 57 | format!( | ||
| 58 | ".{}-{}-{}.{}", | ||
| 59 | abi_tag.replace('_', "-"), | ||
| 60 | - target.get_python_arch(), | ||
| 61 | + target.get_python_ext_arch(interpreter_kind), | ||
| 62 | target.get_python_os(), | ||
| 63 | file_ext, | ||
| 64 | ) | ||
| 65 | @@ -341,7 +341,7 @@ impl InterpreterConfig { | ||
| 66 | format!( | ||
| 67 | ".cpython-{}-{}-{}.{}", | ||
| 68 | abi_tag, | ||
| 69 | - target.get_python_arch(), | ||
| 70 | + target.get_python_ext_arch(interpreter_kind), | ||
| 71 | target.get_python_os(), | ||
| 72 | file_ext | ||
| 73 | ) | ||
| 74 | -- | ||
| 75 | 2.34.1 | ||
| 76 | |||
