Skip to content
This repository was archived by the owner on Apr 16, 2020. It is now read-only.
This repository was archived by the owner on Apr 16, 2020. It is now read-only.

Building multiple .proto files as clients together doesn't work #204

@hrydgard

Description

@hrydgard

This seems similar to #9, but when you compile multiple files together instead of having multiple services in one file.

Basically, I have first.proto:

package MyPackage;
service MyService
{
    rpc Compute(Inputs) returns (Outputs);
}

And second.proto:

package MyPackage;
service MySecondService
{
    rpc ComputeSecond(Inputs) returns (Outputs);
}

Trying to build them with a build.rs like this fails:

fn main() {
    println!("Compiling protos...");
    tower_grpc_build::Config::new()
        .enable_client(true)
        .build(&["proto/first.proto", "proto/second.proto"], &["proto/"])
        .unwrap_or_else(|e| panic!("protobuf compilation failed: {}", e));
}

The issue is that the generated code gets multiple "mod client" which really could be one without issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions