From e4096d6c17799638de97ceca4583d9adfc54b87b Mon Sep 17 00:00:00 2001 From: ras0219 <533828+ras0219@users.noreply.github.com> Date: Fri, 23 Apr 2021 10:40:07 -0700 Subject: [grpc][upb] Update to newer versions (#17422) * [gRPC] 1.36.4 * [upb] update to 2020-12-19 * update version * [upb] Fix config.cmake file * [grpc] Restore using system upb * [grpc][upb] Version db changes * [grpc][upb] Fix building upbdefs in grpc Co-authored-by: Jeong YunWon Co-authored-by: Jonliu1993 <13720414433@163.com> --- ports/grpc/00009-use-system-upb.patch | 32 ++++++++--------- ports/grpc/00010-add-feature-absl-sync.patch | 14 ++++---- ports/grpc/00013-build-upbdefs.patch | 28 +++++++++++++++ ports/grpc/portfile.cmake | 11 +++--- ports/grpc/vcpkg.json | 3 +- ports/upb/CONTROL | 4 --- ports/upb/add-all-libs-target.patch | 52 ++++++++++++++++++++++++++++ ports/upb/add-cmake-install.patch | 40 ++++++++------------- ports/upb/fix-uwp.patch | 16 ++++----- ports/upb/no-wyhash.patch | 13 +++++++ ports/upb/portfile.cmake | 14 ++++---- ports/upb/vcpkg.json | 6 ++++ versions/baseline.json | 6 ++-- versions/g-/grpc.json | 5 +++ versions/u-/upb.json | 5 +++ 15 files changed, 172 insertions(+), 77 deletions(-) create mode 100644 ports/grpc/00013-build-upbdefs.patch delete mode 100644 ports/upb/CONTROL create mode 100644 ports/upb/add-all-libs-target.patch create mode 100644 ports/upb/no-wyhash.patch create mode 100644 ports/upb/vcpkg.json diff --git a/ports/grpc/00009-use-system-upb.patch b/ports/grpc/00009-use-system-upb.patch index 1e5f9a721..e927d6d0e 100644 --- a/ports/grpc/00009-use-system-upb.patch +++ b/ports/grpc/00009-use-system-upb.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index ec1714687e..e15d25097f 100644 +index c848b50605..7822c4f713 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,9 @@ set_property(CACHE gRPC_SSL_PROVIDER PROPERTY STRINGS "module" "package") @@ -12,15 +12,15 @@ index ec1714687e..e15d25097f 100644 set(gRPC_PROTOBUF_PACKAGE_TYPE "" CACHE STRING "Algorithm for searching protobuf package") set_property(CACHE gRPC_PROTOBUF_PACKAGE_TYPE PROPERTY STRINGS "CONFIG" "MODULE") -@@ -1911,7 +1914,6 @@ target_link_libraries(grpc +@@ -2037,7 +2040,6 @@ target_link_libraries(grpc ${_gRPC_ALLTARGETS_LIBRARIES} gpr address_sorting - upb absl::optional absl::strings - absl::status -@@ -1993,7 +1995,6 @@ target_link_libraries(grpc_csharp_ext + absl::statusor +@@ -2122,7 +2124,6 @@ target_link_libraries(grpc_csharp_ext grpc gpr address_sorting @@ -28,15 +28,15 @@ index ec1714687e..e15d25097f 100644 ) -@@ -2463,7 +2464,6 @@ target_link_libraries(grpc_unsecure +@@ -2590,7 +2591,6 @@ target_link_libraries(grpc_unsecure ${_gRPC_ALLTARGETS_LIBRARIES} gpr address_sorting - upb absl::optional absl::strings - absl::status -@@ -2661,7 +2661,6 @@ target_link_libraries(grpc++ + absl::statusor +@@ -2792,7 +2792,6 @@ target_link_libraries(grpc++ grpc gpr address_sorting @@ -44,7 +44,7 @@ index ec1714687e..e15d25097f 100644 ) foreach(_hdr -@@ -2907,7 +2906,6 @@ target_link_libraries(grpc++_alts +@@ -3040,7 +3039,6 @@ target_link_libraries(grpc++_alts grpc gpr address_sorting @@ -52,7 +52,7 @@ index ec1714687e..e15d25097f 100644 ) foreach(_hdr -@@ -2976,7 +2974,6 @@ target_link_libraries(grpc++_error_details +@@ -3104,7 +3102,6 @@ target_link_libraries(grpc++_error_details grpc gpr address_sorting @@ -60,7 +60,7 @@ index ec1714687e..e15d25097f 100644 ) foreach(_hdr -@@ -3049,7 +3046,6 @@ target_link_libraries(grpc++_reflection +@@ -3174,7 +3171,6 @@ target_link_libraries(grpc++_reflection grpc gpr address_sorting @@ -68,7 +68,7 @@ index ec1714687e..e15d25097f 100644 ) foreach(_hdr -@@ -3330,7 +3326,6 @@ target_link_libraries(grpc++_unsecure +@@ -3454,7 +3450,6 @@ target_link_libraries(grpc++_unsecure grpc_unsecure gpr address_sorting @@ -76,7 +76,7 @@ index ec1714687e..e15d25097f 100644 ) foreach(_hdr -@@ -3648,7 +3643,6 @@ target_link_libraries(grpcpp_channelz +@@ -3773,7 +3768,6 @@ target_link_libraries(grpcpp_channelz grpc gpr address_sorting @@ -84,15 +84,15 @@ index ec1714687e..e15d25097f 100644 ) foreach(_hdr -@@ -3675,6 +3669,7 @@ endif() +@@ -3799,6 +3793,7 @@ endif() endif() +if (gRPC_UPB_PROVIDER STREQUAL "module") add_library(upb + third_party/upb/upb/decode_fast.c third_party/upb/upb/decode.c - third_party/upb/upb/encode.c -@@ -3726,7 +3721,7 @@ if(gRPC_INSTALL) +@@ -3857,7 +3852,7 @@ if(gRPC_INSTALL) ) endif() @@ -121,7 +121,7 @@ index f2a0e508c3..ecce7ba300 100644 # See the License for the specific language governing permissions and # limitations under the License. -+set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated") ++set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-generated") +if (gRPC_UPB_PROVIDER STREQUAL "module") + set(UPB_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/upb) diff --git a/ports/grpc/00010-add-feature-absl-sync.patch b/ports/grpc/00010-add-feature-absl-sync.patch index 8e49e83bb..508461843 100644 --- a/ports/grpc/00010-add-feature-absl-sync.patch +++ b/ports/grpc/00010-add-feature-absl-sync.patch @@ -1,25 +1,25 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index e15d25097f..ae77375eae 100644 +index 7822c4f713..4cb75e6eea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1919,6 +1919,8 @@ target_link_libraries(grpc - absl::status +@@ -2047,6 +2047,8 @@ target_link_libraries(grpc + absl::bind_front absl::inlined_vector absl::flat_hash_set + absl::time + absl::synchronization + absl::flat_hash_map ) if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) - target_link_libraries(grpc "-framework CoreFoundation") -@@ -2468,6 +2470,8 @@ target_link_libraries(grpc_unsecure - absl::strings +@@ -2596,6 +2598,8 @@ target_link_libraries(grpc_unsecure + absl::statusor absl::status absl::inlined_vector + absl::time + absl::synchronization + absl::flat_hash_map ) 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 078d495417..b6f50bd14c 100644 --- a/cmake/abseil-cpp.cmake diff --git a/ports/grpc/00013-build-upbdefs.patch b/ports/grpc/00013-build-upbdefs.patch new file mode 100644 index 000000000..9a601ec5a --- /dev/null +++ b/ports/grpc/00013-build-upbdefs.patch @@ -0,0 +1,28 @@ +diff --git a/cmake/upb.cmake b/cmake/upb.cmake +index 59d6813..1ce8bce 100644 +--- a/cmake/upb.cmake ++++ b/cmake/upb.cmake +@@ -24,8 +24,21 @@ 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_LIBRARIES upb) + set(_gRPC_UPB_INCLUDE_DIR) +- set(upb ${_gRPC_UPB_LIBRARIES}) ++ add_library(upb STATIC ++ ${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c ++ ${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c ++ ) ++ set_target_properties(upb PROPERTIES OUTPUT_NAME grpc_upbdefs) ++ target_include_directories(upb PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-generated") ++ target_link_libraries(upb PUBLIC upb::all_libs) ++ if(gRPC_INSTALL) ++ install(TARGETS upb EXPORT gRPCTargets ++ RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} ++ ) ++ endif() + set(_gRPC_FIND_UPB "if(NOT upb_FOUND)\n find_package(upb CONFIG REQUIRED)\nendif()") + endif() diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index 8102f4492..249d9ef17 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -5,8 +5,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO grpc/grpc - REF 054ff69350dfea1876f388e7cf05f19d5d76bc12 # v1.33.1 - SHA512 d81c26e996f8a4386a432fc98ba0982c9a15e8cb470eb544f82dc81df5a8f79401343d209f3aa75598fbb8b99cc05dcd2a0e616967d5e0464bed4a4464d7fdc1 + REF 3e53dbe8213137d2c731ecd4d88ebd2948941d75 # v1.36.4 + SHA512 c207720a66dae97727e94f2587d6be8e4cb479997cc0815a15f5465ff94f6d0b410523e3fed2dd31385cc9d50ab52dfe39b6095257d6ce9a71184ada6ef0ff7e HEAD_REF master PATCHES 00001-fix-uwp.patch @@ -19,6 +19,7 @@ vcpkg_from_github( 00011-fix-csharp_plugin.patch snprintf.patch 00012-fix-use-cxx17.patch + 00013-build-upbdefs.patch ) if(TARGET_TRIPLET STREQUAL HOST_TRIPLET) @@ -37,8 +38,10 @@ else() set(cares_CARES_PROVIDER "package") endif() -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - absl-sync gRPC_ABSL_SYNC_ENABLE +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + absl-sync gRPC_ABSL_SYNC_ENABLE ) vcpkg_configure_cmake( diff --git a/ports/grpc/vcpkg.json b/ports/grpc/vcpkg.json index a639cdccb..4ec5a5b96 100644 --- a/ports/grpc/vcpkg.json +++ b/ports/grpc/vcpkg.json @@ -1,7 +1,6 @@ { "name": "grpc", - "version-string": "1.33.1", - "port-version": 3, + "version-semver": "1.36.4", "description": "An RPC library and framework", "homepage": "https://github.com/grpc/grpc", "dependencies": [ diff --git a/ports/upb/CONTROL b/ports/upb/CONTROL deleted file mode 100644 index a24ac31ab..000000000 --- a/ports/upb/CONTROL +++ /dev/null @@ -1,4 +0,0 @@ -Source: upb -Version: 2020-08-19 -Homepage: https://github.com/protocolbuffers/upb/ -Description: μpb (often written 'upb') is a small protobuf implementation written in C. diff --git a/ports/upb/add-all-libs-target.patch b/ports/upb/add-all-libs-target.patch new file mode 100644 index 000000000..701004b17 --- /dev/null +++ b/ports/upb/add-all-libs-target.patch @@ -0,0 +1,52 @@ +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index 0155a7b..7850b2d 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -66,7 +66,7 @@ endif() + enable_testing() + + add_library(port INTERFACE) +-add_library(descriptor_upbproto INTERFACE) ++add_library(descriptor_upb_proto INTERFACE) + add_library(upb + ../upb/decode.c + ../upb/decode.int.h +@@ -167,6 +167,25 @@ target_link_libraries(upb_json + upb_pb) + add_library(wyhash INTERFACE) + ++add_library(all_libs INTERFACE) ++target_link_libraries(all_libs ++ INTERFACE ++ upb ++ fastdecode ++ upb_json ++ upb_pb ++ port ++ table ++ descriptor_upb_proto ++ handlers ++ reflection ++ textformat ++) ++set_target_properties(reflection PROPERTIES OUTPUT_NAME upb_reflection) ++set_target_properties(handlers PROPERTIES OUTPUT_NAME upb_handlers) ++set_target_properties(fastdecode PROPERTIES OUTPUT_NAME upb_fastdecode) ++set_target_properties(textformat PROPERTIES OUTPUT_NAME upb_textformat) ++ + install( + DIRECTORY ../upb + DESTINATION include +@@ -184,9 +203,11 @@ install(TARGETS + upb_pb + port + table +- descriptor_upbproto ++ descriptor_upb_proto + handlers + reflection ++ textformat ++ all_libs + EXPORT upb-config + ) + install(EXPORT upb-config NAMESPACE upb:: DESTINATION share/upb) diff --git a/ports/upb/add-cmake-install.patch b/ports/upb/add-cmake-install.patch index cdda03407..0cc9aba3e 100644 --- a/ports/upb/add-cmake-install.patch +++ b/ports/upb/add-cmake-install.patch @@ -1,7 +1,7 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4dd6454..eda6a72 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index d4cbcc9..a6b432f 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt @@ -8,7 +8,7 @@ else() cmake_policy(VERSION 3.12) endif() @@ -11,31 +11,20 @@ index 4dd6454..eda6a72 100644 cmake_policy(SET CMP0048 NEW) project(upb) -@@ -62,6 +62,7 @@ enable_testing() +@@ -62,6 +62,7 @@ endif() + enable_testing() - add_library(port - upb/port.c) + add_library(port INTERFACE) +add_library(descriptor_upbproto INTERFACE) add_library(upb - upb/decode.c - upb/encode.c -@@ -154,6 +155,7 @@ target_link_libraries(upb_cc_bindings INTERFACE - handlers - port - upb) -+if(ENABLE_TESTING) - add_library(upb_test - tests/testmain.cc - tests/test_util.h -@@ -162,5 +164,28 @@ target_link_libraries(upb_test - handlers - port - upb) -+endif() + ../upb/decode.c + ../upb/decode.int.h +@@ -162,4 +163,27 @@ target_link_libraries(upb_json + upb_pb) + add_library(wyhash INTERFACE) -- +install( -+ DIRECTORY upb ++ DIRECTORY ../upb + DESTINATION include + FILES_MATCHING + PATTERN "*.h" @@ -46,7 +35,7 @@ index 4dd6454..eda6a72 100644 +target_include_directories(upb PUBLIC $) +install(TARGETS + upb -+ upb_cc_bindings ++ fastdecode + upb_json + upb_pb + port @@ -57,3 +46,4 @@ index 4dd6454..eda6a72 100644 + EXPORT upb-config +) +install(EXPORT upb-config NAMESPACE upb:: DESTINATION share/upb) + diff --git a/ports/upb/fix-uwp.patch b/ports/upb/fix-uwp.patch index bbc8e257a..cbd62f602 100644 --- a/ports/upb/fix-uwp.patch +++ b/ports/upb/fix-uwp.patch @@ -1,8 +1,8 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index eda6a72..386966f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -58,6 +58,10 @@ elseif(UNIX) +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index a6b432f..003615e 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -59,6 +59,10 @@ elseif(UNIX) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--build-id") endif() @@ -12,12 +12,12 @@ index eda6a72..386966f 100644 + enable_testing() - add_library(port + add_library(port INTERFACE) diff --git a/upb/json_decode.c b/upb/json_decode.c -index 953d238..5185ffd 100644 +index bb33744..1fadd26 100644 --- a/upb/json_decode.c +++ b/upb/json_decode.c -@@ -1138,7 +1138,7 @@ static void jsondec_struct(jsondec *d, upb_msg *msg, const upb_msgdef *m) { +@@ -1160,7 +1160,7 @@ static void jsondec_struct(jsondec *d, upb_msg *msg, const upb_msgdef *m) { static void jsondec_wellknownvalue(jsondec *d, upb_msg *msg, const upb_msgdef *m) { upb_msgval val; diff --git a/ports/upb/no-wyhash.patch b/ports/upb/no-wyhash.patch new file mode 100644 index 000000000..e9754eedb --- /dev/null +++ b/ports/upb/no-wyhash.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index ed494d9..0155a7b 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -84,7 +84,7 @@ add_library(upb + target_link_libraries(upb + fastdecode + port +- /third_party/wyhash) ++ ) + add_library(fastdecode + ../upb/decode.int.h + ../upb/decode_fast.c diff --git a/ports/upb/portfile.cmake b/ports/upb/portfile.cmake index fdb59441f..13fdc7290 100644 --- a/ports/upb/portfile.cmake +++ b/ports/upb/portfile.cmake @@ -3,16 +3,18 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO protocolbuffers/upb - REF 7338facddb8ce405fe7a0a52a6061a1e7c823279 - SHA512 a2ece65612ca7c3cdc7b79994aa488623e5ce4227988611ab60724fae5dc7ba9311363bf5c73f6c74910a6b91392e0a231c28f0b2f4c8cc2c4d4328ed33bc265 + REF 60607da72e89ba0c84c84054d2e562d8b6b61177 # 2020-12-19 + SHA512 d7de03f4a4024136ecccbcd3381058f26ace480f1817cbc1874a8ed4abbbad58dcf61cc77220400004927ab8e8c95ab5a2e1f27172ee3ed3bbd3f1dda2dda07c HEAD_REF master PATCHES add-cmake-install.patch fix-uwp.patch + no-wyhash.patch + add-all-libs-target.patch ) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH ${SOURCE_PATH}/cmake PREFER_NINJA ) @@ -20,10 +22,6 @@ vcpkg_install_cmake() vcpkg_fixup_cmake_targets() vcpkg_copy_pdbs() -file(REMOVE_RECURSE - ${CURRENT_PACKAGES_DIR}/debug/include - # empty folder - ${CURRENT_PACKAGES_DIR}/include/upb/bindings/lua/upb -) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/upb/vcpkg.json b/ports/upb/vcpkg.json new file mode 100644 index 000000000..3213d796f --- /dev/null +++ b/ports/upb/vcpkg.json @@ -0,0 +1,6 @@ +{ + "name": "upb", + "version-date": "2020-12-19", + "description": "μpb (often written 'upb') is a small protobuf implementation written in C.", + "homepage": "https://github.com/protocolbuffers/upb/" +} diff --git a/versions/baseline.json b/versions/baseline.json index 470d5dfa2..b815e3b96 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2357,8 +2357,8 @@ "port-version": 0 }, "grpc": { - "baseline": "1.33.1", - "port-version": 3 + "baseline": "1.36.4", + "port-version": 0 }, "grppi": { "baseline": "0.4.0", @@ -6197,7 +6197,7 @@ "port-version": 0 }, "upb": { - "baseline": "2020-08-19", + "baseline": "2020-12-19", "port-version": 0 }, "urdfdom": { diff --git a/versions/g-/grpc.json b/versions/g-/grpc.json index 9d5f0da11..f0b14b8e5 100644 --- a/versions/g-/grpc.json +++ b/versions/g-/grpc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "437c7b28d6eb5054924c3c00e529a32aef74b437", + "version-semver": "1.36.4", + "port-version": 0 + }, { "git-tree": "1d0adf4a9c4f719dd9d0d22dd2bd58ba34ff921c", "version-string": "1.33.1", diff --git a/versions/u-/upb.json b/versions/u-/upb.json index 2de347e66..bbe7a8b07 100644 --- a/versions/u-/upb.json +++ b/versions/u-/upb.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8c7a75bb8754caa918eddfd0e6f9457834e81f64", + "version-date": "2020-12-19", + "port-version": 0 + }, { "git-tree": "f62deabc33313987277b9c9b6fec1498d87f9164", "version-string": "2020-08-19", -- cgit v1.2.3