Skip to content

python3: Fix building C extensions with setuptools#22551

Merged
neheb merged 1 commit intoopenwrt:masterfrom
jefferyto:python3-fix-setuptools-extension-build
Oct 30, 2023
Merged

python3: Fix building C extensions with setuptools#22551
neheb merged 1 commit intoopenwrt:masterfrom
jefferyto:python3-fix-setuptools-extension-build

Conversation

@jefferyto
Copy link
Copy Markdown
Member

Maintainer: me
Compile tested: armsr-armv7, 2023-10-28 snapshot sdk
Run tested: N/A

Description:
setuptools provides a local copy of distutils and when building a C extension, this distutils will add the target LIBDIR (/usr/lib) to the list of library paths.

If the build system has a libpython3.11.so in /usr/lib, then the linker will try to link to this shared library and fail.

This adapts 008-distutils-use-python-sysroot.patch for host setuptools to add the correct library directory.

Fixes: #22330

setuptools provides a local copy of distutils and when building a C
extension, this distutils will add the target LIBDIR (/usr/lib) to the
list of library paths.

If the build system has a libpython3.11.so in /usr/lib, then the linker
will try to link to this shared library and fail.

This adapts 008-distutils-use-python-sysroot.patch for host setuptools
to add the correct library directory.

Fixes: openwrt#22330

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
@BKPepe BKPepe requested a review from commodo October 30, 2023 17:20
@neheb neheb merged commit 624fb95 into openwrt:master Oct 30, 2023
@jefferyto jefferyto deleted the python3-fix-setuptools-extension-build branch October 31, 2023 04:26
@commodo
Copy link
Copy Markdown
Contributor

commodo commented Nov 1, 2023

Interesting.

I have another issue with python-yaml that may be fixed by this.
Will check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

python3-lxml: trying to link host python3 library

3 participants