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 solve CreateProcess error=206, The filename or extension is too long error of maven-protobuf-plugin?

How can one solve this error when building a Maven project that uses protobufs? org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile (default) on project my-module: An error occurred while invoking protoc: Error while executing process.:…
Balu
  • 522
  • 6
  • 16
0
votes
0 answers

How to encode from JSON to binary Protobuf on command line?

How to serialize JSON to binary Protocol Buffers (Protobuf) serialization on command line? Assuming the JSON follows Protobuf 3 JSON Mapping) Question How to encode protocol buffer string to binary using protoc has an answer for serializing to…
Touko
  • 11,359
  • 16
  • 75
  • 105
0
votes
1 answer

Make GitHub action fail when output from find-exec shows error

I have a GitHub action that includes a call to find where the result is chained to another command: echo "Compiling..." && find $GEN_PROTO_DIR -type f -name "*.proto" -exec protoc \ --go_out=$GEN_OUT_DIR --go_opt=module=github.com/xefino \ …
Woody1193
  • 7,252
  • 5
  • 40
  • 90
0
votes
1 answer

How to prevent generated Java Protobuf files to be created in the build directory?

Currently I have my build.gradle being specified to generate the Java Protobuf files to a specific directory : sourceSets { main { proto { srcDir("src/main/java/proto") } } protobuf { protoc { artifact =…
aaa
  • 5
  • 2
0
votes
0 answers

Unable to execute proto files : protoc-gen-go_gprc: program not found or is not executable

I am very new to GO. In the process I am trying to implement a GRPC in my service. I am not able to use the protobuf compiler and not able to generate the pb file. proto/greet.proto syntax="proto3"; option go_package = "./proto"; package…
Ghost Chat
  • 51
  • 5
0
votes
0 answers

Protoc can not be built when CMAKE_BUILD_WITH_INSTALL_RPATH is TRUE

In my project the variable is set to True. This causes the problem that protoc can not be built as a shared library. cmake_minimum_required(VERSION 3.20) project(untitled4) set(CMAKE_CXX_STANDARD 14) set(CMAKE_BUILD_WITH_INSTALL_RPATH…
0
votes
0 answers

Can't protoc with relative paths from a script

Been wrestling with this for a while. I have a protoc command that runs fine in terminal, but fails in a script. The issue seems to be with the recursive protos. The folder structure is: ledger-models % ls Cargo.lock README.md gen.rs …
David
  • 755
  • 5
  • 11
0
votes
1 answer

how to install protoc-gen-grpc-web

i'm calling grpc-web in a build script, building an image for docker on ubuntu: protoc -I. graph_endpoint.proto --grpc web_out=import_style=commonjs,mode=grpcwebtext:. it throws an error: protoc-gen-grpc-web: program not found or is not…
Saile
  • 115
  • 1
  • 11
0
votes
0 answers

Protobuf & Gradle: Unable to use types from same directory and package

I have the following types: src/main/proto/mypackage/TypeA.proto: syntax = "proto3"; package mypackage; option java_package = "tld.domain.protos.mypackage"; option java_outer_classname = "TypeA"; import "mypackage/TypeB.proto"; message TypeA { …
mitchkman
  • 6,201
  • 8
  • 39
  • 67
0
votes
1 answer

Install gRPC tools for node on linux/arm64

Unable to install grpc-tools for node on linux/arm64. Steps to reproduce, with Dockerfile like FROM node:latest RUN apt-get update \ && apt install -y curl ca-certificates curl gnupg \ && npm -g install grpc-tools CMD […
Kamesh
  • 115
  • 11
0
votes
0 answers

How to start a custom Java protoc plugin

My custom Java protoc plugin demo is as follows. public class Main { public static void main(String[] args) throws IOException { StringBuilder data = new StringBuilder(); PluginProtos.CodeGeneratorRequest codeGeneratorRequest =…
0
votes
0 answers

How to make `protoc` JS output preserve the original file directory structure?

I'm using protoc to generate Ruby and JavaScript sources. My directory is as follows: output/ js/ ruby/ src/ foo/ bar/ test.proto My test.proto file defines 2 simple messages: message CreateUserRequest { ... } message…
user2490003
  • 10,706
  • 17
  • 79
  • 155
0
votes
1 answer

Protoc generates GRPC .pb.go and grpc.pb.go files in different directories

I have a GRPC service and associated requests declared in a file called github.com/myuser/myrepo/protos/iam/v1/service.proto. The header for this file looks like this: syntax = "proto3"; package myrepo.iam.v1; option go_package =…
Woody1193
  • 7,252
  • 5
  • 40
  • 90
0
votes
0 answers

gRPC Gateway and protobuf protoreflect.ProtoMessage error

I'm working on migrating an older proto file that uses gRPC Gateway to protobuf apiv2. I'm able to generate the following files: api.pb.go, api_grpc.pb.go, and api.pg.gw.go however when attempting to build the project I get the missing ProtoReflect…
0
votes
1 answer

Can't build docker container for Kotlin + gRPC project

Every time I try to build the application docker I get the following error: java.io.IOException: Cannot run program…
LuccasMF
  • 413
  • 5
  • 15