-
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
proto_library: warning: directory does not exist #7157
Comments
@lberki I wonder if this is related to recent source root changes? |
Friendly ping. This still happens in 0.22.0. |
Hi, |
Small ping, still happening in 0.25.3 |
Ping again, this is extremely annoying and spammy. |
Update: I have a change under review that will fix this issue. Let's see how the review goes. It's not complicated, so it shouldn't be problematic. |
...and apologies for the delay. I know it was very annoying (in fact, the reason why I fixed it was because it annoyed me! :) ) |
Well, that was optimistic: The change will have to be rolled back. I'll take a look the next time I have some spare time. |
Ugh. This is awful. Hear me out. This warning messages happen when all the source files of a Of course, we have to cut off different parts depending on whether the proto file is source or generated, but that we determine by... guesswork in That algorithm broke when we removed the directory from the set of proto paths. The reason why only Go broke is that this line trying to cater for legacy use cases saves us, but I don't want to rely on it: , but So that change was indeed wrong. Now, the question is, how to make it right -- eliminating the warning requires that we remove a repository root from the set of proto paths if there are only generated files, but if we remove it, the algorithm to generate Furthermore, it's not trivial to decouple A saving grace is that However, it's far from a trivial change :( |
Shouldn't we remove |
This is not about the attribute, but the eponymous field of |
Yup, what I'm asking is if the field makes sense when the attribute is gone. |
It does. That field tells what the effective proto source root is. That's a concept that makes sense even when the attribute will be gone. |
So, I got a bit nerd sniped and I have another solution: simply create a virtual proto import directory when the Granted, it's not that simple because we still need to make sure that our internal repository keeps chugging along, but I'd gladly fork the behavior of That's still not a tiny amount of work and it is still possible that some odd downstream project breaks, but this is certainly much simpler than the previous alternative. And it doesn't even require lying to Starlark! |
…here are no .proto sources in it. This prevents protoc from complaining about a nonexistent directory in sandboxed mode and is good hygiene in any case. Fixes bazelbuild#7157. RELNOTES: None. PiperOrigin-RevId: 256208923
*** Reason for rollback *** Breaks Bazel downstream: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1067#24a01f98-1ed2-4423-8d94-bf11cef557e4 *** Original change description *** Do not add a --proto_path argument to the proto compiler invocation there are no .proto sources in it. This prevents protoc from complaining about a nonexistent directory in sandboxed mode and is good hygiene in any case. Fixes bazelbuild#7157. RELNOTES: None. PiperOrigin-RevId: 256338118
Update: I have another fix. Learning from the previous one, I have to run in through all sorts of presubmits to make sure that it doesn't break anything. It introduces a slight incompatibility which I hope no one relies on, but there is only one way to be sure... If that still doesn't work, I have another option (not generating virtual import directories for rules with |
Update: collateral damage is minimal. Unfortunately, it includes I'll send out changes to both then try to submit this. |
@lberki no worries, thank you for the update |
Is this ... dead? |
@lberki Can we reopen this? It's still occurring in the latest version of Bazel, right? |
Can confirm the error still exists in Bazel 3.x.x |
it would be great if this was fixed (and i guess the bug reopened) we would like to make warnings into errors to prevent other proto generation issues, but i think these warnings make that not possible |
I'm still having this problem as well. |
The reproduction on this bug is ancient. I've tried reproduction with Bazel 5.0.0 and bzlmod: MODULE.bazel
Command line:
and I get no warnings. Can somebody please provide a reproducer on Bazel 5.0.0? Or at least add a message to the thread with Bazel versions and protobuf versions where this occurs. |
we are seeing this with bazel== |
I tried with bazel 4.2.1, protobuf 3.19.2 and 3.19.3; no success reproducing. Something else is missing that's causing this. WORKSPACE
Command line:
|
We in this case is Envoy (https://github.com/envoyproxy/envoy). I've sent more detailed information internally for repro since the OSS instructions need some additions to build in-google, but our CI logs show it's still definitely a problem for our project and we're super happy to help you folks reproduce |
hmm - grepping (envoyproxy/envoy) repo seems to suggest that we dont load ill, add PR and try and check... |
I see the warning here https://buildkite.com/bazel/envoy/builds/1811#0c20714c-e748-4c19-a6a5-844e9b4a0e70 |
loading the protobuf deps doesnt seem to have hurt, but doesnt get rid of the messages |
The problem was created by Correct issue is reported here: protocolbuffers/protobuf#6049 I'm closing this issue, because I didn't discover any warnings produced by the rules that are part of Bazel. |
after being resolved for some time this has issue has returned (bazel: 6.1, protobuf: 23.1) tbh it seems more related to the protobuf version but the previous ticket in protobuf suggested it was a bazel issue |
Yeah, this is happening for me as well with Bazel 7 and Protobuf 23.1. Maybe this issue could be reopened? Or should we file a new issue? |
Description of the problem / feature request:
Building
proto_library
targets for Well Known Types in@com_google_protobuf
emits warnings like the one below. The build succeeds, but it would be nice if the warning can be fixed or removed.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
What operating system are you running Bazel on?
Linux amd64
What's the output of
bazel info release
?release 0.21.0
This does not happen in 0.20.0, but it does happen in 0.22.0rc2.
The text was updated successfully, but these errors were encountered: