Fail if we try to crosscompile while PYTHON_SOABI is not set. #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[NOTE: This would be a workaround until python_cmake_module#7, which I couldn't make work locally]
When cross-compiling, we need the PYTHON_SOABI variable to be set.
The current method was using the system python interpreter instead of the target one, causing incorrect variable naming as in: #9 and ros2/pybind11_vendor#16
The current methodology is to provide to people cross-compiling with a sysroot (found using CMAKE_SYSROOT) with an user friendly error message to explain which variable should be set. (PYTHON_SOABI)
The possibly better way would be to execute the target python version with qemu-${ARCH}-static. This means we need to find the arch, check for qemu for this arch, find Python within the sysroot and execute it.
One argument against it is often a the DevOps creating the sysroot will have qemu, but it is not systematic for the developer side, thus creating possibly a "it works on my machine" clash against the DevOps.
Another consideration is, as we are using a sysroot, the python version will likely be fixed;
Sample output: