Skip to content

fix: Make grpc usable with C++#73

Draft
rustybee42 wants to merge 1 commit intomainfrom
rb/cpp-grpc
Draft

fix: Make grpc usable with C++#73
rustybee42 wants to merge 1 commit intomainfrom
rb/cpp-grpc

Conversation

@rustybee42
Copy link
Copy Markdown
Contributor

In the previous state, the generated C++ files were not really usable for gRPC. This commit fixes that:

  • Generate the gRPC service - before, only the message definitions were generated
  • Change the output directory to cpp/include/proto, so the include path can be set to cpp/include and header files can be imported like #include <proto/management.pb.h>
  • And, most impactful: Require a full gRPC installation under the set directory (~/.local/grpc) instead of just fetching the protoc binary.

It turns out that just downloading the protoc release is not enough for C++, it requires the full installation, including libraries and protoc plugin. It also requires the generators protobuf version to match the applications protobuf version, which is most easily achieved by just using the same installation. So, there is no point in downloading the protoc release anymore as a full installation is required anyway (which includes the correct protoc binary).

In the previous state, the generated C++ files were not really usable
for gRPC. This commit fixes that:

* Generate the gRPC service - before, only the message definitions were
generated
* Change the output directory to cpp/include/proto, so the include path
can be set to cpp/include and header files can be imported like
`#include <proto/management.pb.h>`
* And, most impactful: Require a full gRPC installation under the set
directory (~/.local/grpc) instead of just fetching the protoc binary.

It turns out that just downloading the protoc release is not enough for
C++, it requires the full installation, including libraries and protoc
plugin. It also requires the generators protobuf version to match the
applications protobuf version, which is most easily achieved by just
using the same installation. So, there is no point in downloading the
protoc release anymore as a full installation is required anyway (which
includes the correct protoc binary).
@rustybee42 rustybee42 self-assigned this Apr 24, 2026
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

Successfully merging this pull request may close these issues.

1 participant