-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Incompatible targets with selects on a label flag config produce spurious "is not a valid select() condition" errors, are not skipped #23003
Comments
This is intended as a workaround for bazelbuild/bazel#23003 only, and will be deleted soon. Do not depend on any targets introduced in this CL from outside Pigweed! I verified that with this change and updates to `target_compatible_with`, http://pwrev.dev/221036 doesn't get any Bazel-level errors. (It still doesn't build, but the errors I get come from the C++ compiler, not Bazel---something about missing headers.) Bug: 352808542 Change-Id: I645f2e8b56691d080b661a9d8e4021b1346ae375 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/222812 Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com> Pigweed-Auto-Submit: Ted Pudlik <tpudlik@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com> Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Rob Mohr <mohrr@google.com>
@katre FYI |
Also @gregestren and @AustinSchuh |
Weird. It's got to be something with I'll dig in and diagnose. |
@aranguyen is looking now. |
This is intended as a workaround for bazelbuild/bazel#23003 only, and will be deleted soon. Do not depend on any targets introduced in this CL from outside Pigweed! I verified that with this change and updates to `target_compatible_with`, http://pwrev.dev/221036 doesn't get any Bazel-level errors. (It still doesn't build, but the errors I get come from the C++ compiler, not Bazel---something about missing headers.) Original-Bug: 352808542 Original-Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/222812 Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com> https://pigweed.googlesource.com/pigweed/pigweed pigweed, pw_toolchain Rolled-Commits: e15bd2067e7a244..990ed9bb2f16bec Roller-URL: https://ci.chromium.org/b/8742574672140296577 GitWatcher: ignore CQ-Do-Not-Cancel-Tryjobs: true Change-Id: I531f21e6c3204955c91359c430c0ad49c124e1e0 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/quickstart/bazel/+/222643 Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com> Bot-Commit: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com> Commit-Queue: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com>
Hi all, the error is being thrown here due to null ConfigMatchingProvider from The For immediate usage, please use |
Description of the bug:
A target with a
select
statement referencing aconfig_setting
based on alabel_flag
will not be correctly detected as incompatible with the target platform. Instead, you get the message<config setting> is not a valid select() condition for //:library_with_select
.This is particularly severe because it breaks incompatible target skipping. Instead of skipping the incompatible target, Bazel prints the error message above.
This bug is a little hard to understand based on this description, but it's easy to reproduce. See https://github.com/tpudlik/not_a_valid_select for a simple
BUILD.bazel
file and repro steps.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.
https://github.com/tpudlik/not_a_valid_select
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.
I don't believe this ever worked. I get the same error on Bazel 7.2.1, too.
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
This bug may sound a little academic, but it's not! We've run into this in a real project (http://pwrev.dev/221036).
The text was updated successfully, but these errors were encountered: