feat: render aliases for extra_targets
of whl_mods
.
#1903
Closed
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.
I'm trying to get rules_ros2 to Bzlmod. There is a dependency on numpy headers that are exposed via an additive_build_content cc_library. One of the last migration challenges is how to properly consume these headers in both Bzlmod and Workspace and without hardcoding a Python version. See mvukov/rules_ros2#238 (comment) for the WIP PR.
I dug a little into how the aliasing works and come up with a proof of concept of how a list of extra_targets could be propagated from pip.whl_mods like
This makes it possible to depend on
"@rules_ros2_pip_deps//numpy:headers"
instead of e.g."@rules_ros2_pip_deps_310_numpy//:headers
Workspace doesn't have this problem, but the label looks slightly different.
That can be worked around with an alias for now.
You can see this in action in mvukov/rules_ros2@e2b926c
Please let me know what you think of this. Maybe there is a more elegant way to achieve this?