Design review for Standard Platform Transitions #18628
Replies: 8 comments 34 replies
-
I would say no. Mostly because tools don't handle complex structures in BUILD files very well. It also just doesn't look idiomatic (usually BUILD files are a bunch of target definitions, and then they're wired together using their string names). Also, in the example, the inline call doesn't have a |
Beta Was this translation helpful? Give feedback.
-
How is this going to interact with configurable attributes, when there is a |
Beta Was this translation helpful? Give feedback.
-
If I read this correctly, this proposal is a generalization of what we have in rules_go today. Given a go_binary(
name = "a",
srcs = ["a.go"],
) you could create neighbor target that transition to a specific platform go_binary(
name = "a",
srcs = ["a.go"],
)
go_binary(
name = "a_m1",
srcs = ["a.go"],
goos = "darwin",
goarch = "arm64",
) And this proposal would help us simplify the rules a bit by providing Additionally, It's still unclear to me though, how much we would be able to simplify https://github.com/bazelbuild/rules_go/blob/master/go/private/rules/transition.bzl as most of our cc: @fmeum @illicitonion who have both work on these code paths |
Beta Was this translation helpful? Give feedback.
-
Acknowledged as reviewer. I'll have to do deeper passes and think this through more (especially regarding fitting with all our other API ideas). A few quick comments for now:
|
Beta Was this translation helpful? Give feedback.
-
exec_binary is specific to binaries (including tests) but not limited to
exec mode. It can (and is) also be used for target mode tests.
Re: platform selection. By default, it picks a configuration which is
compatible with the current platform. For example, it could change the CPU.
But when it does so implicitly relies on the assumption on all machines
where the binary may be executed.. "if it supports old CPU it also supports
new CPU".
One thing to watch out... Initially it was an "alias with a transition" but
that breaks many use cases. A binary "//pkg:bin" results in a file named
"pkg/bin" in the runfiles tree. So we changed to using "native_binary"
(which just pretends that a file is a binary).
…On Tue, Jun 13, 2023, 6:25 AM John Cater ***@***.***> wrote:
@brentleyjones <https://github.com/brentleyjones> I agree with you that
projects should define their own platforms, but I've seen some
(google-internal) uses with a hard-coded platform for projects that have
custom rules and also define their own platforms, so this seems like an
easy enough use case to support.
—
Reply to this email directly, view it on GitHub
<#18628 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKHEQOPJJZH545JKMSEUOMDXLBS5PANCNFSM6AAAAAAZA64QZQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
After talking with @gregestren and looking at my calendar, I'm going to pause the discussion on this proposal: @gregestren has a related proposal to finish up and I will be out of the country for most of July. I'd like to pick this back up when I'm back in the last week of July. |
Beta Was this translation helpful? Give feedback.
-
I think this is a good idea if there's the need for But as of this moment we don't need to do either. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the comments, everyone! Now that this is accepted, I am locking the discussion to keep it archived, but feel free to reach out or file further feature requests if needed. |
Beta Was this translation helpful? Give feedback.
-
Hi, I've uploaded a new design proposal, Standard Platform Transitions. The goal is to define a standard set of rules and transitions in the @platforms repository, which rule authors and users can make use of, without needing changes to Bazel itself.
Please take a look and let me know if you have any comments or criticisms.
Reviewer: @gregestren
Beta Was this translation helpful? Give feedback.
All reactions