-
Notifications
You must be signed in to change notification settings - Fork 5
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
Crosscompiled artefacts are wrongly named #16
Comments
As for the other names, there is a pybin11-inspired methodology replicated in the |
In short, we don't regularly test cross-compilation (particularly with Python), so it isn't entirely surprising that it doesn't work. If you figure out ways to improve it, we would be happy to review pull requests for that. |
I fully understand that, as the buildfarms runs on target :) The solution I would propose is to use In the meantime, if someone else bumps into it, you can add the following in the toolchain. # See: https://github.com/ros2/pybind11_vendor to have pybind11 version, then
# See: https://github.com/pybind/pybind11/blob/8a4bca8216f94f64d9582997db5e7eaf2e4660b3/tools/pybind11NewTools.cmake#L98-L111
# Note the point!
set(PYTHON_MODULE_EXTENSION ".cpython-39-aarch64-linux-gnu.so")
# python_cmake_module workaround, PYTHON_MODULE_EXTENSION is set to PYTHON_SOABI
# See: https://github.com/ros2/python_cmake_module/blob/d31a0b13225786e076e537a6f1ba67ba5cb2e620/cmake/Modules/FindPythonExtra.cmake#L159-L197
# Note the lack of point & .so
set(PYTHON_SOABI cpython-39-aarch64-linux-gnu) |
This is "solvable" with the pull request located in ros2/python_cmake_module#12. The goal of that PR being to stop the compilation with a nice error message telling you to define PYTHON_SOABI when cross-compiling. Plus, it would also define PYTHON_MODULE_EXTENSION as it is required in certain cases (rclpy) |
try this .. rolling...mosfet80:pybind11_vendor:UpdatePybind11 i have update pybind to version 2.10.4 |
The Pybind11 script is using system Python to get the PYTHON_MODULE_EXTENSION (aka SO_SUFFIX) instead of using the sysroot defined in the toolchain.
This causes properly built files (aarch64) to be incorrectly named (x86_64).
The cause is in Pybind11, where the module extension value is found from executing Python on the system instead of the sysroot target.
We are currently on galactic, which points to pybind11_vendor#foxy.
Sadly, the quickfix only works for rclpy which explicitly calls Pybind11.
Quickfix
Output with Quickfix
What is the clean way to make pybind11 work with crosscompilation?
The text was updated successfully, but these errors were encountered: