Gazelle is a Bazel build file generator for Bazel projects. It natively supports Go and protobuf, and it may be extended to support new languages and custom rule sets.
Apache License 2.0
1.18k
stars
374
forks
source link
Error with Go protobuf imports when using Gazelle #1488
I then run bazel build proto:all and expect the go libraries to build successfully, but they do not.
What did you expect to see?
I expect the bazel build proto:all command to successfully build the go libraries.
What did you see instead?
Instead, I get an error stating that:
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
compilepkg: missing strict dependencies:
/private/var/tmp/_bazel_mohammednadeem/2fc3c21998c67019e72a996be754820f/sandbox/darwin-sandbox/581/execroot/__main__/bazel-out/darwin-fastbuild/bin/proto/user_service_go_proto_pb/github.com/abcd/userservice/proto/proto/user_service.pb.go: import of "github.com/abcd/user/proto"
No dependencies were provided.
Check that imports in Go sources match importpath attributes in deps.
I'm not really sure what's going on here. I've taken a look at issue#746, and it seems like what I have is correct but it's not correctly building.
What version of gazelle are you using?
v0.29.0
What version of rules_go are you using?
v0.37.0
What version of Bazel are you using?
bazel 6.1.1-homebrew
What operating system and processor architecture are you using?
Mac OS Monterey 12.4, 2.7 GHz Dual-Core Intel Core i5
What did you do?
I have a repository where I'm using gazelle and proto build rules. My repository is structured like this:
This is the
BUILD
file I have inside my proto folder:This is my
user.proto
file:And this is my
user_service.proto
file:I then run
bazel build proto:all
and expect the go libraries to build successfully, but they do not.What did you expect to see?
I expect the
bazel build proto:all
command to successfully build the go libraries.What did you see instead?
Instead, I get an error stating that:
I'm not really sure what's going on here. I've taken a look at issue#746, and it seems like what I have is correct but it's not correctly building.