-
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
Misleading error message when glob expands to empty list of files #1507
Comments
Good idea. |
If you want a PR I'd be happy to give it a try given a pointer to the relevant place. |
Thanks! Should just be adding another |
So you're talking about changing the implementation and not the error message, right? |
I think you'd need to add the |
ok, will handle it from here. |
This will change with #8195 In the future, the glob function will fail if the pattern doesn't match anything. This will help you find the bug quickly in this case (the attribute |
I moved a test target from the root of my project to a sub package and forgot to update the glob expression of my sources (was
glob(["src/test/java/com/example/*.java"])
and should have been changed toglob(["*.java"])
after the move).When I ran the build I got an error message which IMHO is somewhat misleading.
The error message says that
deps
is not allowed withoutsrcs
and suggests to move them toruntime_deps
. Only after a bit of digging I realized that the glob expanded to an empty list and so Bazel thinks I did not declare any sources. Problem is that when you "statically" look at the target you see thatsrcs
is defined.WDYT about adding to the error message something which says that maybe the
srcs
is defined but is actually empty?The text was updated successfully, but these errors were encountered: