I’m using a company repo that has our standard protobuffers in it. It does not include any build information and I can’t modify the repo (though I’m going to inquire about that). I have the protobuffer repo as a submodule in my git repo. The arrangement looks like this:
main/java
main/protos
main/protos/BUILD
main/protos/submodule
main/protos/submodule/dirA/
main/protos/submodule/dirA/protobuffer_root
Within my BUILD
file I have proto_library
rules that reference the submodule files which works fine except when the proto files have imports.
import "protobuffer_root/other_file.proto"
Because the protobuffers are rooted at submodule/dirA
the imports are failing. I need to set the path, --proto_path=./dirA/
for protoc
. I’ve tried passing it as arguments and after the build command, but it isn’t having any effect.
How do I set the proto path when building protobuffer targets in bazel?