-
-
Notifications
You must be signed in to change notification settings - Fork 669
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
gopackagesdriver skips protobuf well known types #3239
Comments
I have the feeling that making this explicit in BUILD files via gazelle is the more sensible approach. Could you open an issue over at bazel-gazelle so that the proper folks are made aware of this? |
For reference it seems like gazelle stopped adding these dependencies because different proto compiler plugins have different targets for the well known types, and they didn't want to add that logic to gazelle. |
Well, that reasoning is pretty sound. Let me do a 180 here and say that I now prefer extending the aspect. Thanks for the pointer! @achew22 What do you think? |
I think @ribrdb is correct that it caused some trouble with the proto compiler plugins. It might be better to enhance the aspect here to read the list of force included dependencies and force excluded deps. This just feels like a bug/missing feature in gopackagesdriver |
@ribrdb I could work on this, but I can't reproduce it. With your proto, Gazelle generates the following BUILD file for me:
This already has the relevant proto listed as an explicit dependency. Which compiler are you using? |
It's listed as a dependency on the proto_library, but the go_proto_library doesn't have any deps.
It will not generate bazel-bin/external/org_golang_google_protobuf/types/known/wrapperspb/wrapperspb.pkg.json even though the generated go files import google.golang.org/protobuf/types/known/wrapperspb. Add an explicit |
Yes that seems to fix it. Thanks! |
When using gopackagesdriver, protobufs mostly work. But any field using one of google's well known types shows up as an error in the editor.
I noticed that the .pkg.json file isn't getting generated for @org_golang_google_protobuf//types/known/wrapperspb
I believe this dependency comes from the deps of the go_proto_compiler used. So I tried adding "compiler" and "compilers" to the go_pkg_info_aspect attr_aspects, but this didn't make any difference.
If I manually add "@org_golang_google_protobuf//types/known/wrapperspb" as a dep of my go_proto_library it will work, but then gazelle will remove this. Can we either get gazelle to add these implicit deps or get the aspect to understand them?
The text was updated successfully, but these errors were encountered: