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
1
vote
1 answer

Convert protobuf bin to JSON without pb files

I call an HTTP request which returns a protobuf response. I don't have the .pb files, so I try to convert that to a readable format such as JSON with indexed fields. Using protoc and the command protoc --decode-raw < test.bin The output looks like…
Tasos
  • 7,325
  • 18
  • 83
  • 176
1
vote
1 answer

Generate .pb file without using protoc in golang

I'm trying to generate .pb.go file using service.proto as file input in Go. Is there a way to do it without using protoc binary (like directly using package github.com/golang/protobuf/protoc-gen-go)?
1
vote
0 answers

grpc_tools.protoc -> 'Could not make proto path relative'

I want to generate protobuf (pb2) files for Python programmatically using grpc_tools. With this layout (potentially other languages in parallel to 'python/') +---gen +---protos | phone.proto | \---python call_protoc.py this…
thoku
  • 1,120
  • 9
  • 27
1
vote
1 answer

Is there a way to define import alias for go generated code from proto files

I am import two different proto files in my current proto file as below import "author/message/name.proto" import "reader/message/details.proto" in name.proto I have go_package = "author/message" and in details.proto I have go_package =…
BhanuReddy
  • 74
  • 10
1
vote
1 answer

What's equivalent writing of PRELOAD on fish shell?

protoc depends on higer version of libstdc++. Usually on bash shell we writes: LD_PRELOAD=/root/.conda/envs/myfish/lib/libstdc++.so.6.0.26 thirdparty/protobuf/bin/protoc I try to use fish shell to do the same thing. ⋊> /h/m/rank4 on master ⨯ set…
mariolu
  • 624
  • 8
  • 17
1
vote
0 answers

inconsistent 'go list' display issue

When running from utils directory, go list -f returns nothing. user@linux:~/go/src/bitbucket.org/utils> go list -f '{{ .Dir }}' -m github.com/grpc-ecosystem/grpc-gateway user@linux:~/go/src/bitbucket.org/utils> go list -m…
pepe juan
  • 11
  • 2
1
vote
1 answer

How to use docker to generate grpc code based on go.mod versions?

Using the official golang docker image, I can use the protoc command to generate the x.pb.go and x_grpc.pb.go files. The problem is that it uses the latest versions, while I want to generate those using whichever version that is part of the go.mod…
David Gourde
  • 3,709
  • 2
  • 31
  • 65
1
vote
1 answer

How to generate an object out of proto map

I have following proto that defines a dictionary map, when converting to typescript this type is returned as an array of tuples Array<[string,string]> however I would like it as an object of key:value pairs. Is it possible? Should I use different…
1
vote
1 answer

why does find work inside makefile but not glob **/*.proto for protoc compiler

I recently wrote a Makefile instruction for compiling .proto files and ran into odd behavior. This command works when running in my own shell, but when inside a Makefile target... protoc \ --proto_path ./protos \ --go_out…
Joe B
  • 1,261
  • 14
  • 20
1
vote
1 answer

Retrieve nested list (matrix) from gRPC in NodeJS

I'm using gRPC with NodeJs and the response I want is this (example in JS format): [ ['aa1', 0, 0], ['aa2', 0, 0], ... ['aaN', 0, 0], ] Is a list inside another list. Like a 2-Dimensional array or a matrix. The problem here is I haven't…
J.F.
  • 13,927
  • 9
  • 27
  • 65
1
vote
1 answer

Importing message Types from other project protobuf files

Im trying to build my proto files in a way that what proto files I include is publicly available when I build to the various languages. I have tried import public "webrtc/signaling.proto" and it removes the "is not used" message, but the message…
Teddy
  • 53
  • 4
1
vote
2 answers

How do I properly specify the location of my proto files in protocol buffers?

Here are the three files I am working with: // city.proto syntax = "proto3"; package city; message City { string cityName = 1; string zipCode = 2; string countryName = 3; } // street.proto syntax = "proto3"; import…
Mutating Algorithm
  • 2,604
  • 2
  • 29
  • 66
1
vote
1 answer

protoc doesn't see files? (I'm doing something wrong)

I'm trying to run: protoc *.proto -python_out=. in the protoc directory inside of tensorflow > models > research > object_detection > protos, and it returns object_detection/protos/flexible_grid_anchor_generator.proto: File not…
tmckzs
  • 9
  • 2
1
vote
1 answer

Proto3 JSON not converting field name to camelCase

Prot3 documentation says that by default JSON printer should convert the field name to lowerCamelCase and use that as the JSON name, but I did not observe this in my files: Lng float32 `protobuf:"fixed32,1,opt,name=Lng,proto3"…
dclipca
  • 1,739
  • 1
  • 16
  • 51
1
vote
1 answer

protoc not found error when building Caffe

I am using Ubuntu 16, Python 3, CUDA 10.1, and Tensorflow 2.3. I used git clone on the Caffe github repo, then did cd build cmake .. make all I got a bunch of protobuf errors: ~/Downloads/caffe/build$ make clean ~/Downloads/caffe/build$ make all [ …
user5739619
  • 1,748
  • 5
  • 26
  • 40