-
Notifications
You must be signed in to change notification settings - Fork 387
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
go_repository: errors when protobuf imports don't match Go module root directory #897
Comments
So it looks like this particular proto imports This can be worked around by adding this to the
That directive is usually needed when protos are imported with some other prefix like It's hard for Gazelle to do something like this automatically, since So I'm not sure I see a clear way forward here. I've been thinking that |
Our workaround for now was to disable generating protos in third-party rules. We added 14 instances of |
I'm seeing something similar with https://github.com/kubernetes-sigs/controller-tools, I wonder if it's the same problem: All I did was clone that repo, create
|
@ob That doesn't look related to protos. Please open a new issue. |
@jayconrod sorry, my bad... I was going by the Issue title and error message. I should've read more carefully the issue to notice it was protobuf related. Filed #924. Thanks! |
What version of gazelle are you using?
0.22.0
What version of rules_go are you using?
0.24.1
What version of Bazel are you using?
3.5.0
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
Macos darwin x64
What did you do?
Copy the getting started instructions to an empty project https://github.com/bazelbuild/bazel-gazelle#running-gazelle-with-bazel
go.mod
containsgenerate go.deps following readme
bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=deps.bzl%go_dependencies
deps.bzl now has
Add the proto incantation to /WORKSPACE
now build the hashicorp/vault/sdk
bazel build @com_github_hashicorp_vault_sdk//...
What did you expect to see?
should build that thing
What did you see instead?
Observations:
That code has a proto import from
sdk/...
https://github.com/hashicorp/vault/blob/70497f67a5c073094a2d5fb42ab44c21a2a3f8e8/sdk/plugin/pb/backend.proto#L7
gazelle generates this:
this is wrong because we are in an external workspace
com_github_hashicorp_vault_sdk
so the dep should have been//logical:logical_proto
The text was updated successfully, but these errors were encountered: