Skip to content

fix(rules): copy_propagating_kwargs() now also copies target_compatible_with #2788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 18, 2025

Conversation

dws
Copy link
Contributor

@dws dws commented Apr 18, 2025

This routine already copies compatible_with, which is little used, but does not copy target_compatible_with, which is broadly used. This seems like an oversight.

I noticed this discrepancy when working on a system that assumes that any tags or target_compatible_with parameters supplied to a macro will propagate to all rules created by that macro. In rules_python, this already works for tags, but not for target_compatible_with.

It would be great to get this accepted upstream, so that I can stop patching rules_python.

…le_with

This routine already copies `compatible_with`, which is little used,
but does not copy `target_compatible_with`, which is broadly used.
This seems like an oversight.

I noticed this discrepancy when working on a system that assumes
that any `tags` or `target_compatible_with` parameters supplied
to a macro will propagate to all rules created by that macro.
In rules_python, this already works for `tags`, but not for
`target_compatible_with`.

It would be great to get this accepted upstream, so that I can
stop patching rules_python.
@dws dws changed the title fix: copy_propagating_kwargs() now also copies target_compatible_with fix(rules): copy_propagating_kwargs() now also copies target_compatible_with Apr 18, 2025
@rickeylev rickeylev marked this pull request as ready for review April 18, 2025 19:55
@rickeylev
Copy link
Collaborator

Nice catch. Yeah, this looks like an oversight. Thanks!

Copy link
Collaborator

@rickeylev rickeylev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a quick grep, copy_propagating is only used in a couple places, not all rules. I updated the changelog to better reflect that.

@rickeylev rickeylev enabled auto-merge April 18, 2025 19:58
@rickeylev rickeylev added this pull request to the merge queue Apr 18, 2025
Merged via the queue into bazel-contrib:main with commit abdf560 Apr 18, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants