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 design draft for platform inheritance #37

Merged
merged 3 commits into from
Oct 10, 2018
Merged

Add design draft for platform inheritance #37

merged 3 commits into from
Oct 10, 2018

Conversation

katre
Copy link
Member

@katre katre commented Oct 9, 2018

Related to bazelbuild/bazel#6218.

@katre katre requested a review from gregestren October 9, 2018 16:06
@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

Copy link
Contributor

@gregestren gregestren left a comment

Choose a reason for hiding this comment

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

Doing meta-review (i.e. reviewing the doc but not the substance of the proposal) as I understand is requested here:

Should/can we include a link to design review discussion? Or do we expect that all to happen in a GitHub review?


Currently, platforms in Bazel (declared with the [`platform` rule](https://docs.bazel.build/versions/master/be/platform.html#platform) do not have any form of inheritance. If users want to declare a platform that is semantically "other platform, with added constraint", they have to copy and paste the constraint values from the first platform to the second, and keep them in sync manually.

This would be useful for the execution platforms defined by remote execution systems, which are frequently a small set of base platforms, and then additional platforms which take the base and add extra capabilities, such as network access or extra memory. See the GitHub issue at: https://github.com/bazelbuild/bazel/issues/6218.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Clarify "This"? The current wording implies to me "currently users have to do annoying thing X. X would be useful..."

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.

```


In this example, the `extend` platform will have the constraint values `:banana` (inherited from the parent platform`) and `:clubs` (which overrides the constraint `:heart` set on 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.

Formatting: looks like the ` past "platform" is messing with the formatting of following words?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

This would be useful for the execution platforms defined by remote execution systems, which are frequently a small set of base platforms, and then additional platforms which take the base and add extra capabilities, such as network access or extra memory. See the GitHub issue at: https://github.com/bazelbuild/bazel/issues/6218.


# Proposal
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional suggestion: even though in this design it's small, I might keep the Proposal section just this top paragraph plus an API spec making it clear how the functionality is declared (i.e. with a proposed parent attribute, maybe using our standard API format?) Then shift the example into an Example section.

Again, I get in this proposal the distinction is tiny. But in general I think it's nice to be as explicit and formal about API changes as we're able.

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense, done.


## Remote Execution Properties

The `remote\_execution\_properties` attribute of a platform also needs to be inherited from the parent, but the merging behavior is slightly more complicated because the attribute is a single string.
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the \ formatting isn't rendering correctly here and below.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also hyperlink the attribute?

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.

@googlebot
Copy link

CLAs look good, thanks!

@katre
Copy link
Member Author

katre commented Oct 10, 2018

Fixed the formatting issues.

I haven't sent this to the list for review yet (according to https://bazel.build/designs/index.html#announce-the-new-proposal that happens after this is merged). When I do I will update this with the link and also change the status to "In Review".

@katre katre merged commit d1bcf06 into bazelbuild:master Oct 10, 2018
@katre katre deleted the platform-inheritance branch October 10, 2018 19:52
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.

3 participants