bazelbuild / bazelbuild/rules_rust
Unable to generate proto bindings for proto files with the same name
- Dominant language
- Starlark
- Stars
- 843
- Forks
- 651
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 15
Description
Hi, thanks for this project, I'm very excited at the prospect of building rust with Bazel!
I ran into the following problem.
When trying to generate proto bindings in a project, where there exists more than one file with the same name (in a different package), I get the following error:
Generating Rust protobuf stubs failed (Exit 1) protoc failed: error executing command
(cd //execroot/ && \
exec env - \
Execution platform: @bazel_tools//platforms:host_platform
Use --sandbox_debug to see verbose messages from the sandbox: protoc failed: error executing command
(cd //execroot/ && \
exec env - \
Execution platform: @bazel_tools//platforms:host_platform
Use --sandbox_debug to see verbose messages from the sandbox
.rs: Tried to write the same file twice.
It seems that the protoc rust plugin generates all files directly in the folder of the first output, regardless of the proto package, then when trying to write to the same file twice protoc throws an error.
This becomes increasingly hard to deal with if `com.example.a/example.proto` depends on `com.example.b/example.proto` since `com.example.b/example.proto` is included in the protoc command as an output (and is thus always generated for `com.example.a/example.proto`).
I am not very familiar with this project and rust protobuf so I don't know if I'm in the correct repository for the issue.
Contributor guide
Assessment
This issue has not been assessed yet.