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
buf build error on bazel external dependency #2851
Comments
You'll have to provide us a specific, reproducible example, and then we'd be happy to investigate. Let us know! |
@bufdev I'll given a minimum structure of our codebase, please help take a look, thanks WORKSPACE
a/BUILD
a/config.proto
b/BUILD
b/config.proto
|
What we're looking for:
If you can give us something that we can run ourselves, we're happy to look into it. |
@bufdev I put the above example in https://github.com/cyrilhuang/buf_example/tree/main, In this repo, we can build all proto files with bazel by running:
However, when running buf, build failed due to cannot find external files:
The mnissing file can be found in I'm wondering how to deal with external dependency not available on buf remote registry like riegeli, thanks. bazel version:7.1.1 |
We're using buf to do some protobuf breaking detections. Our repo is developing on bazel. Wewant to first
buf build
to generate image, then to compare reulsts based on image.In one of our proto_library, we depends on external dependency (which is not available on buf remote registry), and import that .proto file in our own code.
This proto definition can be found in
bazel-out/../../../external/riegeli
. bazel will call protoc -I to automatically fix compiling issue.However, under buf, we cannot add that include path to buf cli/buf.yaml. One official solution is that to use
buf.work.yaml
. However, in our repo, all proto files are on root, and.
is not allowed inbuf.work.yaml
, therefore creating abuf.yaml
in riegeli seems not possible here.example.proto:5:8:read riegeli/records/records_metadata.proto: file does not exist
One temporary solution is to copy that directory into our root directory, then call
buf build
will work. But I'm wondering what might be the official way to resolve it.buf version:
1.29.0
The text was updated successfully, but these errors were encountered: