-
-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cross building fixes #2204
Cross building fixes #2204
Conversation
✅ Deploy Preview for maturin-guide ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
32b0d26
to
b14d1bb
Compare
This commit introduces helper InterpreterConfig.get_python_ext_arch() that can be used to determine the extension architecture name python uses in `ext_suffix` for this architecture. Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
When compiling under Yocto project for linux-armv7l target architecture .so files were generated incorrectly as: rpds.cpython-312-armv7l-linux-gnueabihf.so Where as platform and EXT_SUFFIX are defined as: >>> sysconfig.get_platform() 'linux-armv7l' >>> sysconfig.get_config_vars()['EXT_SUFFIX'] '.cpython-312-arm-linux-gnueabihf.so' Which should have caused the .so files as: rpds.cpython-312-arm-linux-gnueabihf.so Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
b14d1bb
to
111c62d
Compare
This commit introduces helper InterpreterConfig.get_python_target_env() that can be used to determine the extension ABI python uses in `ext_suffix` for this architecture. Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
When compiling under Yocto project for linux-ppc target architecture .so files were generated incorrectly as: rpds.cpython-312-ppc-linux-gnu.so Where as platform and EXT_SUFFIX are defined as: >>> sysconfig.get_platform() 'linux-ppc' >>> sysconfig.get_config_vars()['EXT_SUFFIX'] '.cpython-312-powerpc-linux-gnu.so' Which should have caused the .so files as: rpds.cpython-312-powerpc-linux-gnu.so Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
When compiling under Yocto project for linux-mips64 target architecture .so files were generated incorrectly as: rpds.cpython-312-mips64-linux-gnu.so Where as platform and EXT_SUFFIX are defined as: >>> sysconfig.get_platform() 'linux-mips64' >>> sysconfig.get_config_vars()['EXT_SUFFIX'] '.cpython-312-mips64-linux-gnuabi64.so' Which should have caused the .so files as: rpds.cpython-312-mips64-linux-gnuabi64.so Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
111c62d
to
aa812fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one minor question, do we have to consider musl libc for mips* targets?
Hi, We don't use musl as such... but it should be possible to configure selectively musl in use for most of the architectures in Yocto -- there are sometimes some corner cases where it could fail building of the image. Thanks, |
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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) (From OE-Core rev: cc347ceb58b4013602ba220ed3edb34493a25689) 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>
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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) 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>
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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) 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>
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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) (From OE-Core rev: 32a8a7379008cc6e367b7664c5b10b29f0bb8136) 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>
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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) 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>
…s64, 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: rootqemuarm:~# 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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) (From OE-Core rev: 32a8a7379008cc6e367b7664c5b10b29f0bb8136) Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainenvaisala.com> Signed-off-by: Niko Mauno <niko.maunovaisala.com> Signed-off-by: Richard Purdie <richard.purdielinuxfoundation.org>
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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) (From OE-Core rev: 32a8a7379008cc6e367b7664c5b10b29f0bb8136) (From OE-Core rev: a90bd181353036cb2118ee5a1c1540af58ced7fb) 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>
…s64, 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: rootqemuarm:~# 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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) (From OE-Core rev: 32a8a7379008cc6e367b7664c5b10b29f0bb8136) Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainenvaisala.com> Signed-off-by: Niko Mauno <niko.maunovaisala.com> Signed-off-by: Richard Purdie <richard.purdielinuxfoundation.org>
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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) (From OE-Core rev: 32a8a7379008cc6e367b7664c5b10b29f0bb8136) (From OE-Core rev: 26201c237fd2ce0b2863a3a74ebaf1b553162343) 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>
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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) (From OE-Core rev: 32a8a7379008cc6e367b7664c5b10b29f0bb8136) (From OE-Core rev: 9e0b85547f7cb7bba227209a3defbfb72b57468c) 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>
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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) (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>
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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) (From OE-Core rev: 32a8a73) 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>
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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) (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>
…s64, 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: rootqemuarm:~# 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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) (From OE-Core rev: 32a8a7379008cc6e367b7664c5b10b29f0bb8136) Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainenvaisala.com> Signed-off-by: Niko Mauno <niko.maunovaisala.com> Signed-off-by: Richard Purdie <richard.purdielinuxfoundation.org>
Source: poky MR: 166944 Type: Integration Disposition: Merged from poky ChangeID: c512698 Description: 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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) (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> Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
Source: poky MR: 166944 Type: Integration Disposition: Merged from poky ChangeID: c512698 Description: 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: PyO3/maturin#2203 Associated upstream pull request: PyO3/maturin#2204 Note - mitigation has not been tested with musl: PyO3/maturin#2204 (comment) (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> Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
This fixes several cross building issues noticed with Yocto Project.
Fixes:
Did the same tests as in the issue but with the commits here applied.
Test results:
qemuarm
armv7-poky-linux-gnueabihf
linux-armv7l
.cpython-312-arm-linux-gnueabihf.so
rpds.cpython-312-arm-linux-gnueabihf.so
qemuarm64
aarch64-poky-linux-gnu
linux-aarch64
.cpython-312-aarch64-linux-gnu.so
rpds.cpython-312-aarch64-linux-gnu.so
qemumips
mips-poky-linux-gnu
linux-mips
.cpython-312-mips-linux-gnu.so
rpds.cpython-312-mips-linux-gnu.so
qemumips64
mips64-poky-linux-gnu
linux-mips64
.cpython-312-mips64-linux-gnuabi64.so
rpds.cpython-312-mips64-linux-gnuabi64.so
qemuppc
powerpc-poky-linux-gnu
linux-ppc
.cpython-312-powerpc-linux-gnu.so
rpds.cpython-312-powerpc-linux-gnu.so
qemux86
i686-poky-linux-gnu
linux-i686
.cpython-312-i386-linux-gnu.so
rpds.cpython-312-i386-linux-gnu.so
qemux86-64
linux-x86_64
.cpython-312-x86_64-linux-gnu.so
rpds.cpython-312-x86_64-linux-gnu.so