-
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
Uninformative error message with invalid select
key
#17689
Comments
cc @katre |
For the record, to figure out what was wrong initially, I had to build my own Bazel and insert a line in |
We have a long history of analysis errors not always propagating cleanly. I can't tell offhand if this is specifically about Either way, good point. Agreed on the bad messaging. |
Probed a little bit. I wonder if we need to propagate the lookup error from bazel/src/main/java/com/google/devtools/build/lib/skyframe/PrerequisiteProducer.java Lines 529 to 532 in 0e6cc07
|
If a key in a `select` references a package that does not exist, the error message now includes a reference to the target with the `select`: ``` ERROR: no such package 'hello/c': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package. - /tmp/bazel-crash/hello/c ERROR: /tmp/bazel-crash/hello/b/BUILD:1:13: errors encountered resolving select() keys for //hello/b:b ERROR: Analysis of target '//hello/a:a' failed; build aborted ``` Previously, it didn't: ``` ERROR: Analysis of target '//hello/a:a' failed; build aborted: no such package 'hello/c': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package. - /tmp/bazel-crash/hello/c ``` Fixes bazelbuild#17689 Closes bazelbuild#18454. PiperOrigin-RevId: 533635167 Change-Id: I714b1c1c539d9dfb76dea9b6f1899bb98ae558dd
Description of the bug:
The error message Bazel displays when a target uses an invalid
select
key is very uninformative. In particular, it doesn't tell you where the offending usage occurs.What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
When you run
bazel build :a
, you get the following error message (and nothing else):It doesn't tell you that
//c
is being referred to from the fileb/BUILD
. If:a
has lots of deps, it's nigh impossible to figure out what's wrong.Which operating system are you running Bazel on?
macOS
What is the output of
bazel info release
?release 6.1.0
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 master; git rev-parse HEAD
?No response
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: