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
0
votes
1 answer

How to write a protoc plugin to generate c# codes?

I want to write a protoc-gen-... plugin to compile my .proto files into csharp files, however, i can not find any tools like google.golang.org/protobuf/compiler/protogen in golang to help me to do this, so how to write a protoc plugin to generate c#…
HongyanShen
  • 1,435
  • 2
  • 14
  • 23
0
votes
1 answer

protoc: import in service.proto not resolved

I have a project where the service definition is in a separate file form the message definition. protoc doesn't like this: Execution failed for task ':generateProto'. > protoc: stdout: . stderr: IAscIndication.proto:11:13: "AscIndication" is not…
Martin Schröder
  • 4,176
  • 7
  • 47
  • 81
0
votes
3 answers

Protoc on mac os --goout is not recognized as an flag

i'm running osx $ uname -rsv Darwin 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64 installed with brew and from binaries both didn't work $ brew install protobuf $ protoc --version libprotoc…
0
votes
1 answer

how to fix path problem with grpc, go and protoc

is there any fix fro running protoc command for go outside go path. Like I have to export path for every new project... $ export PATH="$PATH:$(go env GOPATH)/bin"
Rohan
  • 3
  • 1
  • 4
0
votes
1 answer

How can I use protobuf to limit the values passed into it? (python)

I'm creating a python file to read in some json data. Then assigning that data to my protobuf messages. I want to pass in "start_hour": 8 and receive 8 and not EIGHT from my enum. Perhaps I'm missing something completely, or can I do this in a…
0
votes
1 answer

protoc --dart_out=grpc:. -Iprotos helloworld.proto - directory does not exist

How do you specify a directory - the following only work if I put my helloworld.proto in a folder named protos protoc --dart_out=. -Iprotos helloworld.proto protos: warning: directory does not exist. helloworld.proto: File does not reside within any…
Chris G.
  • 23,930
  • 48
  • 177
  • 302
0
votes
1 answer

gRPC generated file doesn't have json definition

I'm trying to generate Go file from proto file but it doesn't have json definition in the method's input definition. Should I add the json definition by myself or there were something wrong with my script. Thank you, I sincerely appreciate your…
BlackLotus
  • 318
  • 4
  • 12
0
votes
1 answer

Service being generated but not client protoc

I am using protoc to try and generate a client / server for my gRPC service. I have the following in my make file stripe: @protoc --go_out=. pkg/proto/stripe/service.proto My proto file is syntax = "proto3"; package grpc; option go_package =…
N P
  • 2,319
  • 7
  • 32
  • 54
0
votes
0 answers

type `*structpb.Struct` has no field or method `Unmarshal`, `Size` and `MarshalToSizedBuffer`

I am using protocol buffer to define a struct - message MyData { string id = 1; google.protobuf.Struct json_field = 2; } After compiling the proto file with protoc, I get three undefined functions on json_field - Error:…
Roger That
  • 21
  • 3
0
votes
1 answer

fatal error: 'grpcpp/grpcpp.h' file not found C++

Context I have been working with C++ for about the past 5-6 months and I'm beginning to learn gRPC. I have followed many tutorials online to get started, but I want to build a client-server communication app from scratch. Probably a bit too much,…
zebra14
  • 57
  • 2
  • 8
0
votes
1 answer

Accessing custom options in python protoc

metadata3.proto syntax = "proto3"; import "google/protobuf/descriptor.proto"; package metas3; message MessageOptionsMetadata3 { optional string message_options_field1 = 1; optional string message_options_field2 = 2; optional string…
maverickz
  • 143
  • 1
  • 7
0
votes
1 answer

protoc --go-grpc_out generate code in out of vision of --go_out generated code

In previos products i use old protoc-gen-go which allow to use plugins and generate serialization/deserialization and gRPC client/server in same pb file as far i understand protoc-gen-go v1.27.1 will not allow plugins and demand to use go-grpc_out…
DeYuro
  • 65
  • 5
0
votes
1 answer

protocol compilation using a remote file for Python (and others)

I am looking for a way to convince bash that "I've passed you a file, in the specified directory" without actually downloading and creating that directory on disk, OR pass a remote file directly to my protocol buffer compiler without writing it to…
Vincent Buscarello
  • 395
  • 2
  • 7
  • 19
0
votes
0 answers

How to specify OUTPUT for Java protobuf classes

I've been working to prevent our CMake system at work from always regenerating the Java wrapper classes for our protobufs; as it stands, a single change in a C++ unit test requires rebuilding a couple hundred of these. The Python and C++ protoc…
Mike C
  • 1,224
  • 10
  • 26
0
votes
2 answers

protoc can't be installed : not find a version that satisfies the requirement protoc

i will install protoc on windows 10 (python 3.7.2) pip install protoc
ERROR: Could not find a version that satisfies the requirement protoc
ERROR: No matching distribution found for protoc
what should i do? anybody can help me?