Skip to content
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

Use rule(parent = ...) when possible #145

Merged
merged 1 commit into from
Dec 20, 2024
Merged

Use rule(parent = ...) when possible #145

merged 1 commit into from
Dec 20, 2024

Conversation

fmeum
Copy link
Owner

@fmeum fmeum commented Dec 20, 2024

When applying with_cfg to a rule with Bazel 8, it can be extended with a transition rather than being wrapped, which avoids a lot of dirty tricks needed to forward common attributes and providers.

This doesn't work with automatic reset yet as it would require returning two rules and a macro. In the future, this could be resolved by merging the transitioning alias into the extended rule and returning the macro first.

@fmeum fmeum force-pushed the rule-extension branch 5 times, most recently from bc18881 to 131e354 Compare December 20, 2024 12:21
@fmeum fmeum changed the title WIP: Use rule extension API Use rule(parent = ...) when possible Dec 20, 2024
@fmeum fmeum force-pushed the rule-extension branch 3 times, most recently from 90fa3be to 44c40e4 Compare December 20, 2024 12:39
@fmeum fmeum marked this pull request as ready for review December 20, 2024 13:19
@fmeum fmeum merged commit 5970101 into main Dec 20, 2024
14 checks passed
@fmeum fmeum deleted the rule-extension branch December 20, 2024 13:19
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.

1 participant