grpc / grpc/grpc-rust

Two files with same package name overwrite each other.

Open
#1,415 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
12.5k
Forks
1.3k
Avg merge
4d 7h
Merged PRs (30d)
24

Description

## Bug Report
If I have two proto files, one called `helloworld_types.proto` and another `helloworld_service.proto`, with both having `package helloworld;` defined in both files, compiling protos to rust results in overwriting one of the files.
```
compile_protos(helloworld_types.proto)
compile_protos(helloworld_service.proto)
```
In the above case, the generated file/mod will be `helloworld.rs` as per the package name. However, I will only see the contents of `helloworld_service.proto` in this generated rust file. This is because it generates `helloworld.rs` for the `helloworld_types.proto` and then completely overwrites that when compiling `helloworld_service.proto`.

tldr; creating two proto files with same package name results in overwriting behavior.

### Version

0.9.2

### Platform
linux fedora

### Crates

tonic-build? tonic?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.