diff options
author | Jeong YunWon <youknowone@users.noreply.github.com> | 2021-03-26 04:12:35 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-25 12:12:35 -0700 |
commit | 276b1bc342d23142e4b2b9b9fadbf076474deec9 (patch) | |
tree | 11aa2c405876cb0c50e410ccf251fd250b1ca2dc /grpc | |
parent | 124654ffc4ef8ee8a67aca8af3d9a6e58bd38f59 (diff) | |
download | flatbuffers-276b1bc342d23142e4b2b9b9fadbf076474deec9.tar.gz flatbuffers-276b1bc342d23142e4b2b9b9fadbf076474deec9.tar.bz2 flatbuffers-276b1bc342d23142e4b2b9b9fadbf076474deec9.zip |
[grpc] Support latest version of grpc PoC (#6338)
* use grpcpp rather than deprecated grpc++
* grpcpp Deserialize take ByteBuffer instead of grpc_byte_buffer
* grpc 1.36.0
* Fix to use grpc 1.36.0
* Fix CMakeLists to refer gRPC
* add find_package(Threads)
* Update bazel deps
* Apply workaround about boringssl build error
* Install latest cmake for osx on travis-ci
Co-authored-by: Yeom Gyusun <omniavinco@gmail.com>
Diffstat (limited to 'grpc')
-rw-r--r-- | grpc/boringssl.patch | 13 | ||||
-rwxr-xr-x | grpc/build_grpc.sh | 14 | ||||
-rw-r--r-- | grpc/samples/greeter/client.cpp | 2 | ||||
-rw-r--r-- | grpc/samples/greeter/server.cpp | 2 | ||||
-rw-r--r-- | grpc/src/compiler/cpp_generator.cc | 38 | ||||
-rw-r--r-- | grpc/tests/grpctest.cpp | 3 |
6 files changed, 46 insertions, 26 deletions
diff --git a/grpc/boringssl.patch b/grpc/boringssl.patch new file mode 100644 index 00000000..632499e2 --- /dev/null +++ b/grpc/boringssl.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1645a264a..12f8ca999 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -635,6 +635,8 @@ add_library( + src/ssl/tls_record.cc + ) + ++target_link_libraries(ssl crypto) ++ + add_executable( + bssl + diff --git a/grpc/build_grpc.sh b/grpc/build_grpc.sh index 3c0c27e1..190a1ef9 100755 --- a/grpc/build_grpc.sh +++ b/grpc/build_grpc.sh @@ -1,14 +1,20 @@ #!/bin/bash -grpc_1_15_1_githash=1a60e6971f428323245a930031ad267bb3142ba4 +grpc_1_36_0_githash=736e3758351ced3cd842bad3ba4e2540f01bbc48 function build_grpc () { git clone https://github.com/grpc/grpc.git google/grpc cd google/grpc - git checkout ${grpc_1_15_1_githash} + git checkout ${grpc_1_36_0_githash} git submodule update --init - make - make install prefix=`pwd`/install + # Apply boringssl build patch + cd third_party/boringssl-with-bazel + git apply ../../../../grpc/boringssl.patch + cd ../.. + mkdir ../grpc_build + cd ../grpc_build + cmake ../grpc -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=`pwd`/../grpc/install + cmake --build . --target install ${JOBS:+-j$JOBS} if [ ! -f ${GRPC_INSTALL_PATH}/lib/libgrpc++_unsecure.so.1 ]; then ln -s ${GRPC_INSTALL_PATH}/lib/libgrpc++_unsecure.so.6 ${GRPC_INSTALL_PATH}/lib/libgrpc++_unsecure.so.1 fi diff --git a/grpc/samples/greeter/client.cpp b/grpc/samples/greeter/client.cpp index 2e42f8fd..0e4f3481 100644 --- a/grpc/samples/greeter/client.cpp +++ b/grpc/samples/greeter/client.cpp @@ -1,7 +1,7 @@ #include "greeter.grpc.fb.h" #include "greeter_generated.h" -#include <grpc++/grpc++.h> +#include <grpcpp/grpcpp.h> #include <iostream> #include <memory> diff --git a/grpc/samples/greeter/server.cpp b/grpc/samples/greeter/server.cpp index db442593..ac38fa96 100644 --- a/grpc/samples/greeter/server.cpp +++ b/grpc/samples/greeter/server.cpp @@ -1,7 +1,7 @@ #include "greeter.grpc.fb.h" #include "greeter_generated.h" -#include <grpc++/grpc++.h> +#include <grpcpp/grpcpp.h> #include <iostream> #include <memory> diff --git a/grpc/src/compiler/cpp_generator.cc b/grpc/src/compiler/cpp_generator.cc index 6cfd22e3..8dd40883 100644 --- a/grpc/src/compiler/cpp_generator.cc +++ b/grpc/src/compiler/cpp_generator.cc @@ -144,15 +144,15 @@ grpc::string GetHeaderIncludes(grpc_generator::File *file, std::map<grpc::string, grpc::string> vars; static const char *headers_strs[] = { - "grpc++/impl/codegen/async_stream.h", - "grpc++/impl/codegen/async_unary_call.h", - "grpc++/impl/codegen/method_handler_impl.h", - "grpc++/impl/codegen/proto_utils.h", - "grpc++/impl/codegen/rpc_method.h", - "grpc++/impl/codegen/service_type.h", - "grpc++/impl/codegen/status.h", - "grpc++/impl/codegen/stub_options.h", - "grpc++/impl/codegen/sync_stream.h"}; + "grpcpp/impl/codegen/async_stream.h", + "grpcpp/impl/codegen/async_unary_call.h", + "grpcpp/impl/codegen/method_handler.h", + "grpcpp/impl/codegen/proto_utils.h", + "grpcpp/impl/codegen/rpc_method.h", + "grpcpp/impl/codegen/service_type.h", + "grpcpp/impl/codegen/status.h", + "grpcpp/impl/codegen/stub_options.h", + "grpcpp/impl/codegen/sync_stream.h"}; std::vector<grpc::string> headers(headers_strs, array_end(headers_strs)); PrintIncludes(printer.get(), headers, params); printer->Print(vars, "\n"); @@ -1179,14 +1179,14 @@ grpc::string GetSourceIncludes(grpc_generator::File *file, std::map<grpc::string, grpc::string> vars; static const char *headers_strs[] = { - "grpc++/impl/codegen/async_stream.h", - "grpc++/impl/codegen/async_unary_call.h", - "grpc++/impl/codegen/channel_interface.h", - "grpc++/impl/codegen/client_unary_call.h", - "grpc++/impl/codegen/method_handler_impl.h", - "grpc++/impl/codegen/rpc_service_method.h", - "grpc++/impl/codegen/service_type.h", - "grpc++/impl/codegen/sync_stream.h"}; + "grpcpp/impl/codegen/async_stream.h", + "grpcpp/impl/codegen/async_unary_call.h", + "grpcpp/impl/codegen/channel_interface.h", + "grpcpp/impl/codegen/client_unary_call.h", + "grpcpp/impl/codegen/method_handler.h", + "grpcpp/impl/codegen/rpc_service_method.h", + "grpcpp/impl/codegen/service_type.h", + "grpcpp/impl/codegen/sync_stream.h"}; std::vector<grpc::string> headers(headers_strs, array_end(headers_strs)); PrintIncludes(printer.get(), headers, params); @@ -1604,8 +1604,8 @@ grpc::string GetMockIncludes(grpc_generator::File *file, std::map<grpc::string, grpc::string> vars; static const char *headers_strs[] = { - "grpc++/impl/codegen/async_stream.h", - "grpc++/impl/codegen/sync_stream.h", + "grpcpp/impl/codegen/async_stream.h", + "grpcpp/impl/codegen/sync_stream.h", "gmock/gmock.h", }; std::vector<grpc::string> headers(headers_strs, array_end(headers_strs)); diff --git a/grpc/tests/grpctest.cpp b/grpc/tests/grpctest.cpp index decf5e51..6991b7eb 100644 --- a/grpc/tests/grpctest.cpp +++ b/grpc/tests/grpctest.cpp @@ -14,8 +14,9 @@ * limitations under the License. */ -#include <grpc++/grpc++.h> +#include <grpcpp/grpcpp.h> +#include <condition_variable> #include <thread> #include "monster_test.grpc.fb.h" |