Questions tagged [protoc]

protoc is the compiler for .proto files. It generates language bindings for the messages and/or RPC services from .proto files. protoc is a native executable, the scripts under this directory build and publish a protoc executable (a.k.a. artifact) to Maven repositories. The artifact can be used by build automation tools so that users would not need to compile and install protoc for their systems.

taken from google documentation

387 questions
7
votes
3 answers

Compilation error in compiling Protobufs in Java using SBT build tool

I am using the Play framework (which uses SBT build tool) with Java where I need to consume a Protobuf. So I have xxx.proto file. I got binary protoc compiler and added to class path. so I see - protoc --version libprotoc 3.1.0 I have compiled the…
Richa Gupta
  • 143
  • 3
  • 10
6
votes
0 answers

Decoding managed protocol buffer datastore/firestore export by google with protoc

I think I'm really close or either I don't understand what I'm doing... We use Firestore inside a project and I am writing a custom script to export all the data. But there is an option to export it via gcloud CLI. Which is great, but the data…
6
votes
3 answers

How to substitute the extension for a cmake list of filenames

I am trying to build a c++ library from some protobuf definitions using cmake. I added a custom command to compile the proto to c++, but I have some issues with the output part. I need to specify which are the expected output files after protoc does…
codentary
  • 993
  • 1
  • 14
  • 33
6
votes
1 answer

How can I use google.protobuf.Timestamp with protoc-jar-maven-plugin?

I've been trying to use the protobuf type google.protobuf.Timestamp with the protoc-jar-maven-plugin but only get these compile time errors: google/protobuf/timestamp.proto: File not found. test.proto: Import "google/protobuf/timestamp.proto" was…
Erik Finnman
  • 1,459
  • 18
  • 25
6
votes
1 answer

Compile protobuf to use primitive classes instead of well-known types

Lets say I have test.proto file: syntax = "proto3"; option java_package = "testing"; option java_outer_classname = "Test_v1"; import "google/protobuf/wrappers.proto"; message TestMessage { .google.protobuf.Int32Value integerField = 1; } If I…
Renatas M.
  • 11,694
  • 1
  • 43
  • 62
6
votes
1 answer

Protocal buffers aren't generating service stubs

I'm having some trouble generating stubs from my .proto file in GRPC. Here's what the .proto file looks like `syntax = "proto3";` // The greeting service definition. service Greeter { // Sends a greeting rpc SayHello (HelloRequest) returns…
user6088291
6
votes
2 answers

Dynamic parsing of .proto text file at runtime to generate descriptors

I am currently working on Google Protocol Buffers and need to generate dynamic messages. I already have my .proto files defined as shown below. message TSInbound { string id = 1; map state = 2; map reading…
Ankita
  • 2,798
  • 4
  • 18
  • 25
5
votes
3 answers

How to run grpc-gateway for python

I am grpc rookie and wanted to create a REST endpoint for health check of the grpc server. For this I decided to use grpc gateway. However, the example in docs for grpc-REST gateway for proxying grpc to json are only given for Golang. But I have a…
Shivansh Jagga
  • 1,541
  • 1
  • 15
  • 24
5
votes
0 answers

Is there a way to make generated enum implement a custom interface in Protobuf v3?

I would like to have the generated enum in Proto3 implement a custom pre-existing interface, as follows: public enum GeneratedProtoEnum implements CustomInterface, com.google.protobuf.ProtocolMessageEnum { // ... } (by default, enum…
5
votes
0 answers

Can protoc or any tool do JSON-protobuf conversion?

Protobuf is in binary format, and it has also equivalent text format and JSON format. protoc has --encode and --decode option to do text-binary conversion. But is there a small tool to do JSON-binary conversion? like below: tool --encode input.json…
Wei Huang
  • 590
  • 1
  • 5
  • 18
5
votes
1 answer

Protobuf Build Protoc select all .proto files in a directory

I have the following .sh file that I run to build my protos. mkdir -p ./src/gen protoc -I=../protos/ \ ../protos/common/*.proto \ ../protos/service/protos/*.proto …
Barry Michael Doyle
  • 9,333
  • 30
  • 83
  • 143
5
votes
0 answers

Importing .proto files from a maven dependency?

Here's my protoc jar plugin - com.github.os72 protoc-jar-maven-plugin ${protoc-maven-plugin.version}
Righto
  • 855
  • 3
  • 11
  • 32
5
votes
1 answer

unrecognized syntax identifier "proto3". This parser only recognizes "proto2" on Linkerd

I have cloned linkerd (https://github.com/linkerd) repo on my linux ubuntu, and installed protoc, version 2.5. When I try to compile the linkerd using the following command I get the error "unrecognized syntax identifier "proto3". This parser only…
zillani
  • 1,070
  • 3
  • 18
  • 26
5
votes
1 answer

How to write a custom Protobuf CodeGenerator in Java

I'm trying to write a custom code generator for an in-house proprietary programming language. I figured I could write the generator in Java, using the protoc plugin guide. My main() does something like this: public static void main(String[] args)…
FreeMemory
  • 8,444
  • 7
  • 37
  • 49
4
votes
1 answer

--go-grpc_out: protoc-gen-go-grpc: Plugin failed with status code 1

i am getting this error when i compile my proto file: protoc-gen-go-grpc: program not found or is not executable Please specify a program using absolute path or make sure the program is available in your PATH system variable \--go-grpc_out:…
Zohaib Asif
  • 71
  • 1
  • 3
1 2
3
25 26