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
0 answers

Protocol Buffer Unused Imports for Annotations

When importing other protocol buffer definitions to use for annotations, such as the ones in grpc-gateway protoc-gen-openapiv2 to add extra information for the generated openapi doc, the generated code imports these annotations even though they…
niltz
  • 1,014
  • 11
  • 28
1
vote
4 answers

Golang - google/protobuf/Empty.proto: File not found

syntax = "proto3"; package model; import "google/protobuf/Empty.proto"; message User { string id = 1; string name = 2; string email = 3; string alamat = 4; string password = 5; } message UserList { repeated User list =…
Yahfi Ilham
  • 79
  • 2
  • 7
1
vote
1 answer

Protobuf Error on TFOD API installation: ImportError: cannot import name 'builder'

I'm trying to install the Tensorflow Object Detection API by following this tutorial. When I got to the end, while trying the python object_detection/builders/model_builder_tf2_test.py command, I got the following error: Traceback (most recent call…
1
vote
1 answer

protoc-gen-gogo always appends a '_' to the field in the message

goTrying to generate golang pb.go file through protoc-gen-gogo. But it seems that there is a specific field 'uint64 sizeis always generated asSize_` with an unexpected _ The message is message T { uint64 size = 1; } => The definition in the…
No9527
  • 31
  • 9
1
vote
1 answer

How can I make Timestamp Protobuff back to my timezone since the github version of timestamp is deprecated?

Alright so I just realized something when I generate new protobuff file using: protoc my_file.proto --go_out=./ My .proto struct is somehow looks like: message MyRequest { google.protobuf.Timestamp my_time = 1; } If I use the protoc command…
1
vote
1 answer

Java : io.protostuff.compiler.parser.ParserException: Can not load proto

I am using guice parser to parse proto file. It is not able to resolve imports. Any suggestions experts in how to resolve imports public as well as imports within same project ? Proto file syntax = "proto3"; package grpc; import…
Maana
  • 640
  • 3
  • 9
  • 22
1
vote
1 answer

How to make protoc generated python stub file to include package name in import

I use the protoc tool, from grpc-tools package (ver. 1.43.0) with python 3.8.10 to generate the data types and client and server stubs for my proto3 service. The generated file containing the stubs (ending in '_grpc.py') imports the generated file…
sinjin
  • 189
  • 1
  • 6
1
vote
0 answers

Output path problem of custom plug-in of the protoc.exe tool

I want to use the custom plug-in tool of protocol to realize the generation pb. Go file while generating my own code file, but I encountered the problem of file output path. command like this:protoc -I=. --go_out=.…
null
  • 115
  • 1
  • 9
1
vote
1 answer

GOLANG json to Protoc with LocalDateTime, not DateTime

I'm working on a middleware using golang. I'm consuming a REST-API which returns a Date in form of a LocalDateTime (e.g. "created": "2022-01-09T00:00:00",) and it should get mapped into an protoc message with the data class…
jemai
  • 11
  • 1
1
vote
1 answer

Error in rule configure_veins_vlc, configure_veins, protobuf

My question is regarding veins-gym. The dependencies highlighted at the beginning of that file work well. However, I receive an error when running snakemake -jall. Here is a log file Building DAG of jobs... Provided cores: 8 Rules claiming more…
Python
  • 359
  • 2
  • 16
1
vote
1 answer

Separate client and server generated by protoc

I am trying to have protoc-generated server interface and client implementation in separate packages The header part of my .proto files is the following: syntax = "proto3"; option go_package = "github.com///pkg/grpc"; And I am…
Alexander
  • 103
  • 2
  • 8
1
vote
0 answers

How to decode nested / imported protobuf using protoc command line or python

I am debugging the api response which in protobuf format. I know that I can using the protoc command to make the response readable: protoc --decode api.Response response.proto < res.bin It works on the simple files. However, I find that some data…
saakrubber
  • 79
  • 7
1
vote
1 answer

Is it possible to use Bazel without compiling protobuf compiler?

I have some projects using Bazel, C++ and protobuf. I also use gitlab CI/CD to build, test, check coverage, etc. The problem is that when the project compiles first time it also compiles a protobuf compiler, which adds about 15 minutes to each step…
mvfwd
  • 141
  • 2
  • 9
1
vote
0 answers

grpc: failed to unmarshal the received message proto: bad wiretype

I'm a little surprised to see this error! The proto object is valid - I've verified it here - https://protogen.marcgravell.com/decode - 0a06616e6b697461 is the hex dump of my proto object and yet I see this error: grpc: failed to unmarshal the…
Saturnian
  • 1,686
  • 6
  • 39
  • 65
1
vote
1 answer

Why has methods are not generated using protoc 3.17.* if in protobuf repo they say it should?

Reading here: https://github.com/protocolbuffers/protobuf/blob/master/docs/field_presence.md#go-example the Golang example: m := GetProto() if (m.HasFoo()) { // Clear the field: m.Foo = nil } else { // Field is not present, so set it. m.Foo…
Fred Hors
  • 3,258
  • 3
  • 25
  • 71