Proposal: Use PlatformIO Python in colcon build #108
Merged
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.
Regarding the execution of 'colcon build' within library_builder.py:
In my local environment, the 'cmake' command within 'colcon build' in library_builder.py seems to find and use the system's Python instead of the Python version bundled with PlatformIO. Consequently, if I use a virtual environment like pyenv, 'colcon build' fails.
I can make PlatformIO use its bundled Python version by setting the -DPython3_EXECUTABLE option in --cmake-args.
This appears to be the desired behavior, for the following reasons:
In fact, setting this option allows all builds to be completed using PlatformIO's Python version, which works well in a pyenv environment.
However, I believe that executing the build on a system with ROS already installed is also a correct approach.
While I'm not fully versed in this library to make a definitive call, I thought it pertinent to raise this issue and have therefore submitted this PR.