-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
python3-lxml: trying to link host python3 library #22330
Comments
For some reason, OpenWrt is using |
Another hint:
Very similar to this #9275. |
For some reason |
I'm able to build python-lxml with no issues. Can you try building with a clean buildroot/sdk? |
I did a clean build with master and If i change |
Can you post a complete build log? Edit: also what OS/version is your build host? Edit 2: please include the build log for python as well as python-lxml |
Linux distro: Void Linux (native Python 3.11 installed in /usr/lib !!!)
thanks for looking into it. |
Do you get the same error if you compile for an existing arch/target instead of your custom target? |
Built the target Build instructions:
|
Oh forgot about another interesting fact :) But still, the problem is that LIBDIR is pointing to /usr/lib. |
I found something out. Made the following change:
And rebuilding the package produces this output:
I still do not understand it properly, but there is no "_python_sysroot" support in this build_ext.py as described here: #9288 |
Next finding :)
No "_python_sysroot" :/ |
Do we need to patch setuptool's build_ext.py ? |
I applied this patch https://github.com/openwrt/packages/blob/53dc7146f4623a99b62da5918b3f4ce002697a32/lang/python/python3/patches/008-distutils-use-python-sysroot.patch#L30C18-L33C50 |
The buildbots have no problem building this package. I am using Ubuntu 23.04 with Python 3.11.4 installed and I have no problem building this package. I'd like to understand what is different about your setup that is causing you problems before applying any solutions. |
Are you using Void Linux with glibc or musl? |
glibc |
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>
So the reason why the build succeeds on Debian/Ubuntu (and I believe Fedora) is because:
It is failing for you because libpython3.11.so is in /usr/lib on Void and the The fix is in #22551 - thanks for your help in diagnosing the issue and for your patience 🙏 |
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 Signed-off-by: Jeffery To <jeffery.to@gmail.com>
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> (cherry picked from commit 624fb95)
thanks for looking into this! |
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 Signed-off-by: Jeffery To <jeffery.to@gmail.com> (cherry picked from commit 624fb95)
Maintainer: @commodo
Environment: ARMv7 Processor rev 4 (v7l), OpenWrt SNAPSHOT r24099-5dfd8dc7d4f5
python3-lxml fails to build because it tries to link host's Python3 library.
The compiler is using
-L/usr/lib
.The text was updated successfully, but these errors were encountered: