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

How to modify the de/serialization in protobuf compiler output?

I want to introduce a different method of deserialization and serialization when generating to protobuf files. In essence, after running protoc -I=/home/ubuntu/protobuf-3.21.6/src -I=./ --cpp_out=./ addressbook.proto from the examples I would want…
just an
  • 33
  • 5
0
votes
1 answer

protoc failed to find the import

$ protoc --go_out=module=github.com/redmcme/go-protos:. \ --go-grpc_out=module=github.com/redmcme/go-protos:. \ --proto_path ../protos \ ../protos/*/** teams.team: File not found. teams/season.proto:3:1: Import…
Eren A. Akyol
  • 36
  • 1
  • 5
0
votes
0 answers

Protoc panics while generating openapiv2 files from proto with custom HttpRule in additional_bindings

Proto file with the following part: service HealthService { rpc GetAllHealthChecks (GetAllHealthChecksRequest) returns (GetAllHealthChecksReply) { option (google.api.http) = { get: "/api/rest/v1/health/all" …
Zebedeusz
  • 59
  • 1
  • 4
0
votes
2 answers

Protobuf error: ModuleNotFoundError: No module named 'google'

I am trying to get Protobuf to work with Python but Python throws an error when trying to import a compiled .proto file. The error is ModuleNotFoundError: No module named 'google'. This is on a brand new and clean EC2 instance with Ubuntu Linux. …
dandy
  • 1
  • 2
0
votes
1 answer

How to use protoc to generate json represents of descriptor?

Tring to *.proto -> json -generator-> other things Tried pbjs, but the json can only hold one option, and no comment. Is there any way to use the protoc to generate the json that represent the protos ? Write a protoc generator is harder than work…
wener
  • 7,191
  • 6
  • 54
  • 78
0
votes
1 answer

Python (PyCharm) - Protoc is not a recognized command

I realize there are other threads already, but none of the solutions are working for me. This is my error when trying to use the protoc command: Protoc. I'm using Windows10 and a virtual environment in PyCharm using python 3.8 and pip is updated…
0
votes
1 answer

Permission denied error while running maven install

I have an IntelliJ IDEA Ultimate 2022.1.2 installed from Ubuntu Software app. It is configured to use Maven wrapper. When I execute "install" on my java project (from lifecycle menu) I get two errors: Cannot run program "/usr/bin/git" (in directory…
0
votes
1 answer

github.com/golang/protobuf/protoc-gen-go has no package path for golang version 1.18

we are trying to build an application, but unable to generate the code using protoc-gen-go $ make go version go1.18 linux/amd64 /usr/local/go/bin/go make -C go_source all make[1]: Entering directory…
Raji M
  • 63
  • 6
0
votes
1 answer

assign values to repeated fields protobufs typescript

I have a protobuf message in service.proto message DataUpdate { uint32 source = 1; uint32 destination = 2; } message DataUpdateRequest { string filepath = 1; repeated DataUpdate updates = 2; } and I used protoc to get the js file for the…
0
votes
2 answers

Compile .proto files on every directory

I have a directory structure like this: Makefile README.md go.mod google/ -> Protobuf dependencies (ignore) gopb/ -> Compiled Go protobuf files (ignore) protoc-gen-openapiv2/ -> Protobuf OpenAPI depdencies (ignore) providers/ - polygon/ …
Woody1193
  • 7,252
  • 5
  • 40
  • 90
0
votes
1 answer

How to use legacy version of protoc-gen-go with plugins

I'm not being able to generate the protobuffer files for grpc protoc -I=./ --go_out=plugins=grpc:. code/proto/* --go_out: protoc-gen-go: plugins are not supported; use 'protoc --go-grpc_out=...' to generate gRPC See…
user1532587
  • 993
  • 1
  • 14
  • 39
0
votes
1 answer

How to remove hardcoded path for --plugin=protoc-gen-grpc in CMake using vcpkg toolchain

I have a working example of building a grpc library in C++ using CMake. However I need to hardcode the absolute path to the flag --plugin=protoc-gen-grpc="/home/myusername/dev/lab/MiniGL/vcpkg/installed/x64-linux/tools/grpc/grpc_cpp_plugin" What I…
Decaf Sux
  • 305
  • 1
  • 11
0
votes
1 answer

Google protobuf - cannot decode message

I have 2 protobuf messages that I am unable to decode unless I remove some bytes from the beginning and/or from the end. First message in base64 is: RQAAAPEmCgV0ZXN0MRAXGbj4KzKrldhBIAFCAQBKAQBRAAEAsPC/WQAAAAAAAPC/ which translates to this byte…
Cosmin Ivan
  • 65
  • 1
  • 5
0
votes
1 answer

proto3: Why setting java_multiple_files = true not creating separate java classes for each proto message?

I have a proto definition with nested classes syntax = "proto3"; option java_package = "com.spot.proto.v1.config"; package v1config; // ClusterConfig proto is used to maintain the params required by all the services at a central place. message…
tuk
  • 5,941
  • 14
  • 79
  • 162
0
votes
1 answer

Protoc installed by brew seems not to work in a custom build rule

I've got a M1, with XCode 13.2.1 and monterey. I've installed brew following the official steps and also I did the extra two steps so the new brew path is added to my path. Additionally I've added export PATH=/opt/homebrew/bin:$PATH to my…
xarly
  • 2,054
  • 4
  • 24
  • 40