Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding generation of *.cc and *.h files from proto files #36443

Open
Gaurav0411GitHub opened this issue Apr 24, 2024 · 3 comments
Open

Regarding generation of *.cc and *.h files from proto files #36443

Gaurav0411GitHub opened this issue Apr 24, 2024 · 3 comments

Comments

@Gaurav0411GitHub
Copy link

Gaurav0411GitHub commented Apr 24, 2024

Please find the steps here
Step1: I have compiled gRPC with below commands and I got protoc compiler and Protobuf shared library along with gRPC
git clone -b v1.59.4 https://github.com/grpc/grpc
cd grpc; git checkout -b v1.59.4
git submodule update --init --recursive
cmake -DgRPC_INSTALL=ON
-DCMAKE_BUILD_TYPE=Release
-DgRPC_BUILD_TESTS=OFF
-DCMAKE_INSTALL_PREFIX=/usr/local
-DBUILD_SHARED_LIBS=ON
../..
make -j$(nproc)
make install

Step2: I have downloaded envoy api dependencies with the below command
git clone -b v0.15.0 https://github.com/google/cel-spec.git
git clone -b v0.4.1 https://github.com/census-instrumentation/opencensus-proto.git
git clone -b v1.1.0 https://github.com/open-telemetry/opentelemetry-proto.git
git clone -b v0.6.1 https://github.com/prometheus/client_model.git
git clone -b v1.0.4 https://github.com/bufbuild/protoc-gen-validate.git
git clone https://github.com/googleapis/googleapis.git; cd googleapi; git checkout 114a745b2841a044e98cdbb19358ed29fcf4a5f1
git clone https://github.com/cncf/xds.git; cd xds; git checkout 0c46c01016dc5c9aeddf6c745a230c32bf62841d

Step3: when I am trying to generate the *.cc and *.h file from *.proto files of above repository from the attached script.txt
script.txt
I am getting below errors. I have attached the error.txt which show errors
error.txt
It looks like *.cc and *.h files are not generate correctly. Please let me know how can I correct it.

Step4: I am using below
Python 3.12.3
gcc (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9)
Rocky Linux release 8.5 (Green Obsidian)

Please suggest me, how can I generate complete *.cc and *.h files from *.proto files?

@eugeneo
Copy link
Contributor

eugeneo commented Apr 24, 2024

It is not clear what you are trying to achieve, e.g. why you need to generate the files.

I would like to refer you to the gRPC examples - https://github.com/grpc/grpc/tree/master/examples/cpp/helloworld - they show you how to build proto libraries with CMake and Bazel.

@Gaurav0411GitHub
Copy link
Author

I want to create shared library of envoy_api, all above envoy_api_dependencies which I have mentioned above.
I want to generate *.cc and *.h files from *.proto of envoy_api and envoy_api_dependencies so that I can make shared library of envoy api and envoy api dependencies.
As we can create these *.cc and *.h files from *.proto using gRPC and Prcotoc compiler and these *.cc and *.h files from *.proto are looking incomplete so envoy community has redirected me to gRPC. so I want to generate *.cc and *.h files with your help. That's why I have shared all the steps. which I have followed. I have seen already the example But I could not find the steps for generating *.cc and *.h files from *.proto files

@Gaurav0411GitHub
Copy link
Author

Gaurav0411GitHub commented May 15, 2024

Could you please suggest me the steps of testing the envoy-api using gRPC and xds in c++ examples?
https://blog.envoyproxy.io/the-universal-data-plane-api-d15cec7a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants