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

Add the parents attribute to the platform rule. #6486

Closed
wants to merge 3 commits into from

Conversation

katre
Copy link
Member

@katre katre commented Oct 23, 2018

Fixes #6218.

Fixes bazelbuild#6218.

Change-Id: I7dcf430fbcf745654058113cf68df18a88e44c94
@katre katre requested a review from gregestren October 23, 2018 19:58
@katre katre requested a review from lberki as a code owner October 23, 2018 19:58

if (parentPlatforms.size() > 1) {
throw ruleContext.throwWithAttributeError(
PlatformRule.PARENTS_PLATFORM_ATTR, "parents attribute must have a single value");
Copy link
Contributor

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?

Copy link
Member Author

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.
Copy link
Contributor

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)?

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks great!

@katre katre requested a review from tualeron October 25, 2018 15:24
/* <!-- #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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks great!

@bazel-io bazel-io closed this in a1df962 Oct 29, 2018
@katre katre deleted the pi-03-platform-rule branch October 31, 2018 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants