-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add the parents attribute to the platform rule. #6486
Conversation
Fixes bazelbuild#6218. Change-Id: I7dcf430fbcf745654058113cf68df18a88e44c94
|
||
if (parentPlatforms.size() > 1) { | ||
throw ruleContext.throwWithAttributeError( | ||
PlatformRule.PARENTS_PLATFORM_ATTR, "parents attribute must have a single value"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional nit: replace "parents" with PlatformRule.PARENTS_PLATFORM_ATTR to further consolidate the source of truth?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
/* <!-- #BLAZE_RULE(platform).ATTRIBUTE(parents) --> | ||
The label of a <code>platform</code> target that this platform should inherit from. Although | ||
the attribute takes a list, there should be no more than one platform present. Any | ||
constraint_settings not set directly on this platform will be found in the parent platform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we have API reference to the precise semantics? (what happens if both platforms define the constraint_setting, {PARENT_REMOTE_EXECUTION_PROPERTIES}, etc)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the API reference, I can add more detail if anything is unclear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the sake of precision, can we clarify that the child value overrides the parent value if both are set (even if that's intuitive anyway)? Is it worth mentioning the use of {PARENT_REMOTE_EXECUTION_PROPERTIES} here?
This seems like the right place o be pedantically detailed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added more documentation, adding @spomorski for docs review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
/* <!-- #BLAZE_RULE(platform).ATTRIBUTE(parents) --> | ||
The label of a <code>platform</code> target that this platform should inherit from. Although | ||
the attribute takes a list, there should be no more than one platform present. Any | ||
constraint_settings not set directly on this platform will be found in the parent platform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Fixes #6218.