-
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
Crash when defining a Starlark transition involving platforms #8936
Comments
I think the simplest immediate fix to get your code working is to change
to
That got it working for me. This also works:
The most working version of split transitions today is going to be But obviously Bazel shouldn't crash. I'll prioritize a fix to stop that. As for the typing, I think the core Starlark folks were hesitant to add too many types to the |
cc/ @bazelbuild/configurability |
Lots more context at bazel/src/main/java/com/google/devtools/build/lib/analysis/skylark/FunctionTransitionUtil.java Line 272 in ca48e9a
I recognize that bug isn't fully visible to all - ping me if you'd like to hear more details. tl;dr; is I might have a way forward on this that doesn't just fix the crash but (maybe?) resolves the subtleties described above. |
This was a faux ping. I was trying to see if team assignment worked. This
was a convenient issue to test on.
…On Thu, Apr 23, 2020 at 4:22 PM Greg ***@***.***> wrote:
Lots more context at
https://github.com/bazelbuild/bazel/blob/ca48e9ac4ddae455e816fb0bd3895f572d149d56/src/main/java/com/google/devtools/build/lib/analysis/skylark/FunctionTransitionUtil.java#L272
I recognize that bug isn't fully visible to all - ping me if you'd like to
hear more details.
tl;dr; is I might have a way forward on this that doesn't just fix the
crash but (maybe?) resolves the subtleties described above.
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#8936 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXHHHHZ3DVQ5GEIDAUDBV3ROCPORANCNFSM4IFFUUBA>
.
|
Still a worthy ping, especially given its priority and length of time sitting around. :) |
This is by no means a complete solution. We have a real challenge here in that list-typed native options traditionally (before Starlark configuation) can only take strings at the command-line. So their converters expect inputs to be raw strings. Now with SBC the values can be actual lists of Starlark objects. Those lists may or may not type-match the option type. Because of the "string inputs only" expectations, there's no easy way for the converters to check this. Before this change, this could produce crashes (see GitHub bug) because Blaze saw this as a list-typed option assigned to a list value, but didn't check that the element type doesn't match (expected Label, actual string). This change improves the situation, but only partially, and not for allowMultiple options. See new code comments for details. Fixes bazelbuild/bazel#8936. PiperOrigin-RevId: 308284734
I'm trying to create a Starlark split transition that changes the current platform based on a flag. Code:
The result is a big ugly crash. The relevant part of the stack trace is:
The text was updated successfully, but these errors were encountered: