Replies: 7 comments 10 replies
-
cc @katre (his opinion counts for a lot) and @jin (because he is working on things that could benefit from something like this) |
Beta Was this translation helpful? Give feedback.
-
I've already sent this to @katre, and he listed a blurb in one of his docs (https://docs.google.com/document/d/1LD4uj1LJZa98C9ix3LhHntSENZe5KE854FNL5pxGNB4/edit?usp=sharing), but here is my take on it: https://docs.google.com/document/d/1OVagRkIArFv8N5fspUzhHrJ20od8zqWbOG51DTmuaD0/edit?usp=sharing |
Beta Was this translation helpful? Give feedback.
-
There was indeed such a document! I totally forget about that, I just opened this thread in my sudden enthusiasm. |
Beta Was this translation helpful? Give feedback.
-
Yes, @brentleyjones 's document is a great read. I'm writing up the results of the big Platform API requirements gathering process, but I'll go ahead and spoil the results now: the suggestion to change how we handle multiple values for |
Beta Was this translation helpful? Give feedback.
-
Ack. I'm all for choosing a few projects but doing them well and I can understand why you are reluctant to do it. If anything, I'd be more careful: the ramifications about BEP mean that even contributions would need to be carefully evaluated to make sure that they don't break BEP. @katre do you think it makes sense to keep this thread open or is the "Multiplatform builds proposal" a better canonical place for the discussion? |
Beta Was this translation helpful? Give feedback.
-
Ack, I'll hereby close this thread then. If any further discussion is needed, let's do it here: https://docs.google.com/document/d/1OVagRkIArFv8N5fspUzhHrJ20od8zqWbOG51DTmuaD0/edit |
Beta Was this translation helpful? Give feedback.
-
@brentleyjones what's the connection to the Apple rules? I thought that the way Apple rules work is that the top-level target is e.g. an |
Beta Was this translation helpful? Give feedback.
-
The command line option one uses to tell Bazel what platform to build for is called
--platforms
, in plural.This was done this way to keep the option open to have multiple top-level platforms; this way, that would not be an incompatible change, it would only make a use case that is currently an error (specifying multiple platforms) not an error anymore.
Is this a good direction to explore? On one hand, it's clearly useful to be able to build things for multiple platforms at the same time and to run tests on multiple platforms at the same time, but it does not come for free. The main difficulty I foresee is that the Build Event Protocol currently does not support multiple top-level targets with the same configuration and if it did, we'd have to teach not only Bazel to produce such BEP events, but also every consumer of the BEP to understand such data.
A very pedestrian way to work around the lack of multiple top level platforms is a custom Starlark rule with a split transition. This has a number of disadvantages:
But it's still a workaround.
Please chime in with your use case (if you have one) or with why do you think this is difficult, if not listed above!
Beta Was this translation helpful? Give feedback.
All reactions