Skip to content

c++: gRPC service descriptors are missing if the source proto has no messages defined #4221

@kyessenov

Description

@kyessenov

It seems that if my protobuf file consists of a single service, and I link against the resulting .pb.h then the service descriptor is missing from the generated descriptor pool. For context, this is happening in Envoy (https://github.com/envoyproxy/envoy/blob/master/source/common/upstream/cds_api_impl.cc#L40) using Bazel to generate protobuf files.

The workaround is to (1) add a dummy message to the service proto; (2) instantiate the dummy message from the resulting .pb.h file.

cc @htuch

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions