Skip to content
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

Protos that import "google/protobuf/any.proto" generate an extra empty file #724

Open
trevoranderson opened this issue Sep 15, 2022 · 2 comments

Comments

@trevoranderson
Copy link
Contributor

Example proto file:

syntax = "proto3";
import "google/protobuf/any.proto";

package blob;

// A config object containing a single config and its value
message TypedBlob {
  string key = 1;
  oneof val {
    bool bool_val = 3;
    int64 int_val = 4;
    string  string_val = 5;
    google.protobuf.Any proto_val = 6;
  }
}

Expected output: a blob.rs file using ::prost_types::Any.
Actual output: that + an additional empty file called google.protobuf.rs

I'm generating the protos and checking them into my source tree, not running as part of build.rs. It's not a problem correctness-wise, but slightly annoying to have the clutter of empty files. Is there a workaround for this? I experimented with extern_path but that did not seem to matter.

@LucioFranco
Copy link
Member

Yeah, its a known issue, #228 tried to fix it but I had to revert the fix PR since it broke many other layers for some reason. If you have the time feel free to take a crack at a it.

@trevoranderson
Copy link
Contributor Author

@LucioFranco Made an attempt. I'm not overly familiar with the project so definitely open to feedback from someone who knows more, but it seemed to fix the issues I was having as well as preventing the issue of the previous fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants