Closed sloretz closed 4 years ago
colcon
passes a lot of arguments to the setup.py
file in order to do an out-of-source build: https://github.com/colcon/colcon-core/blob/e0b6abdb8d6f5a14b041b3ee8b6153d559524d43/colcon_core/task/python/build.py#L63-L74
So the question is how to achieve the same with a Python package containing a C extension?
If Python doesn't provide a way to do that we could implement something similar as for the develop
command (which doesn't support the out-of-source-build either): https://github.com/colcon/colcon-core/blob/e0b6abdb8d6f5a14b041b3ee8b6153d559524d43/colcon_core/task/python/build.py#L82
Basically symlink all required files from source into the build directory.
So the question is how to achieve the same with a Python package containing a C extension?
@sloretz Friendly ping.
@sloretz Friendly ping.
Without feedback how to achieve this for a vanilla Python package I am going to close this. Please feel free to comment with the requested information and the ticket can be reopened.
This is a feature request to have some way for ament_python packages to reference the source directory when building CPython extensions.
When built with colcon, the build fails complaining the file does not exist.
I am able to build this package using
python3 setup.py build
. I tried replacing'src/asdf.cpp'
with a full path relative to thesetup.py
.However, when I build with
colcon
the error indicates thesetup.py
file is located in the build directory.The file
src/asdf.cpp
needs to be found elsewhere, but I have no way of specifying that.