Account for features when trying to install binaries#26
Merged
esteve merged 2 commits intoros2-rust:mainfrom Oct 27, 2025
Merged
Account for features when trying to install binaries#26esteve merged 2 commits intoros2-rust:mainfrom
esteve merged 2 commits intoros2-rust:mainfrom
Conversation
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
luca-della-vedova
approved these changes
Oct 17, 2025
Collaborator
luca-della-vedova
left a comment
There was a problem hiding this comment.
Makes sense to me, just a small nit, after this is merged we should ticket an issue in colcon-ros-cargo for followup for feature support
src/lib.rs
Outdated
Comment on lines
263
to
264
| .find(|feature| !features.contains(*feature)) | ||
| .is_some(); |
Collaborator
There was a problem hiding this comment.
Nit, I think clippy would say that find([...]).is_some() can be changed into any([...]).
Contributor
Author
There was a problem hiding this comment.
The CI seemed to need a bump, so I went ahead with the suggestion: 00fc7e5
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
luca-della-vedova
approved these changes
Oct 24, 2025
Collaborator
|
LGTM, will let this sit a few days in case anyone else (i.e. @esteve) wants to have a look before merging |
esteve
approved these changes
Oct 27, 2025
Contributor
esteve
left a comment
There was a problem hiding this comment.
@mxgrey thanks for the PR and @luca-della-vedova thanks for the review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
While using colcon-ros-cargo with a package that has some feature flags and conditionally compiled binaries, I found that
cargo-ament-buildwas attempting to install every possible binary no matter what and erroring out if that installation fails for any reason. This was causing colcon failures when a binary doesn't get built because its required feature flags weren't active in the colcon build.This PR fixes the problem by introducing an argument to list the feature flags, defaulting to no features. Before trying to install each binary, we now check whether all of its required feature flags are set. Any binary with required features that are missing simply gets skipped in the installation process.
This immediately fixes the current problem while maintaining a path to support conditionally compiled binaries in the future. Full support for feature flags would need to be introduced in https://github.com/colcon/colcon-ros-cargo