-
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
Adding a cc_library
to the constraint_values
of a platform
causes a crash
#22996
Comments
I realized I never described what the expected behavior is. I would have hoped Bazel would print an error message like, "The |
Reproduced the failure, investigating now. |
The actual cause of this is fairly basic: any target with the standard definition of Possible fixes:
|
I was initially surprised that there isn't an earlier error: However, after a lot (a lot) of code tracing, it looks like this is checked too late:
A fix would be to check for mandatory providers much earlier, before dependencies are computed (and so based only on advertised providers, not actual providers). I'm not sure this is easy to do, and I'm not sure what else we'd break if we added it. |
The summary here is that we can avoid the crash but I'm not sure we can give a reasonable error message without some work. |
https://bazel-review.googlesource.com/c/bazel/+/254333 applies fix #1 from #22996 (comment). Does that help? |
It will stop the crash, doesn't help report a better error. |
To summarize: there are really two issues here. Bazel CrashWhen the
I'd like @gregestren's opinion on which of these are cleaner: I am leaning towards number 2 personally. Invalid dependencies in
|
Yes, this all makes sense. Could you cc me on the separate better-error issue? Thank you for digging into this! I didn't expect it would prove such a rabbit hole, but I'm glad we uncovered these issues (the |
…on path. Also fix incompatible flags that need to have values preserved. Part of #22996. PiperOrigin-RevId: 654704954 Change-Id: I90902a5a8df232f5b8e2d79904cb21553a14877d
Part of #22996. PiperOrigin-RevId: 654859209 Change-Id: I865c086c0b1433ce51caa156d160d35e6d1f982d
Currently this is only usable within the builtin rules. This is intended to reduce the complexity of the StarlarkDefinedConfigTransition, by making it easier to tell if a transition has the extra capabilities of the exec transition. Work towards composable starlark transitions: #22248. Also part of fixing #22996. PiperOrigin-RevId: 654886740 Change-Id: I1d5292bc2e5e8646e5563f0a2cd3afd9b2157659
…tion. Needed for the execution transition factory. Part of #22996. PiperOrigin-RevId: 656477022 Change-Id: Id7f9702bc4767aff330b7990afc793dca593445a
Part of #22996. PiperOrigin-RevId: 656502048 Change-Id: Ib56cd9374c7d2cc964689c3029c865b294247da8
Description of the bug:
On Bazel 8.0.0-pre.20240618.2, adding a
cc_library
to theconstraint_values
of aplatform
causes Bazel to crash with an unhelpful error message:@katre
Which category does this issue belong to?
Configurability
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Minimal example: https://github.com/tpudlik/constraint_value_crash.
Which operating system are you running Bazel on?
Linux
What is the output of
bazel info release
?release 8.0.0-pre.20240618.2
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?No response
If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
Kind of? On Bazel 7.2.1 I get an error instead of a crash:
This error is not especially informative, but at least it suggests the problem is with the
platform
, somehow.Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: