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
13
votes
2 answers

protoc --go_opt=paths=source_relative vs --go-grpc_opt=paths=source_relative

I am having a hard time figuring out protoc command and go plugin. What is the different between: protoc \ # Directory where you want the compiler to write your Go output. --go_out=. # vs ? --go_opt=paths=source_relative # vs ? …
Chris G.
  • 23,930
  • 48
  • 177
  • 302
12
votes
1 answer

What is the difference between protoc and protobuf (Protocol Buffer)

Can some clarify difference between protocol buffer and protoc ?. Googling only shows protocol buffers. I see that naming convention is different for both protobuf-programming language-version and protoc-operating system-86_32. Are they different or…
BhanuKiran
  • 2,631
  • 3
  • 20
  • 36
11
votes
2 answers

gRPC server error handler golang

I want know about good practices with golang and gRPC and protobuf. I am implementing the following gRPC service service MyService { rpc dosomethink(model.MyModel) returns (model.Model) { option (google.api.http) = { post: "/my/path" body:…
own3dh2so4
  • 391
  • 2
  • 5
  • 17
11
votes
1 answer

Protocol Buffer Error version

I'm trying to install the Caffe library but I have a compilation problem due to a wrong protobuf version installed in my system. In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:0: .build_release/src/caffe/proto/caffe.pb.h:17:2:…
Luca
  • 183
  • 1
  • 8
10
votes
9 answers

Cannot find `protoc` command

When I run this: protoc --python_out=. .\object_detection\protos\anchor_generator.proto on a tensorflow object detection file on the command line, I get: 'protoc' is not recognized as an internal or external command, operable program or batch…
m.mera
  • 111
  • 1
  • 1
  • 9
10
votes
3 answers

How to read Meta data in gRPC using Java at client side

I am using Java and Protoc 3.0 compiler and my proto file is mention below. https://github.com/openconfig/public/blob/master/release/models/rpc/openconfig-rpc-api.yang syntax = "proto3"; package Telemetry; // Interface exported by…
Ammad
  • 4,031
  • 12
  • 39
  • 62
10
votes
2 answers

How can I use protocol buffers for Python on windows?

I have been trying to use protocol buffers in my Python program, but cannot get it to work. I'm running a Windows 8 machine and have tried Python 2.7.6 and Python 3.3. I downloaded the binary protocol buffer compiler for Python and used it to…
user2399973
  • 181
  • 2
  • 3
  • 7
9
votes
2 answers

Where to set the path to the protoc to import standards Protocol Buffers

Where need I to set the path to the protoc to get import standards Protocol Buffers (protobuf), like empty.proto and timestamp.proto in Windows and Dart? When the protoc is ran: protoc --dart_out=grpc:lib/src/protos/generated -Iprotos …
Muka
  • 1,190
  • 1
  • 12
  • 27
8
votes
2 answers

proto: file is already registered with different packages

I have 2 proto compiled under different go packages but when I register them in a a server and run it, I get : panic: proto: file "common.proto" is already registered previously from: "github.com/soft/test-platform.go/common" currently from:…
Antonin
  • 879
  • 2
  • 10
  • 27
8
votes
3 answers

"protoc: not found" on an Alpine-based Docker container running Protocol Buffers

I'm trying to build a simple container which downloads a Protocol Buffers binary from the release page (https://github.com/protocolbuffers/protobuf/releases/tag/v3.13.0) and adds it to the path. Following the Linux instructions at…
Kurt Peek
  • 52,165
  • 91
  • 301
  • 526
8
votes
5 answers

TensorFlow - object detection module, error appear when trying to use protoc

having problems with protoc, the line doesn't work in windows. I get this errors: using this line protoc --proto_path=./object_detection/protos --python_out=c:\testmomo ./object_detection/protos/anchor_generator.proto I get this…
7
votes
2 answers

Solving protoc-gen-go: unable to determine Go import path problem by adding a "M" argument

Same symptom as protoc-gen-go: unable to determine Go import path for "simple.proto" For simple proto file with following content. syntax="proto3"; package main; message Person { string name = 1; int32 age = 2; } I am trying to…
xpt
  • 20,363
  • 37
  • 127
  • 216
7
votes
1 answer

Should I use Get methods to get values or should I use fields directly?

I'm using protobuf (and protoc) for the first time with Go. message MyProtoStruct { string description = 1; } I'm a little bit confused: should I use methods to get values (like MyProtoStruct.GetDescription()) or should I use fields directly…
Fred Hors
  • 3,258
  • 3
  • 25
  • 71
7
votes
2 answers

How to encode protocol buffer string to binary using protoc

I been trying to encode strings using protoc cli utility. Noticed that output still contains plain text. What am i doing wrong? osboxes@osboxes:~/proto/bin$ cat ./teststring.proto syntax = "proto2"; message Test2 { optional string b = 2; } echo…
kpavel
  • 262
  • 3
  • 9
7
votes
2 answers

protoc jar maven plugin intellij not creating compiled proto files

I am trying to use the protoc jar maven plugin in intelij. I've added this to my pom.xml: com.github.os72 protoc-jar-maven-plugin
srchulo
  • 5,143
  • 4
  • 43
  • 72
1
2
3
25 26