[grpc] Update to 1.29.1 (#11791)

* [grpc] Update to 1.29.1

* re-fix uwp build

* re-fix dependency upb

* [offscale-libetcd-cpp] Fix dependency grpc
This commit is contained in:
Jack·Boos·Yu 2020-06-24 05:36:26 +08:00 committed by GitHub
parent db74895497
commit c75f0b32a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 160 additions and 122 deletions

View File

@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f9d19e..25d96ab 100644
index 8561c67..84de29f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -144,6 +144,9 @@ if(UNIX)
@@ -150,6 +150,9 @@ if(UNIX)
endif()
if(WIN32)
set(_gRPC_PLATFORM_WINDOWS ON)
@ -11,8 +11,8 @@ index 3f9d19e..25d96ab 100644
+ endif()
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
@@ -160,6 +163,9 @@ if(MSVC)
# Use C99 standard
@@ -174,6 +177,9 @@ if(MSVC)
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4267")
# TODO(jtattermusch): needed to build boringssl with VS2017, revisit later
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4987 /wd4774 /wd4819 /wd4996 /wd4619")
@ -22,7 +22,7 @@ index 3f9d19e..25d96ab 100644
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_gRPC_C_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_gRPC_C_CXX_FLAGS}")
@@ -228,6 +234,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR})
@@ -237,6 +243,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR})
# ``.proto`` files
#
function(protobuf_generate_grpc_cpp)
@ -33,7 +33,7 @@ index 3f9d19e..25d96ab 100644
if(NOT ARGN)
message(SEND_ERROR "Error: PROTOBUF_GENERATE_GRPC_CPP() called without any proto files")
return()
@@ -300,6 +310,7 @@ if (gRPC_BUILD_GRPC_RUBY_PLUGIN)
@@ -309,6 +319,7 @@ if (gRPC_BUILD_GRPC_RUBY_PLUGIN)
list(APPEND _gRPC_PLUGIN_LIST grpc_ruby_plugin)
endif ()
@ -41,7 +41,7 @@ index 3f9d19e..25d96ab 100644
add_custom_target(plugins
DEPENDS ${_gRPC_PLUGIN_LIST}
)
@@ -321,6 +332,7 @@ add_custom_target(tools_cxx
@@ -327,6 +338,7 @@ add_custom_target(tools_cxx
add_custom_target(tools
DEPENDS tools_c tools_cxx)

View File

@ -1,16 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 25d96ab..c4057b3 100644
index 84de29f..0c6dc0e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -152,6 +152,11 @@ endif()
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
@@ -165,6 +165,11 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
+
+if (gRPC_STATIC_LINKING AND NOT _gRPC_PLATFORM_WINDOWS)
+ # Force to static link
+ set(CMAKE_EXE_LINKER_FLAGS "-Bstatic")
+endif()
+
if(MSVC)
include(cmake/msvc_static_runtime.cmake)
add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS)

View File

@ -10,3 +10,16 @@ index c0e2164..331e54c 100644
if (len <= sizeof(slice.data.inlined.bytes)) {
slice.refcount = nullptr;
slice.data.inlined.length = len;
diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc
index 998eb6d..a6e26d3 100644
--- a/src/core/lib/surface/server.cc
+++ b/src/core/lib/surface/server.cc
@@ -1095,7 +1095,7 @@ grpc_call_error queue_call_request(grpc_server* server, size_t cq_idx,
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown"));
return GRPC_CALL_OK;
}
- RequestMatcherInterface* rm;
+ RequestMatcherInterface* rm = nullptr;
switch (rc->type) {
case BATCH_CALL:
rm = server->unregistered_request_matcher;

View File

@ -1,136 +1,139 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a6a0f23..1c170da 100644
index 5ec669e..f71a212 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1281,7 +1281,7 @@ target_link_libraries(alts_test_util
@@ -81,6 +81,9 @@ set_property(CACHE gRPC_SSL_PROVIDER PROPERTY STRINGS "module" "package")
set(gRPC_PROTOBUF_PROVIDER "module" CACHE STRING "Provider of protobuf library")
set_property(CACHE gRPC_PROTOBUF_PROVIDER PROPERTY STRINGS "module" "package")
+set(gRPC_UPB_PROVIDER "module" CACHE STRING "Provider of upb library")
+set_property(CACHE gRPC_UPB_PROVIDER PROPERTY STRINGS "module" "package")
+
set(gRPC_PROTOBUF_PACKAGE_TYPE "" CACHE STRING "Algorithm for searching protobuf package")
set_property(CACHE gRPC_PROTOBUF_PACKAGE_TYPE PROPERTY STRINGS "CONFIG" "MODULE")
@@ -1765,7 +1768,6 @@ target_link_libraries(grpc
${_gRPC_ALLTARGETS_LIBRARIES}
gpr
address_sorting
- upb
absl::optional
absl::strings
absl::inlined_vector
@@ -1844,7 +1846,6 @@ target_link_libraries(grpc_csharp_ext
grpc
gpr
address_sorting
- upb
)
@@ -2351,7 +2352,6 @@ target_link_libraries(grpc_unsecure
${_gRPC_ALLTARGETS_LIBRARIES}
gpr
address_sorting
- upb
absl::optional
absl::strings
absl::inlined_vector
@@ -2545,7 +2545,6 @@ target_link_libraries(grpc++
grpc
gpr
address_sorting
- upb
+ ${_gRPC_UPB_LIBRARIES}
)
foreach(_hdr
@@ -1917,7 +1917,7 @@ target_link_libraries(grpc
${_gRPC_UPB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
gpr
- upb
+ ${_gRPC_UPB_LIBRARIES}
)
if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC)
target_link_libraries(grpc "-framework CoreFoundation")
@@ -2328,7 +2328,7 @@ target_link_libraries(grpc_cronet
${_gRPC_UPB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
gpr
- upb
+ ${_gRPC_UPB_LIBRARIES}
)
if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC)
target_link_libraries(grpc_cronet "-framework CoreFoundation")
@@ -2670,7 +2670,7 @@ target_link_libraries(grpc_test_util
${_gRPC_ALLTARGETS_LIBRARIES}
gpr
@@ -2821,7 +2820,6 @@ target_link_libraries(grpc++_alts
grpc
- upb
+ ${_gRPC_UPB_LIBRARIES}
)
if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC)
target_link_libraries(grpc_test_util "-framework CoreFoundation")
@@ -3013,7 +3013,7 @@ target_link_libraries(grpc_test_util_unsecure
${_gRPC_ALLTARGETS_LIBRARIES}
gpr
address_sorting
- upb
)
foreach(_hdr
@@ -2889,7 +2887,6 @@ target_link_libraries(grpc++_error_details
grpc
gpr
address_sorting
- upb
)
foreach(_hdr
@@ -2962,7 +2959,6 @@ target_link_libraries(grpc++_reflection
grpc
gpr
address_sorting
- upb
)
foreach(_hdr
@@ -3239,7 +3235,6 @@ target_link_libraries(grpc++_unsecure
grpc_unsecure
- upb
+ ${_gRPC_UPB_LIBRARIES}
)
if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC)
target_link_libraries(grpc_test_util_unsecure "-framework CoreFoundation")
@@ -3404,7 +3404,7 @@ target_link_libraries(grpc_unsecure
${_gRPC_UPB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
gpr
address_sorting
- upb
+ ${_gRPC_UPB_LIBRARIES}
)
if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC)
target_link_libraries(grpc_unsecure "-framework CoreFoundation")
@@ -3743,7 +3743,7 @@ target_link_libraries(grpc++
${_gRPC_ALLTARGETS_LIBRARIES}
foreach(_hdr
@@ -3586,7 +3581,6 @@ target_link_libraries(grpcpp_channelz
grpc
gpr
address_sorting
- upb
+ ${_gRPC_UPB_LIBRARIES}
)
foreach(_hdr
@@ -4070,7 +4070,7 @@ target_link_libraries(grpc++_alts
${_gRPC_ALLTARGETS_LIBRARIES}
grpc++
gpr
- upb
+ ${_gRPC_UPB_LIBRARIES}
)
foreach(_hdr
@@ -4876,7 +4876,7 @@ target_link_libraries(grpc++_unsecure
${_gRPC_ALLTARGETS_LIBRARIES}
gpr
grpc_unsecure
- upb
+ ${_gRPC_UPB_LIBRARIES}
)
foreach(_hdr
@@ -5898,7 +5898,7 @@ target_link_libraries(grpc_csharp_ext
@@ -3613,6 +3607,7 @@ endif()
endif()
-
+if(0)
+if (gRPC_UPB_PROVIDER STREQUAL "module")
add_library(upb
third_party/upb/upb/decode.c
third_party/upb/upb/encode.c
@@ -5938,10 +5938,10 @@ target_include_directories(upb
target_link_libraries(upb
${_gRPC_ALLTARGETS_LIBRARIES}
)
@@ -3662,7 +3657,7 @@ if(gRPC_INSTALL)
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
endif()
-
+endif()
-
-if(gRPC_INSTALL)
+if(gRPC_INSTALL AND 0)
install(TARGETS upb EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
add_executable(check_epollexclusive
diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in
index 5bfa73c..8a867df 100644
index 5bfa73c..db0865e 100644
--- a/cmake/gRPCConfig.cmake.in
+++ b/cmake/gRPCConfig.cmake.in
@@ -7,6 +7,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules)
@_gRPC_FIND_SSL@
@_gRPC_FIND_CARES@
@_gRPC_FIND_ABSL@
+find_package(upb CONFIG)
+@_gRPC_FIND_UPB@
# Targets
include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake)
diff --git a/cmake/upb.cmake b/cmake/upb.cmake
index 2c0ab84..746e067 100644
index 2c0ab84..07dd613 100644
--- a/cmake/upb.cmake
+++ b/cmake/upb.cmake
@@ -12,9 +12,9 @@
@@ -12,9 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-set(UPB_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/upb)
+find_package(upb REQUIRED)
+set(_gRPC_UPB_INCLUDE_DIR)
+set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated")
+if (gRPC_UPB_PROVIDER STREQUAL "module")
set(UPB_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/upb)
-set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}")
set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated")
set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}")
-set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated")
-set(_gRPC_UPB_LIBRARIES upb)
+set(_gRPC_UPB_LIBRARIES upb::upb)
set(_gRPC_UPB_LIBRARIES upb)
+
+elseif(gRPC_UPB_PROVIDER STREQUAL "package")
+ find_package(upb CONFIG REQUIRED)
+ set(_gRPC_UPB_LIBRARIES upb::upb)
+ set(_gRPC_UPB_INCLUDE_DIR)
+ set(upb ${_gRPC_UPB_LIBRARIES})
+ set(_gRPC_FIND_UPB "if(NOT upb_FOUND)\n find_package(upb CONFIG REQUIRED)\nendif()")
+endif()

View File

@ -1,3 +1,25 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f71a212..77cf3de 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1771,6 +1771,8 @@ target_link_libraries(grpc
absl::optional
absl::strings
absl::inlined_vector
+ absl::time
+ absl::synchronization
)
if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC)
target_link_libraries(grpc "-framework CoreFoundation")
@@ -2355,6 +2357,8 @@ target_link_libraries(grpc_unsecure
absl::optional
absl::strings
absl::inlined_vector
+ absl::time
+ absl::synchronization
)
if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC)
target_link_libraries(grpc_unsecure "-framework CoreFoundation")
diff --git a/cmake/abseil-cpp.cmake b/cmake/abseil-cpp.cmake
index 078d495..b6f50bd 100644
--- a/cmake/abseil-cpp.cmake
@ -10,16 +32,3 @@ index 078d495..b6f50bd 100644
+ add_definitions(-DGPR_ABSEIL_SYNC=1)
+ endif()
endif()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index df1703c..7667662 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1464,6 +1464,8 @@ target_link_libraries(gpr
absl::str_format
absl::strings
absl::optional
+ absl::time
+ absl::synchronization
)
if(_gRPC_PLATFORM_ANDROID)
target_link_libraries(gpr

View File

@ -1,5 +1,5 @@
Source: grpc
Version: 1.28.1-1
Version: 1.29.1
Build-Depends: zlib, openssl, protobuf, c-ares (!uwp), upb, abseil
Homepage: https://github.com/grpc/grpc
Description: An RPC library and framework

View File

@ -5,8 +5,8 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO grpc/grpc
REF cb81fe0dfaa424eb50de26fb7c904a27a78c3f76 #v1.28.1
SHA512 ff33c1afe413475846f53fd6b6921323019a6da2218fe4827e43e390e04ea073d8e56b0a9b32015233106a6d90a83eff0fa631df37a96036a9c810a4dc32ea4f
REF 7d89dbb311f049b43bda7bbf6f7d7bf1b4c24419 #v1.29.1
SHA512 403fa5e3f012786bb17ca32c760b6dfb22c5a5cfb473ba7fad657e26ab3986eb0203f7cbb501a8647fd5ef2571e5f4ee08c2c97d1dfda18ec5ab6a92c9fc3263
HEAD_REF master
PATCHES
00001-fix-uwp.patch
@ -50,6 +50,7 @@ vcpkg_configure_cmake(
-DgRPC_SSL_PROVIDER=package
-DgRPC_PROTOBUF_PROVIDER=package
-DgRPC_ABSL_PROVIDER=package
-DgRPC_UPB_PROVIDER=package
-DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG
-DgRPC_CARES_PROVIDER=${cares_CARES_PROVIDER}
-DgRPC_GFLAGS_PROVIDER=none

View File

@ -1,5 +1,5 @@
Source: offscale-libetcd-cpp
Version: 2019-07-10
Version: 2019-07-10-1
Homepage: https://github.com/offscale/libetcd-cpp
Description: A C++ client library for etcd. etcd is a distributed, reliable key-value store.
Build-Depends: grpc, protobuf

View File

@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0d9aad9..d68c5f7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,7 +70,7 @@ endif()
target_include_directories(etcdcpp PRIVATE "generated/")
target_include_directories(etcdcpp INTERFACE "${CMAKE_INSTALL_PREFIX}/include")
-target_link_libraries(etcdcpp PRIVATE gRPC::gpr gRPC::grpc gRPC::grpc++ gRPC::grpc_cronet)
+target_link_libraries(etcdcpp PRIVATE gRPC::gpr gRPC::grpc gRPC::grpc++ gRPC::grpc++_alts)
target_link_libraries(etcdcpp PRIVATE protobuf::libprotoc protobuf::libprotobuf)
install(TARGETS etcdcpp EXPORT etcdcpp DESTINATION lib)

View File

@ -1,11 +1,10 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO offscale/libetcd-cpp
REF 8607d8d7080c6eb447bc41b799a24bfdb87cf638
SHA512 9bf4bf14fd52f4f6bbf8cf68de61e6a19eeffbdc501f05c8f614b5f13f206410884afd7fe226a077448e58e02990c65a6b27ee895ed34ba5ee701abe0500b875
HEAD_REF master
PATCHES fix-dependency-grpc.patch
)
vcpkg_configure_cmake(
@ -14,6 +13,6 @@ vcpkg_configure_cmake(
)
vcpkg_install_cmake()
file(INSTALL ${SOURCE_PATH}/LICENSE-MIT DESTINATION ${CURRENT_PACKAGES_DIR}/share/offscale-libetcd-cpp RENAME copyright)
vcpkg_copy_pdbs()
file(INSTALL ${SOURCE_PATH}/LICENSE-MIT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)