Fix visibility for implicit deps of parent rules#28627
Fix visibility for implicit deps of parent rules#28627fmeum wants to merge 1 commit intobazelbuild:masterfrom
Conversation
|
@bazel-io fork 8.6.0 |
|
@bazel-io fork 9.0.1 |
|
@bazel-io fork 9.1.0 |
There was a problem hiding this comment.
Code Review
This pull request fixes a bug in visibility checking for implicit dependencies in extended Starlark rules. The change correctly identifies the original rule that introduced an attribute by traversing the inheritance hierarchy. This ensures that the visibility of a default value for an implicit dependency is checked against the package where it was defined, not where it was inherited. The implementation is clean and is accompanied by a thorough test case that validates the fix. The changes look good.
The visibility of a default value of an implicit dep in an extended rule should be checked relative to the definition of the rule that introduced it, which may not be the child rule.
e8b14fc to
3ee9c7e
Compare
brandjon
left a comment
There was a problem hiding this comment.
I wasn't aware people were actually using rule inheritance. The docstring lists it as experimental, though it's not flag guarded...
In any case, the PR looks ok.
The visibility of a default value of an implicit dep in an extended rule should be checked relative to the definition of the rule that introduced it, which may not be the child rule. Fixes bazelbuild#28618 Closes bazelbuild#28627. PiperOrigin-RevId: 871303947 Change-Id: I0027e277dc9f01396fa4674297d2a73e1e9d257e
The visibility of a default value of an implicit dep in an extended rule should be checked relative to the definition of the rule that introduced it, which may not be the child rule. Fixes bazelbuild#28618 Closes bazelbuild#28627. PiperOrigin-RevId: 871303947 Change-Id: I0027e277dc9f01396fa4674297d2a73e1e9d257e
…8688) The visibility of a default value of an implicit dep in an extended rule should be checked relative to the definition of the rule that introduced it, which may not be the child rule. Fixes #28618 Closes #28627. PiperOrigin-RevId: 871303947 Change-Id: I0027e277dc9f01396fa4674297d2a73e1e9d257e Commit a16489f Co-authored-by: Fabian Meumertzheim <[email protected]>
…8687) The visibility of a default value of an implicit dep in an extended rule should be checked relative to the definition of the rule that introduced it, which may not be the child rule. Fixes #28618 Closes #28627. PiperOrigin-RevId: 871303947 Change-Id: I0027e277dc9f01396fa4674297d2a73e1e9d257e Commit a16489f Co-authored-by: Fabian Meumertzheim <[email protected]>
|
@brandjon More people know about it because of @keith: https://www.smileykeith.com/2025/10/31/bazel-rule-extensions/ |
The visibility of a default value of an implicit dep in an extended rule should be checked relative to the definition of the rule that introduced it, which may not be the child rule. Fixes bazelbuild#28618 Closes bazelbuild#28627. PiperOrigin-RevId: 871303947 Change-Id: I0027e277dc9f01396fa4674297d2a73e1e9d257e
…hub.com/… (#28722) …/pull/28627) The visibility of a default value of an implicit dep in an extended rule should be checked relative to the definition of the rule that introduced it, which may not be the child rule. Fixes #28618 Closes #28627. PiperOrigin-RevId: 871303947 Change-Id: I0027e277dc9f01396fa4674297d2a73e1e9d257e <!-- Thank you for contributing to Bazel! Please read the contribution guidelines: https://bazel.build/contribute.html --> ### Description <!-- Please provide a brief summary of the changes in this PR. --> ### Motivation <!-- Why is this change important? Does it fix a specific bug or add a new feature? If this PR fixes an existing issue, please link it here (e.g. "Fixes #1234"). --> ### Build API Changes <!-- Does this PR affect the Build API? (e.g. Starlark API, providers, command-line flags, native rules) If yes, please answer the following: 1. Has this been discussed in a design doc or issue? (Please link it) 2. Is the change backward compatible? 3. If it's a breaking change, what is the migration plan? --> No ### Checklist - [ ] I have added tests for the new use cases (if any). - [ ] I have updated the documentation (if applicable). ### Release Notes <!-- If this is a new feature, please add 'RELNOTES[NEW]: <description>' here. If this is a breaking change, please add 'RELNOTES[INC]: <reason>' here. If this change should be mentioned in release notes, please add 'RELNOTES: <reason>' here. --> RELNOTES: None Commit a16489f --------- Co-authored-by: Fabian Meumertzheim <[email protected]>
The visibility of a default value of an implicit dep in an extended rule should be checked relative to the definition of the rule that introduced it, which may not be the child rule.
Fixes #28618