From ef3b89504df61acc36f786a7aeba7ef442f68ce3 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Tue, 19 Oct 2021 11:03:22 +0800 Subject: [PATCH 01/25] [gRPC] update to v1.41.0 --- .../{snprintf.patch => 00006-snprintf.patch} | 24 +++++++------- ports/grpc/00009-use-system-upb.patch | 32 +++++++------------ ports/grpc/00010-add-feature-absl-sync.patch | 26 +++++++-------- ports/grpc/00014-pkgconfig-upbdefs.patch | 26 +++++++-------- ports/grpc/portfile.cmake | 27 +++++++--------- ports/grpc/vcpkg.json | 11 +++++-- 6 files changed, 71 insertions(+), 75 deletions(-) rename ports/grpc/{snprintf.patch => 00006-snprintf.patch} (76%) diff --git a/ports/grpc/snprintf.patch b/ports/grpc/00006-snprintf.patch similarity index 76% rename from ports/grpc/snprintf.patch rename to ports/grpc/00006-snprintf.patch index d1fd52e48d893f..948f2c9345c3bc 100644 --- a/ports/grpc/snprintf.patch +++ b/ports/grpc/00006-snprintf.patch @@ -1,12 +1,12 @@ -diff --git a/src/core/tsi/alts/crypt/aes_gcm.cc b/src/core/tsi/alts/crypt/aes_gcm.cc -index 02b1ac4492..191f462277 100644 ---- a/src/core/tsi/alts/crypt/aes_gcm.cc -+++ b/src/core/tsi/alts/crypt/aes_gcm.cc -@@ -26,6 +26,7 @@ - #include - #include - #include -+#include - - #include - +diff --git a/src/core/tsi/alts/crypt/aes_gcm.cc b/src/core/tsi/alts/crypt/aes_gcm.cc +index b761224..70d1696 100644 +--- a/src/core/tsi/alts/crypt/aes_gcm.cc ++++ b/src/core/tsi/alts/crypt/aes_gcm.cc +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #include + diff --git a/ports/grpc/00009-use-system-upb.patch b/ports/grpc/00009-use-system-upb.patch index 32946ceef92823..e40b27dbbfbf8f 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 c87e35a..24b619f 100644 +index 1c3146b..ae06ea3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,9 @@ set_property(CACHE gRPC_SSL_PROVIDER PROPERTY STRINGS "module" "package") @@ -12,32 +12,23 @@ index c87e35a..24b619f 100644 set(gRPC_PROTOBUF_PACKAGE_TYPE "" CACHE STRING "Algorithm for searching protobuf package") set_property(CACHE gRPC_PROTOBUF_PACKAGE_TYPE PROPERTY STRINGS "CONFIG" "MODULE") -@@ -2079,7 +2082,6 @@ target_link_libraries(grpc - gpr - ${_gRPC_SSL_LIBRARIES} - address_sorting +@@ -1504,7 +1507,6 @@ target_link_libraries(gpr + absl::synchronization + absl::time + absl::optional - upb ) - if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) - target_link_libraries(grpc "-framework CoreFoundation") -@@ -2624,7 +2626,6 @@ target_link_libraries(grpc_unsecure - absl::statusor - gpr - address_sorting -- upb - ) - if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) - target_link_libraries(grpc_unsecure "-framework CoreFoundation") -@@ -3805,7 +3806,7 @@ if(gRPC_INSTALL) - endif() + if(_gRPC_PLATFORM_ANDROID) + target_link_libraries(gpr +@@ -3927,6 +3929,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 -@@ -3863,7 +3864,7 @@ if(gRPC_INSTALL) +@@ -3984,7 +3987,7 @@ if(gRPC_INSTALL) ) endif() @@ -59,7 +50,7 @@ index 3623f4a..df6ced5 100644 # Targets include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake) diff --git a/cmake/upb.cmake b/cmake/upb.cmake -index f2a0e50..c1c65f5 100644 +index f2a0e50..ac6d397 100644 --- a/cmake/upb.cmake +++ b/cmake/upb.cmake @@ -12,9 +12,21 @@ @@ -84,3 +75,4 @@ index f2a0e50..c1c65f5 100644 + set(upb ${_gRPC_UPB_LIBRARIES}) + set(_gRPC_FIND_UPB "if(NOT upb_FOUND)\n find_package(upb CONFIG REQUIRED)\nendif()") +endif() +\ No newline at end of file diff --git a/ports/grpc/00010-add-feature-absl-sync.patch b/ports/grpc/00010-add-feature-absl-sync.patch index e208070a9f960f..6479c9feee6ccf 100644 --- a/ports/grpc/00010-add-feature-absl-sync.patch +++ b/ports/grpc/00010-add-feature-absl-sync.patch @@ -1,34 +1,34 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 24b619f..f7a11b9 100644 +index ae06ea3..8b64438 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -2076,6 +2076,8 @@ target_link_libraries(grpc +@@ -2180,6 +2180,8 @@ target_link_libraries(grpc ${_gRPC_UPB_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} absl::flat_hash_map + absl::time -+ absl::synchronization ++ absl::synchronization absl::inlined_vector absl::bind_front absl::statusor -@@ -2623,6 +2625,8 @@ target_link_libraries(grpc_unsecure +@@ -2733,6 +2735,8 @@ target_link_libraries(grpc_unsecure + ${_gRPC_UPB_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES} absl::flat_hash_map - absl::inlined_vector + absl::time -+ absl::synchronization ++ absl::synchronization + absl::inlined_vector + absl::bind_front absl::statusor - gpr - address_sorting diff --git a/cmake/abseil-cpp.cmake b/cmake/abseil-cpp.cmake -index 078d495..b6f50bd 100644 +index c89ba26..68ae4fd 100644 --- a/cmake/abseil-cpp.cmake +++ b/cmake/abseil-cpp.cmake -@@ -37,4 +37,7 @@ elseif(gRPC_ABSL_PROVIDER STREQUAL "package") - # Use "CONFIG" as there is no built-in cmake module for absl. +@@ -35,3 +35,6 @@ elseif(gRPC_ABSL_PROVIDER STREQUAL "package") find_package(absl REQUIRED CONFIG) - set(_gRPC_FIND_ABSL "if(NOT absl_FOUND)\n find_package(absl CONFIG)\nendif()") + endif() + set(_gRPC_FIND_ABSL "if(NOT TARGET absl::strings)\n find_package(absl CONFIG)\nendif()") + if (gRPC_ABSL_SYNC_ENABLE) + add_definitions(-DGPR_ABSEIL_SYNC=1) + endif() - endif() +\ No newline at end of file diff --git a/ports/grpc/00014-pkgconfig-upbdefs.patch b/ports/grpc/00014-pkgconfig-upbdefs.patch index af4299acc43b47..8b687ee6f2fb08 100644 --- a/ports/grpc/00014-pkgconfig-upbdefs.patch +++ b/ports/grpc/00014-pkgconfig-upbdefs.patch @@ -1,13 +1,13 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3808016..059a16b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -15516,7 +15516,7 @@ generate_pkgconfig( - "high performance general RPC framework" - "${gRPC_CORE_VERSION}" - "gpr openssl" -- "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz -labsl_statusor -labsl_status -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_synchronization -labsl_time -labsl_time_zone -labsl_civil_time -labsl_graphcycles_internal -labsl_symbolize -labsl_demangle_internal -labsl_malloc_internal -labsl_stacktrace -labsl_debugging_internal -labsl_exponential_biased -labsl_cord -labsl_str_format_internal -labsl_hash -labsl_bad_variant_access -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_base -labsl_spinlock_wait -labsl_int128 -labsl_city -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity" -+ "-lgrpc -lgrpc_upbdefs -laddress_sorting -lre2 -lupb_fastdecode -lupb_json -lupb_pb -lupb_handlers -lupb_textformat -lupb_reflection -lupb -lcares -lz -labsl_statusor -labsl_status -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_synchronization -labsl_time -labsl_time_zone -labsl_civil_time -labsl_graphcycles_internal -labsl_symbolize -labsl_demangle_internal -labsl_malloc_internal -labsl_stacktrace -labsl_debugging_internal -labsl_exponential_biased -labsl_cord -labsl_str_format_internal -labsl_hash -labsl_bad_variant_access -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_base -labsl_spinlock_wait -labsl_int128 -labsl_city -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity" - "" - "grpc.pc") - +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 01988c2..b304cc9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17705,7 +17705,7 @@ generate_pkgconfig( + "high performance general RPC framework" + "${gRPC_CORE_VERSION}" + "gpr openssl absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_variant" +- "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz" ++ "-lgrpc -lgrpc_upbdefs -laddress_sorting -lre2 -lupb_fastdecode -lupb_json -lupb_pb -lupb_handlers -lupb_textformat -lupb_reflection -lupb -lcares -lz -labsl_statusor -labsl_status -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_synchronization -labsl_time -labsl_time_zone -labsl_civil_time -labsl_graphcycles_internal -labsl_symbolize -labsl_demangle_internal -labsl_malloc_internal -labsl_stacktrace -labsl_debugging_internal -labsl_exponential_biased -labsl_cord -labsl_str_format_internal -labsl_hash -labsl_bad_variant_access -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_base -labsl_spinlock_wait -labsl_int128 -labsl_city -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity" + "" + "grpc.pc") + diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index 39aa2c5a95de81..5c3a0340887efe 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 44c40ac23023b7b3dd82744372c06817cc203898 # v1.37.0 - SHA512 dacd85b3a94cb759a086239aa2661f1b93728a1554ebc0f10c42aeb49c0d6309963832324773c3a153c3d2fcf807cb55b0e197b128e0a4e199c9e19a3976abd6 + REF fc662b7964384b701af5bd3ce6994d2180080eb4 # v1.41.0 + SHA512 ebb534b5d55f1a84c5ee2ea75f2ef871819d278966dec2610877c2f8ddd87bae80a63cbab0393fb37b81844f261327848821ac641b55963583288e6ec3b94e62 HEAD_REF master PATCHES 00001-fix-uwp.patch @@ -17,7 +17,7 @@ vcpkg_from_github( 00009-use-system-upb.patch 00010-add-feature-absl-sync.patch 00011-fix-csharp_plugin.patch - snprintf.patch + 00006-snprintf.patch 00012-fix-use-cxx17.patch 00013-build-upbdefs.patch 00014-pkgconfig-upbdefs.patch @@ -43,9 +43,8 @@ vcpkg_check_features( codegen gRPC_BUILD_CODEGEN ) -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" OPTIONS ${FEATURE_OPTIONS} -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF @@ -59,20 +58,18 @@ vcpkg_configure_cmake( -DgRPC_RE2_PROVIDER=package -DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG -DgRPC_CARES_PROVIDER=${cares_CARES_PROVIDER} - -DgRPC_GFLAGS_PROVIDER=none -DgRPC_BENCHMARK_PROVIDER=none - -DgRPC_INSTALL_CSHARP_EXT=OFF -DgRPC_INSTALL_BINDIR:STRING=bin -DgRPC_INSTALL_LIBDIR:STRING=lib -DgRPC_INSTALL_INCLUDEDIR:STRING=include -DgRPC_INSTALL_CMAKEDIR:STRING=share/grpc - -D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX} - -DPROTOBUF_PROTOC_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX} + -D_gRPC_PROTOBUF_PROTOC_EXECUTABLE="${CURRENT_HOST_INSTALLED_DIR}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}" + -DPROTOBUF_PROTOC_EXECUTABLE="${CURRENT_HOST_INSTALLED_DIR}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}" ) -vcpkg_install_cmake(ADD_BIN_TO_PATH) +vcpkg_cmake_install(ADD_BIN_TO_PATH) -vcpkg_fixup_cmake_targets() +vcpkg_cmake_fixup_config() if (gRPC_BUILD_CODEGEN) vcpkg_copy_tools( @@ -87,14 +84,14 @@ if (gRPC_BUILD_CODEGEN) grpc_ruby_plugin ) else() - configure_file(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets-vcpkg-tools.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-vcpkg-tools.cmake @ONLY) + configure_file("${CMAKE_CURRENT_LIST_DIR}/gRPCTargets-vcpkg-tools.cmake" "${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-vcpkg-tools.cmake" @ONLY) endif() # Ignore the C# extension DLL in bin/ SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") vcpkg_copy_pdbs() -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY) diff --git a/ports/grpc/vcpkg.json b/ports/grpc/vcpkg.json index 5d85d18445cbed..e8577e6dea1b12 100644 --- a/ports/grpc/vcpkg.json +++ b/ports/grpc/vcpkg.json @@ -1,7 +1,6 @@ { "name": "grpc", - "version-semver": "1.37.0", - "port-version": 4, + "version-semver": "1.41.0", "description": "An RPC library and framework", "homepage": "https://github.com/grpc/grpc", "dependencies": [ @@ -25,6 +24,14 @@ }, "re2", "upb", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, "zlib" ], "features": { From e67cf723450a114a1fc9d997e654f2021820c340 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Tue, 19 Oct 2021 11:04:36 +0800 Subject: [PATCH 02/25] update version --- versions/baseline.json | 4 ++-- versions/g-/grpc.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 98c8f02ca9f56b..6fc0f76e80bba2 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2541,8 +2541,8 @@ "port-version": 0 }, "grpc": { - "baseline": "1.37.0", - "port-version": 4 + "baseline": "1.41.0", + "port-version": 0 }, "grppi": { "baseline": "0.4.0", diff --git a/versions/g-/grpc.json b/versions/g-/grpc.json index 0be49e1e154c65..1eb6f42a6eed74 100644 --- a/versions/g-/grpc.json +++ b/versions/g-/grpc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "e5cb5b31396a55b540e75ea53a315e2d6a3103c3", + "version-semver": "1.41.0", + "port-version": 0 + }, { "git-tree": "ad418bfacbcb3e9e82440612ad66104f6692cae4", "version-semver": "1.37.0", From 0c962ac708cd946d63ddb860dbbebe4b710cb5c0 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Mon, 18 Oct 2021 23:36:06 -0700 Subject: [PATCH 03/25] [upb] Update to 2021-10-19 --- ports/upb/add-all-libs-target.patch | 38 ++++--------- ports/upb/add-cmake-install.patch | 87 +++++++++++++---------------- ports/upb/portfile.cmake | 5 +- ports/upb/vcpkg.json | 3 +- 4 files changed, 51 insertions(+), 82 deletions(-) diff --git a/ports/upb/add-all-libs-target.patch b/ports/upb/add-all-libs-target.patch index 701004b175579f..df1e1bfc031c6f 100644 --- a/ports/upb/add-all-libs-target.patch +++ b/ports/upb/add-all-libs-target.patch @@ -1,52 +1,34 @@ diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt -index 0155a7b..7850b2d 100644 +index b04a937..dcf54e1 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt -@@ -66,7 +66,7 @@ endif() +@@ -66,6 +66,7 @@ endif() enable_testing() add_library(port INTERFACE) --add_library(descriptor_upbproto INTERFACE) -+add_library(descriptor_upb_proto INTERFACE) ++add_library(descriptor_upbproto 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) + ../upb/decode_internal.h +@@ -133,6 +134,21 @@ add_library(table INTERFACE) + target_link_libraries(table INTERFACE + port) +add_library(all_libs INTERFACE) +target_link_libraries(all_libs + INTERFACE + upb + fastdecode -+ upb_json -+ upb_pb ++ json + port + table -+ descriptor_upb_proto -+ handlers ++ descriptor_upbproto + 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 0cc9aba3e87a8a..4810882742f31e 100644 --- a/ports/upb/add-cmake-install.patch +++ b/ports/upb/add-cmake-install.patch @@ -1,49 +1,38 @@ -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() - --cmake_minimum_required (VERSION 3.0) -+cmake_minimum_required (VERSION 3.14) - cmake_policy(SET CMP0048 NEW) - - project(upb) -@@ -62,6 +62,7 @@ endif() - enable_testing() - - add_library(port INTERFACE) -+add_library(descriptor_upbproto INTERFACE) - add_library(upb - ../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 -+ DESTINATION include -+ FILES_MATCHING -+ PATTERN "*.h" -+ PATTERN "*.hpp" -+ PATTERN "*.inc" -+ PATTERN "*.int.h" -+) -+target_include_directories(upb PUBLIC $) -+install(TARGETS -+ upb -+ fastdecode -+ upb_json -+ upb_pb -+ port -+ table -+ descriptor_upbproto -+ handlers -+ reflection -+ EXPORT upb-config -+) -+install(EXPORT upb-config NAMESPACE upb:: DESTINATION share/upb) - +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index 82d518c..dfb0479 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -8,7 +8,7 @@ else() + cmake_policy(VERSION 3.12) + endif() + +-cmake_minimum_required (VERSION 3.0) ++cmake_minimum_required (VERSION 3.14) + cmake_policy(SET CMP0048 NEW) + + project(upb) +@@ -130,3 +130,24 @@ target_link_libraries(table INTERFACE + port) + + ++install( ++ DIRECTORY ../upb ++ DESTINATION include ++ FILES_MATCHING ++ PATTERN "*.h" ++ PATTERN "*.hpp" ++ PATTERN "*.inc" ++ PATTERN "*.int.h" ++) ++target_include_directories(upb PUBLIC $) ++install(TARGETS ++ upb ++ fastdecode ++ json ++ port ++ table ++ descriptor_upbproto ++ reflection ++ EXPORT upb-config ++) ++install(EXPORT upb-config NAMESPACE upb:: DESTINATION share/upb) diff --git a/ports/upb/portfile.cmake b/ports/upb/portfile.cmake index 13fdc729050bb4..8d9369b94a7bfc 100644 --- a/ports/upb/portfile.cmake +++ b/ports/upb/portfile.cmake @@ -3,13 +3,12 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO protocolbuffers/upb - REF 60607da72e89ba0c84c84054d2e562d8b6b61177 # 2020-12-19 - SHA512 d7de03f4a4024136ecccbcd3381058f26ace480f1817cbc1874a8ed4abbbad58dcf61cc77220400004927ab8e8c95ab5a2e1f27172ee3ed3bbd3f1dda2dda07c + REF 160625a9728b4031a21ad1e1c0146ea2c3a851eb # 2021-10-19 + SHA512 13b205dd4278600e6ec05c829dc6c7e449747cccb118a3b83abc0ab5ef0ab180feb364ac84da8075471697fbba798ed3d9d763934d7fe9a64ac0560f5f9d3e83 HEAD_REF master PATCHES add-cmake-install.patch fix-uwp.patch - no-wyhash.patch add-all-libs-target.patch ) diff --git a/ports/upb/vcpkg.json b/ports/upb/vcpkg.json index 058833064dd99f..32cf84091bf47f 100644 --- a/ports/upb/vcpkg.json +++ b/ports/upb/vcpkg.json @@ -1,7 +1,6 @@ { "name": "upb", - "version-date": "2020-12-19", - "port-version": 1, + "version-date": "2021-10-19", "description": "μpb (often written 'upb') is a small protobuf implementation written in C.", "homepage": "https://github.com/protocolbuffers/upb/" } From 9ee97479bac23c7136a418d0c62a8410846fec0a Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Mon, 18 Oct 2021 23:45:07 -0700 Subject: [PATCH 04/25] Update pacth --- ports/upb/add-all-libs-target.patch | 6 ++---- ports/upb/add-cmake-install.patch | 10 ++++++---- ports/upb/portfile.cmake | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ports/upb/add-all-libs-target.patch b/ports/upb/add-all-libs-target.patch index df1e1bfc031c6f..e52250adda97ae 100644 --- a/ports/upb/add-all-libs-target.patch +++ b/ports/upb/add-all-libs-target.patch @@ -1,5 +1,5 @@ diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt -index b04a937..dcf54e1 100644 +index 6b4c50d..f3aca6f 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -66,6 +66,7 @@ endif() @@ -10,7 +10,7 @@ index b04a937..dcf54e1 100644 add_library(upb ../upb/decode.c ../upb/decode_internal.h -@@ -133,6 +134,21 @@ add_library(table INTERFACE) +@@ -133,4 +134,19 @@ add_library(table INTERFACE) target_link_libraries(table INTERFACE port) @@ -30,5 +30,3 @@ index b04a937..dcf54e1 100644 +set_target_properties(fastdecode PROPERTIES OUTPUT_NAME upb_fastdecode) +set_target_properties(textformat PROPERTIES OUTPUT_NAME upb_textformat) - install( - DIRECTORY ../upb diff --git a/ports/upb/add-cmake-install.patch b/ports/upb/add-cmake-install.patch index 4810882742f31e..6f4761eb964590 100644 --- a/ports/upb/add-cmake-install.patch +++ b/ports/upb/add-cmake-install.patch @@ -1,5 +1,5 @@ diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt -index 82d518c..dfb0479 100644 +index f3aca6f..be243c1 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -8,7 +8,7 @@ else() @@ -11,9 +11,9 @@ index 82d518c..dfb0479 100644 cmake_policy(SET CMP0048 NEW) project(upb) -@@ -130,3 +130,24 @@ target_link_libraries(table INTERFACE - port) - +@@ -150,3 +150,26 @@ set_target_properties(reflection PROPERTIES OUTPUT_NAME upb_reflection) + set_target_properties(fastdecode PROPERTIES OUTPUT_NAME upb_fastdecode) + set_target_properties(textformat PROPERTIES OUTPUT_NAME upb_textformat) +install( + DIRECTORY ../upb @@ -33,6 +33,8 @@ index 82d518c..dfb0479 100644 + table + descriptor_upbproto + reflection ++ textformat ++ all_libs + EXPORT upb-config +) +install(EXPORT upb-config NAMESPACE upb:: DESTINATION share/upb) diff --git a/ports/upb/portfile.cmake b/ports/upb/portfile.cmake index 8d9369b94a7bfc..c61dac00295d6f 100644 --- a/ports/upb/portfile.cmake +++ b/ports/upb/portfile.cmake @@ -7,9 +7,9 @@ vcpkg_from_github( SHA512 13b205dd4278600e6ec05c829dc6c7e449747cccb118a3b83abc0ab5ef0ab180feb364ac84da8075471697fbba798ed3d9d763934d7fe9a64ac0560f5f9d3e83 HEAD_REF master PATCHES - add-cmake-install.patch fix-uwp.patch add-all-libs-target.patch + add-cmake-install.patch ) vcpkg_configure_cmake( From 17f09b61adc04c0c59032aaba467513877db8771 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 19 Oct 2021 00:17:57 -0700 Subject: [PATCH 05/25] [upb] Fix upstream bug --- ports/upb/add-all-libs-target.patch | 15 ++++--------- ports/upb/add-cmake-install.patch | 7 +++--- ports/upb/fix-cmakelists.patch | 33 +++++++++++++++++++++++++++++ ports/upb/no-wyhash.patch | 13 ------------ ports/upb/portfile.cmake | 1 + 5 files changed, 42 insertions(+), 27 deletions(-) create mode 100644 ports/upb/fix-cmakelists.patch delete mode 100644 ports/upb/no-wyhash.patch diff --git a/ports/upb/add-all-libs-target.patch b/ports/upb/add-all-libs-target.patch index e52250adda97ae..9a6a6d24272ccf 100644 --- a/ports/upb/add-all-libs-target.patch +++ b/ports/upb/add-all-libs-target.patch @@ -1,16 +1,8 @@ diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt -index 6b4c50d..f3aca6f 100644 +index b4f43f9..c90968f 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt -@@ -66,6 +66,7 @@ endif() - enable_testing() - - add_library(port INTERFACE) -+add_library(descriptor_upbproto INTERFACE) - add_library(upb - ../upb/decode.c - ../upb/decode_internal.h -@@ -133,4 +134,19 @@ add_library(table INTERFACE) +@@ -137,4 +137,20 @@ add_library(table INTERFACE) target_link_libraries(table INTERFACE port) @@ -19,10 +11,11 @@ index 6b4c50d..f3aca6f 100644 + INTERFACE + upb + fastdecode ++ utf8_range + json + port + table -+ descriptor_upbproto ++ descriptor_upb_proto + reflection + textformat +) diff --git a/ports/upb/add-cmake-install.patch b/ports/upb/add-cmake-install.patch index 6f4761eb964590..78043b571bad60 100644 --- a/ports/upb/add-cmake-install.patch +++ b/ports/upb/add-cmake-install.patch @@ -1,5 +1,5 @@ diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt -index f3aca6f..be243c1 100644 +index c90968f..50637ec 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -8,7 +8,7 @@ else() @@ -11,7 +11,7 @@ index f3aca6f..be243c1 100644 cmake_policy(SET CMP0048 NEW) project(upb) -@@ -150,3 +150,26 @@ set_target_properties(reflection PROPERTIES OUTPUT_NAME upb_reflection) +@@ -154,3 +154,27 @@ set_target_properties(reflection PROPERTIES OUTPUT_NAME upb_reflection) set_target_properties(fastdecode PROPERTIES OUTPUT_NAME upb_fastdecode) set_target_properties(textformat PROPERTIES OUTPUT_NAME upb_textformat) @@ -27,11 +27,12 @@ index f3aca6f..be243c1 100644 +target_include_directories(upb PUBLIC $) +install(TARGETS + upb ++ utf8_range + fastdecode + json + port + table -+ descriptor_upbproto ++ descriptor_upb_proto + reflection + textformat + all_libs diff --git a/ports/upb/fix-cmakelists.patch b/ports/upb/fix-cmakelists.patch new file mode 100644 index 00000000000000..2a01d62cc52d50 --- /dev/null +++ b/ports/upb/fix-cmakelists.patch @@ -0,0 +1,33 @@ +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index 6b4c50d..b4f43f9 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -66,6 +66,10 @@ endif() + enable_testing() + + add_library(port INTERFACE) ++add_library(descriptor_upb_proto INTERFACE) ++add_library(utf8_range ++ ../third_party/utf8_range/utf8_range.c ++ ../third_party/utf8_range/utf8_range.h) + add_library(upb + ../upb/decode.c + ../upb/decode_internal.h +@@ -84,7 +88,7 @@ add_library(upb + target_link_libraries(upb + fastdecode + port +- /third_party/utf8_range) ++ utf8_range) + add_library(fastdecode + ../upb/decode.h + ../upb/decode_internal.h +@@ -96,7 +100,7 @@ add_library(fastdecode + target_link_libraries(fastdecode + port + table +- /third_party/utf8_range) ++ utf8_range) + add_library(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE) + target_link_libraries(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE + table diff --git a/ports/upb/no-wyhash.patch b/ports/upb/no-wyhash.patch deleted file mode 100644 index e9754eedb72430..00000000000000 --- a/ports/upb/no-wyhash.patch +++ /dev/null @@ -1,13 +0,0 @@ -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 c61dac00295d6f..a3584a6a93e813 100644 --- a/ports/upb/portfile.cmake +++ b/ports/upb/portfile.cmake @@ -8,6 +8,7 @@ vcpkg_from_github( HEAD_REF master PATCHES fix-uwp.patch + fix-cmakelists.patch add-all-libs-target.patch add-cmake-install.patch ) From ef14ed341e6db03f5c018d3f5f9faad5fee88378 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 19 Oct 2021 00:23:21 -0700 Subject: [PATCH 06/25] Replace depreciate functions --- ports/upb/portfile.cmake | 7 +++---- ports/upb/vcpkg.json | 12 +++++++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ports/upb/portfile.cmake b/ports/upb/portfile.cmake index a3584a6a93e813..6dbd9793b3e2fd 100644 --- a/ports/upb/portfile.cmake +++ b/ports/upb/portfile.cmake @@ -13,13 +13,12 @@ vcpkg_from_github( add-cmake-install.patch ) -vcpkg_configure_cmake( +vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH}/cmake - PREFER_NINJA ) -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets() +vcpkg_cmake_install() +vcpkg_cmake_config_fixup() vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/debug/include) diff --git a/ports/upb/vcpkg.json b/ports/upb/vcpkg.json index 32cf84091bf47f..2f9c034125e43b 100644 --- a/ports/upb/vcpkg.json +++ b/ports/upb/vcpkg.json @@ -2,5 +2,15 @@ "name": "upb", "version-date": "2021-10-19", "description": "μpb (often written 'upb') is a small protobuf implementation written in C.", - "homepage": "https://github.com/protocolbuffers/upb/" + "homepage": "https://github.com/protocolbuffers/upb/", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] } From 38f629d613f85672cab37bbaec0924580419b6da Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 19 Oct 2021 00:24:12 -0700 Subject: [PATCH 07/25] version --- versions/baseline.json | 4 ++-- versions/u-/upb.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index 6fc0f76e80bba2..63b04035835a2c 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6841,8 +6841,8 @@ "port-version": 1 }, "upb": { - "baseline": "2020-12-19", - "port-version": 1 + "baseline": "2021-10-19", + "port-version": 0 }, "urdfdom": { "baseline": "1.0.4", diff --git a/versions/u-/upb.json b/versions/u-/upb.json index 6d0406e44aee57..48bcf9ca3b8787 100644 --- a/versions/u-/upb.json +++ b/versions/u-/upb.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "a91064705abdc7677e30cd0abc6004dfb8770d26", + "version-date": "2021-10-19", + "port-version": 0 + }, { "git-tree": "df35bcef11c276d5cc7280edeca76eeff3dad223", "version-date": "2020-12-19", From f13784b8835d358ce976089f66267f7e0bc375d0 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 19 Oct 2021 00:53:15 -0700 Subject: [PATCH 08/25] fix code --- ports/grpc/portfile.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index 5c3a0340887efe..b860a2ad34a8eb 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -65,11 +65,13 @@ vcpkg_cmake_configure( -DgRPC_INSTALL_CMAKEDIR:STRING=share/grpc -D_gRPC_PROTOBUF_PROTOC_EXECUTABLE="${CURRENT_HOST_INSTALLED_DIR}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}" -DPROTOBUF_PROTOC_EXECUTABLE="${CURRENT_HOST_INSTALLED_DIR}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}" + MAYBE_UNUSED_VARIABLES + gRPC_MSVC_STATIC_RUNTIME ) vcpkg_cmake_install(ADD_BIN_TO_PATH) -vcpkg_cmake_fixup_config() +vcpkg_cmake_config_fixup() if (gRPC_BUILD_CODEGEN) vcpkg_copy_tools( From 4c72afa1ca41e7ea29a1f5d759e1e07675099212 Mon Sep 17 00:00:00 2001 From: JackBoosY Date: Tue, 19 Oct 2021 00:53:28 -0700 Subject: [PATCH 09/25] version --- versions/g-/grpc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/g-/grpc.json b/versions/g-/grpc.json index 1eb6f42a6eed74..33b0da6c5b70e8 100644 --- a/versions/g-/grpc.json +++ b/versions/g-/grpc.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "e5cb5b31396a55b540e75ea53a315e2d6a3103c3", + "git-tree": "f34d6d170a10a8902341177b4d77c064e58a820e", "version-semver": "1.41.0", "port-version": 0 }, From 8c3161540febd60942faed98c6286f963dca5f35 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Wed, 20 Oct 2021 10:00:24 +0800 Subject: [PATCH 10/25] revert patch format --- ports/grpc/00006-snprintf.patch | 24 +++---- ports/grpc/00014-pkgconfig-upbdefs.patch | 26 ++++---- ports/upb/add-cmake-install.patch | 82 ++++++++++++------------ 3 files changed, 66 insertions(+), 66 deletions(-) diff --git a/ports/grpc/00006-snprintf.patch b/ports/grpc/00006-snprintf.patch index 948f2c9345c3bc..93f8350b02c635 100644 --- a/ports/grpc/00006-snprintf.patch +++ b/ports/grpc/00006-snprintf.patch @@ -1,12 +1,12 @@ -diff --git a/src/core/tsi/alts/crypt/aes_gcm.cc b/src/core/tsi/alts/crypt/aes_gcm.cc -index b761224..70d1696 100644 ---- a/src/core/tsi/alts/crypt/aes_gcm.cc -+++ b/src/core/tsi/alts/crypt/aes_gcm.cc -@@ -25,6 +25,7 @@ - #include - #include - #include -+#include - - #include - +diff --git a/src/core/tsi/alts/crypt/aes_gcm.cc b/src/core/tsi/alts/crypt/aes_gcm.cc +index b761224..70d1696 100644 +--- a/src/core/tsi/alts/crypt/aes_gcm.cc ++++ b/src/core/tsi/alts/crypt/aes_gcm.cc +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #include + diff --git a/ports/grpc/00014-pkgconfig-upbdefs.patch b/ports/grpc/00014-pkgconfig-upbdefs.patch index 8b687ee6f2fb08..196c4096ccc3c1 100644 --- a/ports/grpc/00014-pkgconfig-upbdefs.patch +++ b/ports/grpc/00014-pkgconfig-upbdefs.patch @@ -1,13 +1,13 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 01988c2..b304cc9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -17705,7 +17705,7 @@ generate_pkgconfig( - "high performance general RPC framework" - "${gRPC_CORE_VERSION}" - "gpr openssl absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_variant" -- "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz" -+ "-lgrpc -lgrpc_upbdefs -laddress_sorting -lre2 -lupb_fastdecode -lupb_json -lupb_pb -lupb_handlers -lupb_textformat -lupb_reflection -lupb -lcares -lz -labsl_statusor -labsl_status -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_synchronization -labsl_time -labsl_time_zone -labsl_civil_time -labsl_graphcycles_internal -labsl_symbolize -labsl_demangle_internal -labsl_malloc_internal -labsl_stacktrace -labsl_debugging_internal -labsl_exponential_biased -labsl_cord -labsl_str_format_internal -labsl_hash -labsl_bad_variant_access -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_base -labsl_spinlock_wait -labsl_int128 -labsl_city -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity" - "" - "grpc.pc") - +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 01988c2..b304cc9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17705,7 +17705,7 @@ generate_pkgconfig( + "high performance general RPC framework" + "${gRPC_CORE_VERSION}" + "gpr openssl absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_variant" +- "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz" ++ "-lgrpc -lgrpc_upbdefs -laddress_sorting -lre2 -lupb_fastdecode -lupb_json -lupb_pb -lupb_handlers -lupb_textformat -lupb_reflection -lupb -lcares -lz -labsl_statusor -labsl_status -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_synchronization -labsl_time -labsl_time_zone -labsl_civil_time -labsl_graphcycles_internal -labsl_symbolize -labsl_demangle_internal -labsl_malloc_internal -labsl_stacktrace -labsl_debugging_internal -labsl_exponential_biased -labsl_cord -labsl_str_format_internal -labsl_hash -labsl_bad_variant_access -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_base -labsl_spinlock_wait -labsl_int128 -labsl_city -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity" + "" + "grpc.pc") + diff --git a/ports/upb/add-cmake-install.patch b/ports/upb/add-cmake-install.patch index 78043b571bad60..51e740d0350ea7 100644 --- a/ports/upb/add-cmake-install.patch +++ b/ports/upb/add-cmake-install.patch @@ -1,41 +1,41 @@ -diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt -index c90968f..50637ec 100644 ---- a/cmake/CMakeLists.txt -+++ b/cmake/CMakeLists.txt -@@ -8,7 +8,7 @@ else() - cmake_policy(VERSION 3.12) - endif() - --cmake_minimum_required (VERSION 3.0) -+cmake_minimum_required (VERSION 3.14) - cmake_policy(SET CMP0048 NEW) - - project(upb) -@@ -154,3 +154,27 @@ set_target_properties(reflection PROPERTIES OUTPUT_NAME upb_reflection) - set_target_properties(fastdecode PROPERTIES OUTPUT_NAME upb_fastdecode) - set_target_properties(textformat PROPERTIES OUTPUT_NAME upb_textformat) - -+install( -+ DIRECTORY ../upb -+ DESTINATION include -+ FILES_MATCHING -+ PATTERN "*.h" -+ PATTERN "*.hpp" -+ PATTERN "*.inc" -+ PATTERN "*.int.h" -+) -+target_include_directories(upb PUBLIC $) -+install(TARGETS -+ upb -+ utf8_range -+ fastdecode -+ json -+ port -+ table -+ descriptor_upb_proto -+ reflection -+ textformat -+ all_libs -+ EXPORT upb-config -+) -+install(EXPORT upb-config NAMESPACE upb:: DESTINATION share/upb) +diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt +index c90968f..50637ec 100644 +--- a/cmake/CMakeLists.txt ++++ b/cmake/CMakeLists.txt +@@ -8,7 +8,7 @@ else() + cmake_policy(VERSION 3.12) + endif() + +-cmake_minimum_required (VERSION 3.0) ++cmake_minimum_required (VERSION 3.14) + cmake_policy(SET CMP0048 NEW) + + project(upb) +@@ -154,3 +154,27 @@ set_target_properties(reflection PROPERTIES OUTPUT_NAME upb_reflection) + set_target_properties(fastdecode PROPERTIES OUTPUT_NAME upb_fastdecode) + set_target_properties(textformat PROPERTIES OUTPUT_NAME upb_textformat) + ++install( ++ DIRECTORY ../upb ++ DESTINATION include ++ FILES_MATCHING ++ PATTERN "*.h" ++ PATTERN "*.hpp" ++ PATTERN "*.inc" ++ PATTERN "*.int.h" ++) ++target_include_directories(upb PUBLIC $) ++install(TARGETS ++ upb ++ utf8_range ++ fastdecode ++ json ++ port ++ table ++ descriptor_upb_proto ++ reflection ++ textformat ++ all_libs ++ EXPORT upb-config ++) ++install(EXPORT upb-config NAMESPACE upb:: DESTINATION share/upb) From ea1ee8451766456c57b1a30cedb2c3daf79a4cc1 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Wed, 20 Oct 2021 10:01:09 +0800 Subject: [PATCH 11/25] update version --- versions/g-/grpc.json | 2 +- versions/u-/upb.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/versions/g-/grpc.json b/versions/g-/grpc.json index 33b0da6c5b70e8..4d786885c668ab 100644 --- a/versions/g-/grpc.json +++ b/versions/g-/grpc.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "f34d6d170a10a8902341177b4d77c064e58a820e", + "git-tree": "f3c16f65366d8e8edcad0ccd38cbf3ecf8ebd352", "version-semver": "1.41.0", "port-version": 0 }, diff --git a/versions/u-/upb.json b/versions/u-/upb.json index 48bcf9ca3b8787..941b0eaec211bd 100644 --- a/versions/u-/upb.json +++ b/versions/u-/upb.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "a91064705abdc7677e30cd0abc6004dfb8770d26", + "git-tree": "09612f9b5b013fb956100b3742db7749953b8129", "version-date": "2021-10-19", "port-version": 0 }, From 8a8bfd8df0c131a1058c5c0edfa61540a89ced9d Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Wed, 20 Oct 2021 13:54:25 +0800 Subject: [PATCH 12/25] Fix review advise --- ports/grpc/00010-add-feature-absl-sync.patch | 2 +- ports/grpc/portfile.cmake | 2 +- .../{00006-snprintf.patch => snprintf.patch} | 24 +++++++++---------- ports/upb/portfile.cmake | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) rename ports/grpc/{00006-snprintf.patch => snprintf.patch} (51%) diff --git a/ports/grpc/00010-add-feature-absl-sync.patch b/ports/grpc/00010-add-feature-absl-sync.patch index 6479c9feee6ccf..ed96f12070a495 100644 --- a/ports/grpc/00010-add-feature-absl-sync.patch +++ b/ports/grpc/00010-add-feature-absl-sync.patch @@ -16,7 +16,7 @@ index ae06ea3..8b64438 100644 ${_gRPC_ALLTARGETS_LIBRARIES} absl::flat_hash_map + absl::time -+ absl::synchronization ++ absl::synchronization absl::inlined_vector absl::bind_front absl::statusor diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index b860a2ad34a8eb..a0015372524c74 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -17,7 +17,7 @@ vcpkg_from_github( 00009-use-system-upb.patch 00010-add-feature-absl-sync.patch 00011-fix-csharp_plugin.patch - 00006-snprintf.patch + snprintf.patch 00012-fix-use-cxx17.patch 00013-build-upbdefs.patch 00014-pkgconfig-upbdefs.patch diff --git a/ports/grpc/00006-snprintf.patch b/ports/grpc/snprintf.patch similarity index 51% rename from ports/grpc/00006-snprintf.patch rename to ports/grpc/snprintf.patch index 93f8350b02c635..d75a2059162a7f 100644 --- a/ports/grpc/00006-snprintf.patch +++ b/ports/grpc/snprintf.patch @@ -1,12 +1,12 @@ -diff --git a/src/core/tsi/alts/crypt/aes_gcm.cc b/src/core/tsi/alts/crypt/aes_gcm.cc -index b761224..70d1696 100644 ---- a/src/core/tsi/alts/crypt/aes_gcm.cc -+++ b/src/core/tsi/alts/crypt/aes_gcm.cc -@@ -25,6 +25,7 @@ - #include - #include - #include -+#include - - #include - +diff --git a/src/core/tsi/alts/crypt/aes_gcm.cc b/src/core/tsi/alts/crypt/aes_gcm.cc +index b761224..88a3d6b 100644 +--- a/src/core/tsi/alts/crypt/aes_gcm.cc ++++ b/src/core/tsi/alts/crypt/aes_gcm.cc +@@ -19,6 +19,7 @@ + #include + + #include ++#include + + #include + #include diff --git a/ports/upb/portfile.cmake b/ports/upb/portfile.cmake index 6dbd9793b3e2fd..d7cdef2451cc50 100644 --- a/ports/upb/portfile.cmake +++ b/ports/upb/portfile.cmake @@ -14,13 +14,13 @@ vcpkg_from_github( ) vcpkg_cmake_configure( - SOURCE_PATH ${SOURCE_PATH}/cmake + SOURCE_PATH "${SOURCE_PATH}/cmake" ) vcpkg_cmake_install() vcpkg_cmake_config_fixup() vcpkg_copy_pdbs() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/debug/include) +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) From c7e2caa27d43e19f77400287ec3915e867113945 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Wed, 20 Oct 2021 14:02:06 +0800 Subject: [PATCH 13/25] update version --- versions/g-/grpc.json | 2 +- versions/u-/upb.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/versions/g-/grpc.json b/versions/g-/grpc.json index 4d786885c668ab..aeefc425aeb225 100644 --- a/versions/g-/grpc.json +++ b/versions/g-/grpc.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "f3c16f65366d8e8edcad0ccd38cbf3ecf8ebd352", + "git-tree": "2318f0c68e35ebb3dd29313a04a1843b1e778090", "version-semver": "1.41.0", "port-version": 0 }, diff --git a/versions/u-/upb.json b/versions/u-/upb.json index 941b0eaec211bd..50641b629ed261 100644 --- a/versions/u-/upb.json +++ b/versions/u-/upb.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "09612f9b5b013fb956100b3742db7749953b8129", + "git-tree": "7c61b435b6136ae6539c3991b9f6b81bfd6811dc", "version-date": "2021-10-19", "port-version": 0 }, From 7c55919ea5a14c308348bd14dff3c7afac2f87f0 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Wed, 20 Oct 2021 16:25:02 +0800 Subject: [PATCH 14/25] Remove extra spaces --- ports/grpc/00010-add-feature-absl-sync.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/grpc/00010-add-feature-absl-sync.patch b/ports/grpc/00010-add-feature-absl-sync.patch index 6479c9feee6ccf..ed96f12070a495 100644 --- a/ports/grpc/00010-add-feature-absl-sync.patch +++ b/ports/grpc/00010-add-feature-absl-sync.patch @@ -16,7 +16,7 @@ index ae06ea3..8b64438 100644 ${_gRPC_ALLTARGETS_LIBRARIES} absl::flat_hash_map + absl::time -+ absl::synchronization ++ absl::synchronization absl::inlined_vector absl::bind_front absl::statusor From 13d9b5e9352c4662e683f3bf6816ab868cc22596 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Wed, 20 Oct 2021 16:25:28 +0800 Subject: [PATCH 15/25] update version --- versions/g-/grpc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/g-/grpc.json b/versions/g-/grpc.json index 4d786885c668ab..6acb8033cd6788 100644 --- a/versions/g-/grpc.json +++ b/versions/g-/grpc.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "f3c16f65366d8e8edcad0ccd38cbf3ecf8ebd352", + "git-tree": "937e59014bfc832457ba992c99676c54e32ae3dd", "version-semver": "1.41.0", "port-version": 0 }, From f186a200856b08d451dd0fd054008ce2abddd04f Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 21 Oct 2021 17:38:22 +0800 Subject: [PATCH 16/25] update version --- versions/g-/grpc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/g-/grpc.json b/versions/g-/grpc.json index 6acb8033cd6788..aeefc425aeb225 100644 --- a/versions/g-/grpc.json +++ b/versions/g-/grpc.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "937e59014bfc832457ba992c99676c54e32ae3dd", + "git-tree": "2318f0c68e35ebb3dd29313a04a1843b1e778090", "version-semver": "1.41.0", "port-version": 0 }, From aed0c9ad8d9370b6430163523ab357bc169c5980 Mon Sep 17 00:00:00 2001 From: NancyLi1013 Date: Thu, 21 Oct 2021 02:59:50 -0700 Subject: [PATCH 17/25] Remove space in patch file --- ports/grpc/00010-add-feature-absl-sync.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/grpc/00010-add-feature-absl-sync.patch b/ports/grpc/00010-add-feature-absl-sync.patch index ed96f12070a495..2c7df5c876afba 100644 --- a/ports/grpc/00010-add-feature-absl-sync.patch +++ b/ports/grpc/00010-add-feature-absl-sync.patch @@ -7,7 +7,7 @@ index ae06ea3..8b64438 100644 ${_gRPC_ALLTARGETS_LIBRARIES} absl::flat_hash_map + absl::time -+ absl::synchronization ++ absl::synchronization absl::inlined_vector absl::bind_front absl::statusor From 0d7ce0c3f395b476996b7c9a7443ad1f3ee919c9 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 21 Oct 2021 18:12:42 +0800 Subject: [PATCH 18/25] change patch format from CRLF to CF --- ports/grpc/00005-fix-uwp-error.patch | 68 ++++---- ports/grpc/00009-use-system-upb.patch | 156 +++++++++---------- ports/grpc/00010-add-feature-absl-sync.patch | 68 ++++---- ports/grpc/00011-fix-csharp_plugin.patch | 66 ++++---- ports/grpc/00012-fix-use-cxx17.patch | 34 ++-- 5 files changed, 196 insertions(+), 196 deletions(-) diff --git a/ports/grpc/00005-fix-uwp-error.patch b/ports/grpc/00005-fix-uwp-error.patch index ff86f68febe3fa..8665fc3811bd7e 100644 --- a/ports/grpc/00005-fix-uwp-error.patch +++ b/ports/grpc/00005-fix-uwp-error.patch @@ -1,34 +1,34 @@ -diff --git a/src/core/lib/slice/slice.cc b/src/core/lib/slice/slice.cc -index 0dacbfef3e..0743a1b003 100644 ---- a/src/core/lib/slice/slice.cc -+++ b/src/core/lib/slice/slice.cc -@@ -234,6 +234,7 @@ grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr p, - size_t len) { - uint8_t* ptr = reinterpret_cast(p.get()); - grpc_slice slice; -+ memset(&slice, 0, sizeof(grpc_slice)); - if (len <= sizeof(slice.data.inlined.bytes)) { - slice.refcount = nullptr; - slice.data.inlined.length = len; -@@ -253,7 +254,7 @@ grpc_slice grpc_slice_from_moved_string(grpc_core::UniquePtr p) { - } - - grpc_slice grpc_slice_from_cpp_string(std::string str) { -- grpc_slice slice; -+ grpc_slice slice = { 0 }; - if (str.size() <= sizeof(slice.data.inlined.bytes)) { - slice.refcount = nullptr; - slice.data.inlined.length = str.size(); -diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc -index c94551545d..3fd9797316 100644 ---- a/src/core/lib/surface/server.cc -+++ b/src/core/lib/surface/server.cc -@@ -878,7 +878,7 @@ grpc_call_error Server::QueueRequestedCall(size_t cq_idx, RequestedCall* rc) { - GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown")); - return GRPC_CALL_OK; - } -- RequestMatcherInterface* rm; -+ RequestMatcherInterface* rm = nullptr; - switch (rc->type) { - case RequestedCall::Type::BATCH_CALL: - rm = unregistered_request_matcher_.get(); +diff --git a/src/core/lib/slice/slice.cc b/src/core/lib/slice/slice.cc +index 0dacbfef3e..0743a1b003 100644 +--- a/src/core/lib/slice/slice.cc ++++ b/src/core/lib/slice/slice.cc +@@ -234,6 +234,7 @@ grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr p, + size_t len) { + uint8_t* ptr = reinterpret_cast(p.get()); + grpc_slice slice; ++ memset(&slice, 0, sizeof(grpc_slice)); + if (len <= sizeof(slice.data.inlined.bytes)) { + slice.refcount = nullptr; + slice.data.inlined.length = len; +@@ -253,7 +254,7 @@ grpc_slice grpc_slice_from_moved_string(grpc_core::UniquePtr p) { + } + + grpc_slice grpc_slice_from_cpp_string(std::string str) { +- grpc_slice slice; ++ grpc_slice slice = { 0 }; + if (str.size() <= sizeof(slice.data.inlined.bytes)) { + slice.refcount = nullptr; + slice.data.inlined.length = str.size(); +diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc +index c94551545d..3fd9797316 100644 +--- a/src/core/lib/surface/server.cc ++++ b/src/core/lib/surface/server.cc +@@ -878,7 +878,7 @@ grpc_call_error Server::QueueRequestedCall(size_t cq_idx, RequestedCall* rc) { + GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown")); + return GRPC_CALL_OK; + } +- RequestMatcherInterface* rm; ++ RequestMatcherInterface* rm = nullptr; + switch (rc->type) { + case RequestedCall::Type::BATCH_CALL: + rm = unregistered_request_matcher_.get(); diff --git a/ports/grpc/00009-use-system-upb.patch b/ports/grpc/00009-use-system-upb.patch index e40b27dbbfbf8f..7185707959f221 100644 --- a/ports/grpc/00009-use-system-upb.patch +++ b/ports/grpc/00009-use-system-upb.patch @@ -1,78 +1,78 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1c3146b..ae06ea3 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -84,6 +84,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") - -@@ -1504,7 +1507,6 @@ target_link_libraries(gpr - absl::synchronization - absl::time - absl::optional -- upb - ) - if(_gRPC_PLATFORM_ANDROID) - target_link_libraries(gpr -@@ -3927,6 +3929,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 -@@ -3984,7 +3987,7 @@ if(gRPC_INSTALL) - ) - endif() - -- -+endif() - - add_executable(check_epollexclusive - test/build/check_epollexclusive.c -diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in -index 3623f4a..df6ced5 100644 ---- a/cmake/gRPCConfig.cmake.in -+++ b/cmake/gRPCConfig.cmake.in -@@ -8,6 +8,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules) - @_gRPC_FIND_CARES@ - @_gRPC_FIND_ABSL@ - @_gRPC_FIND_RE2@ -+@_gRPC_FIND_UPB@ - - # Targets - include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake) -diff --git a/cmake/upb.cmake b/cmake/upb.cmake -index f2a0e50..ac6d397 100644 ---- a/cmake/upb.cmake -+++ b/cmake/upb.cmake -@@ -12,9 +12,21 @@ - # 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" "${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) - - set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}") - set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-generated") - - 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() -\ No newline at end of file +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1c3146b..ae06ea3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -84,6 +84,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") + +@@ -1504,7 +1507,6 @@ target_link_libraries(gpr + absl::synchronization + absl::time + absl::optional +- upb + ) + if(_gRPC_PLATFORM_ANDROID) + target_link_libraries(gpr +@@ -3927,6 +3929,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 +@@ -3984,7 +3987,7 @@ if(gRPC_INSTALL) + ) + endif() + +- ++endif() + + add_executable(check_epollexclusive + test/build/check_epollexclusive.c +diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in +index 3623f4a..df6ced5 100644 +--- a/cmake/gRPCConfig.cmake.in ++++ b/cmake/gRPCConfig.cmake.in +@@ -8,6 +8,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules) + @_gRPC_FIND_CARES@ + @_gRPC_FIND_ABSL@ + @_gRPC_FIND_RE2@ ++@_gRPC_FIND_UPB@ + + # Targets + include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake) +diff --git a/cmake/upb.cmake b/cmake/upb.cmake +index f2a0e50..ac6d397 100644 +--- a/cmake/upb.cmake ++++ b/cmake/upb.cmake +@@ -12,9 +12,21 @@ + # 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" "${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) + + set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}") + set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-generated") + + 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() +\ No newline at end of file diff --git a/ports/grpc/00010-add-feature-absl-sync.patch b/ports/grpc/00010-add-feature-absl-sync.patch index 2c7df5c876afba..2c74b017a22df8 100644 --- a/ports/grpc/00010-add-feature-absl-sync.patch +++ b/ports/grpc/00010-add-feature-absl-sync.patch @@ -1,34 +1,34 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ae06ea3..8b64438 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -2180,6 +2180,8 @@ target_link_libraries(grpc - ${_gRPC_UPB_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - absl::flat_hash_map -+ absl::time -+ absl::synchronization - absl::inlined_vector - absl::bind_front - absl::statusor -@@ -2733,6 +2735,8 @@ target_link_libraries(grpc_unsecure - ${_gRPC_UPB_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - absl::flat_hash_map -+ absl::time -+ absl::synchronization - absl::inlined_vector - absl::bind_front - absl::statusor -diff --git a/cmake/abseil-cpp.cmake b/cmake/abseil-cpp.cmake -index c89ba26..68ae4fd 100644 ---- a/cmake/abseil-cpp.cmake -+++ b/cmake/abseil-cpp.cmake -@@ -35,3 +35,6 @@ elseif(gRPC_ABSL_PROVIDER STREQUAL "package") - find_package(absl REQUIRED CONFIG) - endif() - set(_gRPC_FIND_ABSL "if(NOT TARGET absl::strings)\n find_package(absl CONFIG)\nendif()") -+ if (gRPC_ABSL_SYNC_ENABLE) -+ add_definitions(-DGPR_ABSEIL_SYNC=1) -+ endif() -\ No newline at end of file +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ae06ea3..8b64438 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2180,6 +2180,8 @@ target_link_libraries(grpc + ${_gRPC_UPB_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + absl::flat_hash_map ++ absl::time ++ absl::synchronization + absl::inlined_vector + absl::bind_front + absl::statusor +@@ -2733,6 +2735,8 @@ target_link_libraries(grpc_unsecure + ${_gRPC_UPB_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + absl::flat_hash_map ++ absl::time ++ absl::synchronization + absl::inlined_vector + absl::bind_front + absl::statusor +diff --git a/cmake/abseil-cpp.cmake b/cmake/abseil-cpp.cmake +index c89ba26..68ae4fd 100644 +--- a/cmake/abseil-cpp.cmake ++++ b/cmake/abseil-cpp.cmake +@@ -35,3 +35,6 @@ elseif(gRPC_ABSL_PROVIDER STREQUAL "package") + find_package(absl REQUIRED CONFIG) + endif() + set(_gRPC_FIND_ABSL "if(NOT TARGET absl::strings)\n find_package(absl CONFIG)\nendif()") ++ if (gRPC_ABSL_SYNC_ENABLE) ++ add_definitions(-DGPR_ABSEIL_SYNC=1) ++ endif() +\ No newline at end of file diff --git a/ports/grpc/00011-fix-csharp_plugin.patch b/ports/grpc/00011-fix-csharp_plugin.patch index fb258f9006d109..8d2de07f0ce98d 100644 --- a/ports/grpc/00011-fix-csharp_plugin.patch +++ b/ports/grpc/00011-fix-csharp_plugin.patch @@ -1,33 +1,33 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ae77375eae..ad8815d2f9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1960,10 +1960,14 @@ endif() - - if(gRPC_BUILD_CSHARP_EXT) - --add_library(grpc_csharp_ext SHARED -+add_library(grpc_csharp_ext - src/csharp/ext/grpc_csharp_ext.c - ) - -+if (WIN32 AND BUILD_SHARED_LIBS) -+ target_compile_definitions(grpc_csharp_ext PUBLIC GPR_WINDOWS) -+endif() -+ - set_target_properties(grpc_csharp_ext PROPERTIES - VERSION ${gRPC_CORE_VERSION} - SOVERSION ${gRPC_CORE_SOVERSION} -@@ -1977,6 +1981,12 @@ if(WIN32 AND MSVC) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc_csharp_ext.pdb - DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL - ) -+ -+ install(TARGETS grpc_csharp_ext -+ RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} -+ LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} -+ ) - endif() - endif() - +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ae77375eae..ad8815d2f9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1960,10 +1960,14 @@ endif() + + if(gRPC_BUILD_CSHARP_EXT) + +-add_library(grpc_csharp_ext SHARED ++add_library(grpc_csharp_ext + src/csharp/ext/grpc_csharp_ext.c + ) + ++if (WIN32 AND BUILD_SHARED_LIBS) ++ target_compile_definitions(grpc_csharp_ext PUBLIC GPR_WINDOWS) ++endif() ++ + set_target_properties(grpc_csharp_ext PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +@@ -1977,6 +1981,12 @@ if(WIN32 AND MSVC) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc_csharp_ext.pdb + DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL + ) ++ ++ install(TARGETS grpc_csharp_ext ++ RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} ++ ) + endif() + endif() + diff --git a/ports/grpc/00012-fix-use-cxx17.patch b/ports/grpc/00012-fix-use-cxx17.patch index ea425c9635a835..0fa1b7408f4a49 100644 --- a/ports/grpc/00012-fix-use-cxx17.patch +++ b/ports/grpc/00012-fix-use-cxx17.patch @@ -1,17 +1,17 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4573027..4615602 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -271,6 +271,12 @@ include(cmake/upb.cmake) - include(cmake/xxhash.cmake) - include(cmake/zlib.cmake) - -+ -+if (ABSL_USE_CXX17) -+ message(STATUS "Found absl uses CXX17, enable CXX17 feature.") -+ set(CMAKE_CXX_STANDARD 17) -+endif() -+ - if(_gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_IOS) - set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m pthread) - elseif(_gRPC_PLATFORM_ANDROID) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4573027..4615602 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -271,6 +271,12 @@ include(cmake/upb.cmake) + include(cmake/xxhash.cmake) + include(cmake/zlib.cmake) + ++ ++if (ABSL_USE_CXX17) ++ message(STATUS "Found absl uses CXX17, enable CXX17 feature.") ++ set(CMAKE_CXX_STANDARD 17) ++endif() ++ + if(_gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_IOS) + set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m pthread) + elseif(_gRPC_PLATFORM_ANDROID) From 4649081d1596c967cb7984976a53e5808b38ea03 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Thu, 21 Oct 2021 18:13:28 +0800 Subject: [PATCH 19/25] update version --- versions/g-/grpc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/g-/grpc.json b/versions/g-/grpc.json index aeefc425aeb225..076d5c6d66780c 100644 --- a/versions/g-/grpc.json +++ b/versions/g-/grpc.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "2318f0c68e35ebb3dd29313a04a1843b1e778090", + "git-tree": "5fb5e2b74ed14aed08c1491614f7be8ce85df44f", "version-semver": "1.41.0", "port-version": 0 }, From 729dad89b20b06dd0eb43d4f5c7eb7bd682bafe3 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Tue, 2 Nov 2021 16:15:52 +0800 Subject: [PATCH 20/25] revert patch format --- ports/grpc/00005-fix-uwp-error.patch | 68 ++++---- ports/grpc/00009-use-system-upb.patch | 156 +++++++++---------- ports/grpc/00010-add-feature-absl-sync.patch | 68 ++++---- ports/grpc/00011-fix-csharp_plugin.patch | 66 ++++---- ports/grpc/00012-fix-use-cxx17.patch | 34 ++-- ports/grpc/00014-pkgconfig-upbdefs.patch | 26 ++-- ports/grpc/snprintf.patch | 24 +-- 7 files changed, 221 insertions(+), 221 deletions(-) diff --git a/ports/grpc/00005-fix-uwp-error.patch b/ports/grpc/00005-fix-uwp-error.patch index 8665fc3811bd7e..ff86f68febe3fa 100644 --- a/ports/grpc/00005-fix-uwp-error.patch +++ b/ports/grpc/00005-fix-uwp-error.patch @@ -1,34 +1,34 @@ -diff --git a/src/core/lib/slice/slice.cc b/src/core/lib/slice/slice.cc -index 0dacbfef3e..0743a1b003 100644 ---- a/src/core/lib/slice/slice.cc -+++ b/src/core/lib/slice/slice.cc -@@ -234,6 +234,7 @@ grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr p, - size_t len) { - uint8_t* ptr = reinterpret_cast(p.get()); - grpc_slice slice; -+ memset(&slice, 0, sizeof(grpc_slice)); - if (len <= sizeof(slice.data.inlined.bytes)) { - slice.refcount = nullptr; - slice.data.inlined.length = len; -@@ -253,7 +254,7 @@ grpc_slice grpc_slice_from_moved_string(grpc_core::UniquePtr p) { - } - - grpc_slice grpc_slice_from_cpp_string(std::string str) { -- grpc_slice slice; -+ grpc_slice slice = { 0 }; - if (str.size() <= sizeof(slice.data.inlined.bytes)) { - slice.refcount = nullptr; - slice.data.inlined.length = str.size(); -diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc -index c94551545d..3fd9797316 100644 ---- a/src/core/lib/surface/server.cc -+++ b/src/core/lib/surface/server.cc -@@ -878,7 +878,7 @@ grpc_call_error Server::QueueRequestedCall(size_t cq_idx, RequestedCall* rc) { - GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown")); - return GRPC_CALL_OK; - } -- RequestMatcherInterface* rm; -+ RequestMatcherInterface* rm = nullptr; - switch (rc->type) { - case RequestedCall::Type::BATCH_CALL: - rm = unregistered_request_matcher_.get(); +diff --git a/src/core/lib/slice/slice.cc b/src/core/lib/slice/slice.cc +index 0dacbfef3e..0743a1b003 100644 +--- a/src/core/lib/slice/slice.cc ++++ b/src/core/lib/slice/slice.cc +@@ -234,6 +234,7 @@ grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr p, + size_t len) { + uint8_t* ptr = reinterpret_cast(p.get()); + grpc_slice slice; ++ memset(&slice, 0, sizeof(grpc_slice)); + if (len <= sizeof(slice.data.inlined.bytes)) { + slice.refcount = nullptr; + slice.data.inlined.length = len; +@@ -253,7 +254,7 @@ grpc_slice grpc_slice_from_moved_string(grpc_core::UniquePtr p) { + } + + grpc_slice grpc_slice_from_cpp_string(std::string str) { +- grpc_slice slice; ++ grpc_slice slice = { 0 }; + if (str.size() <= sizeof(slice.data.inlined.bytes)) { + slice.refcount = nullptr; + slice.data.inlined.length = str.size(); +diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc +index c94551545d..3fd9797316 100644 +--- a/src/core/lib/surface/server.cc ++++ b/src/core/lib/surface/server.cc +@@ -878,7 +878,7 @@ grpc_call_error Server::QueueRequestedCall(size_t cq_idx, RequestedCall* rc) { + GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown")); + return GRPC_CALL_OK; + } +- RequestMatcherInterface* rm; ++ RequestMatcherInterface* rm = nullptr; + switch (rc->type) { + case RequestedCall::Type::BATCH_CALL: + rm = unregistered_request_matcher_.get(); diff --git a/ports/grpc/00009-use-system-upb.patch b/ports/grpc/00009-use-system-upb.patch index 7185707959f221..e40b27dbbfbf8f 100644 --- a/ports/grpc/00009-use-system-upb.patch +++ b/ports/grpc/00009-use-system-upb.patch @@ -1,78 +1,78 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1c3146b..ae06ea3 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -84,6 +84,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") - -@@ -1504,7 +1507,6 @@ target_link_libraries(gpr - absl::synchronization - absl::time - absl::optional -- upb - ) - if(_gRPC_PLATFORM_ANDROID) - target_link_libraries(gpr -@@ -3927,6 +3929,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 -@@ -3984,7 +3987,7 @@ if(gRPC_INSTALL) - ) - endif() - -- -+endif() - - add_executable(check_epollexclusive - test/build/check_epollexclusive.c -diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in -index 3623f4a..df6ced5 100644 ---- a/cmake/gRPCConfig.cmake.in -+++ b/cmake/gRPCConfig.cmake.in -@@ -8,6 +8,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules) - @_gRPC_FIND_CARES@ - @_gRPC_FIND_ABSL@ - @_gRPC_FIND_RE2@ -+@_gRPC_FIND_UPB@ - - # Targets - include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake) -diff --git a/cmake/upb.cmake b/cmake/upb.cmake -index f2a0e50..ac6d397 100644 ---- a/cmake/upb.cmake -+++ b/cmake/upb.cmake -@@ -12,9 +12,21 @@ - # 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" "${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) - - set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}") - set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-generated") - - 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() -\ No newline at end of file +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1c3146b..ae06ea3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -84,6 +84,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") + +@@ -1504,7 +1507,6 @@ target_link_libraries(gpr + absl::synchronization + absl::time + absl::optional +- upb + ) + if(_gRPC_PLATFORM_ANDROID) + target_link_libraries(gpr +@@ -3927,6 +3929,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 +@@ -3984,7 +3987,7 @@ if(gRPC_INSTALL) + ) + endif() + +- ++endif() + + add_executable(check_epollexclusive + test/build/check_epollexclusive.c +diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in +index 3623f4a..df6ced5 100644 +--- a/cmake/gRPCConfig.cmake.in ++++ b/cmake/gRPCConfig.cmake.in +@@ -8,6 +8,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules) + @_gRPC_FIND_CARES@ + @_gRPC_FIND_ABSL@ + @_gRPC_FIND_RE2@ ++@_gRPC_FIND_UPB@ + + # Targets + include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake) +diff --git a/cmake/upb.cmake b/cmake/upb.cmake +index f2a0e50..ac6d397 100644 +--- a/cmake/upb.cmake ++++ b/cmake/upb.cmake +@@ -12,9 +12,21 @@ + # 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" "${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) + + set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}") + set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-generated") + + 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() +\ No newline at end of file diff --git a/ports/grpc/00010-add-feature-absl-sync.patch b/ports/grpc/00010-add-feature-absl-sync.patch index 2c74b017a22df8..2c7df5c876afba 100644 --- a/ports/grpc/00010-add-feature-absl-sync.patch +++ b/ports/grpc/00010-add-feature-absl-sync.patch @@ -1,34 +1,34 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ae06ea3..8b64438 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -2180,6 +2180,8 @@ target_link_libraries(grpc - ${_gRPC_UPB_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - absl::flat_hash_map -+ absl::time -+ absl::synchronization - absl::inlined_vector - absl::bind_front - absl::statusor -@@ -2733,6 +2735,8 @@ target_link_libraries(grpc_unsecure - ${_gRPC_UPB_LIBRARIES} - ${_gRPC_ALLTARGETS_LIBRARIES} - absl::flat_hash_map -+ absl::time -+ absl::synchronization - absl::inlined_vector - absl::bind_front - absl::statusor -diff --git a/cmake/abseil-cpp.cmake b/cmake/abseil-cpp.cmake -index c89ba26..68ae4fd 100644 ---- a/cmake/abseil-cpp.cmake -+++ b/cmake/abseil-cpp.cmake -@@ -35,3 +35,6 @@ elseif(gRPC_ABSL_PROVIDER STREQUAL "package") - find_package(absl REQUIRED CONFIG) - endif() - set(_gRPC_FIND_ABSL "if(NOT TARGET absl::strings)\n find_package(absl CONFIG)\nendif()") -+ if (gRPC_ABSL_SYNC_ENABLE) -+ add_definitions(-DGPR_ABSEIL_SYNC=1) -+ endif() -\ No newline at end of file +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ae06ea3..8b64438 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2180,6 +2180,8 @@ target_link_libraries(grpc + ${_gRPC_UPB_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + absl::flat_hash_map ++ absl::time ++ absl::synchronization + absl::inlined_vector + absl::bind_front + absl::statusor +@@ -2733,6 +2735,8 @@ target_link_libraries(grpc_unsecure + ${_gRPC_UPB_LIBRARIES} + ${_gRPC_ALLTARGETS_LIBRARIES} + absl::flat_hash_map ++ absl::time ++ absl::synchronization + absl::inlined_vector + absl::bind_front + absl::statusor +diff --git a/cmake/abseil-cpp.cmake b/cmake/abseil-cpp.cmake +index c89ba26..68ae4fd 100644 +--- a/cmake/abseil-cpp.cmake ++++ b/cmake/abseil-cpp.cmake +@@ -35,3 +35,6 @@ elseif(gRPC_ABSL_PROVIDER STREQUAL "package") + find_package(absl REQUIRED CONFIG) + endif() + set(_gRPC_FIND_ABSL "if(NOT TARGET absl::strings)\n find_package(absl CONFIG)\nendif()") ++ if (gRPC_ABSL_SYNC_ENABLE) ++ add_definitions(-DGPR_ABSEIL_SYNC=1) ++ endif() +\ No newline at end of file diff --git a/ports/grpc/00011-fix-csharp_plugin.patch b/ports/grpc/00011-fix-csharp_plugin.patch index 8d2de07f0ce98d..fb258f9006d109 100644 --- a/ports/grpc/00011-fix-csharp_plugin.patch +++ b/ports/grpc/00011-fix-csharp_plugin.patch @@ -1,33 +1,33 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ae77375eae..ad8815d2f9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1960,10 +1960,14 @@ endif() - - if(gRPC_BUILD_CSHARP_EXT) - --add_library(grpc_csharp_ext SHARED -+add_library(grpc_csharp_ext - src/csharp/ext/grpc_csharp_ext.c - ) - -+if (WIN32 AND BUILD_SHARED_LIBS) -+ target_compile_definitions(grpc_csharp_ext PUBLIC GPR_WINDOWS) -+endif() -+ - set_target_properties(grpc_csharp_ext PROPERTIES - VERSION ${gRPC_CORE_VERSION} - SOVERSION ${gRPC_CORE_SOVERSION} -@@ -1977,6 +1981,12 @@ if(WIN32 AND MSVC) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc_csharp_ext.pdb - DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL - ) -+ -+ install(TARGETS grpc_csharp_ext -+ RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} -+ LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} -+ ) - endif() - endif() - +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ae77375eae..ad8815d2f9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1960,10 +1960,14 @@ endif() + + if(gRPC_BUILD_CSHARP_EXT) + +-add_library(grpc_csharp_ext SHARED ++add_library(grpc_csharp_ext + src/csharp/ext/grpc_csharp_ext.c + ) + ++if (WIN32 AND BUILD_SHARED_LIBS) ++ target_compile_definitions(grpc_csharp_ext PUBLIC GPR_WINDOWS) ++endif() ++ + set_target_properties(grpc_csharp_ext PROPERTIES + VERSION ${gRPC_CORE_VERSION} + SOVERSION ${gRPC_CORE_SOVERSION} +@@ -1977,6 +1981,12 @@ if(WIN32 AND MSVC) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc_csharp_ext.pdb + DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL + ) ++ ++ install(TARGETS grpc_csharp_ext ++ RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} ++ ) + endif() + endif() + diff --git a/ports/grpc/00012-fix-use-cxx17.patch b/ports/grpc/00012-fix-use-cxx17.patch index 0fa1b7408f4a49..ea425c9635a835 100644 --- a/ports/grpc/00012-fix-use-cxx17.patch +++ b/ports/grpc/00012-fix-use-cxx17.patch @@ -1,17 +1,17 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4573027..4615602 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -271,6 +271,12 @@ include(cmake/upb.cmake) - include(cmake/xxhash.cmake) - include(cmake/zlib.cmake) - -+ -+if (ABSL_USE_CXX17) -+ message(STATUS "Found absl uses CXX17, enable CXX17 feature.") -+ set(CMAKE_CXX_STANDARD 17) -+endif() -+ - if(_gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_IOS) - set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m pthread) - elseif(_gRPC_PLATFORM_ANDROID) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4573027..4615602 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -271,6 +271,12 @@ include(cmake/upb.cmake) + include(cmake/xxhash.cmake) + include(cmake/zlib.cmake) + ++ ++if (ABSL_USE_CXX17) ++ message(STATUS "Found absl uses CXX17, enable CXX17 feature.") ++ set(CMAKE_CXX_STANDARD 17) ++endif() ++ + if(_gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_IOS) + set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m pthread) + elseif(_gRPC_PLATFORM_ANDROID) diff --git a/ports/grpc/00014-pkgconfig-upbdefs.patch b/ports/grpc/00014-pkgconfig-upbdefs.patch index 196c4096ccc3c1..8b687ee6f2fb08 100644 --- a/ports/grpc/00014-pkgconfig-upbdefs.patch +++ b/ports/grpc/00014-pkgconfig-upbdefs.patch @@ -1,13 +1,13 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 01988c2..b304cc9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -17705,7 +17705,7 @@ generate_pkgconfig( - "high performance general RPC framework" - "${gRPC_CORE_VERSION}" - "gpr openssl absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_variant" -- "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz" -+ "-lgrpc -lgrpc_upbdefs -laddress_sorting -lre2 -lupb_fastdecode -lupb_json -lupb_pb -lupb_handlers -lupb_textformat -lupb_reflection -lupb -lcares -lz -labsl_statusor -labsl_status -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_synchronization -labsl_time -labsl_time_zone -labsl_civil_time -labsl_graphcycles_internal -labsl_symbolize -labsl_demangle_internal -labsl_malloc_internal -labsl_stacktrace -labsl_debugging_internal -labsl_exponential_biased -labsl_cord -labsl_str_format_internal -labsl_hash -labsl_bad_variant_access -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_base -labsl_spinlock_wait -labsl_int128 -labsl_city -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity" - "" - "grpc.pc") - +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 01988c2..b304cc9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17705,7 +17705,7 @@ generate_pkgconfig( + "high performance general RPC framework" + "${gRPC_CORE_VERSION}" + "gpr openssl absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_variant" +- "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz" ++ "-lgrpc -lgrpc_upbdefs -laddress_sorting -lre2 -lupb_fastdecode -lupb_json -lupb_pb -lupb_handlers -lupb_textformat -lupb_reflection -lupb -lcares -lz -labsl_statusor -labsl_status -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_synchronization -labsl_time -labsl_time_zone -labsl_civil_time -labsl_graphcycles_internal -labsl_symbolize -labsl_demangle_internal -labsl_malloc_internal -labsl_stacktrace -labsl_debugging_internal -labsl_exponential_biased -labsl_cord -labsl_str_format_internal -labsl_hash -labsl_bad_variant_access -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_base -labsl_spinlock_wait -labsl_int128 -labsl_city -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity" + "" + "grpc.pc") + diff --git a/ports/grpc/snprintf.patch b/ports/grpc/snprintf.patch index d75a2059162a7f..b5012ad2dba8bf 100644 --- a/ports/grpc/snprintf.patch +++ b/ports/grpc/snprintf.patch @@ -1,12 +1,12 @@ -diff --git a/src/core/tsi/alts/crypt/aes_gcm.cc b/src/core/tsi/alts/crypt/aes_gcm.cc -index b761224..88a3d6b 100644 ---- a/src/core/tsi/alts/crypt/aes_gcm.cc -+++ b/src/core/tsi/alts/crypt/aes_gcm.cc -@@ -19,6 +19,7 @@ - #include - - #include -+#include - - #include - #include +diff --git a/src/core/tsi/alts/crypt/aes_gcm.cc b/src/core/tsi/alts/crypt/aes_gcm.cc +index b761224..88a3d6b 100644 +--- a/src/core/tsi/alts/crypt/aes_gcm.cc ++++ b/src/core/tsi/alts/crypt/aes_gcm.cc +@@ -19,6 +19,7 @@ + #include + + #include ++#include + + #include + #include From 67ad5fbcb0255ee1b786415352da10126627526b Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Tue, 2 Nov 2021 16:16:30 +0800 Subject: [PATCH 21/25] update version --- versions/g-/grpc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/g-/grpc.json b/versions/g-/grpc.json index 076d5c6d66780c..9e15342a6ba802 100644 --- a/versions/g-/grpc.json +++ b/versions/g-/grpc.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "5fb5e2b74ed14aed08c1491614f7be8ce85df44f", + "git-tree": "aa849661701da3a10cd8197c1da416e3a857eefc", "version-semver": "1.41.0", "port-version": 0 }, From bc54b4aa5d04dbbae8aece59fccc09577a3b6ff4 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Tue, 2 Nov 2021 16:17:46 +0800 Subject: [PATCH 22/25] revert patch format --- ports/grpc/00014-pkgconfig-upbdefs.patch | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ports/grpc/00014-pkgconfig-upbdefs.patch b/ports/grpc/00014-pkgconfig-upbdefs.patch index 8b687ee6f2fb08..196c4096ccc3c1 100644 --- a/ports/grpc/00014-pkgconfig-upbdefs.patch +++ b/ports/grpc/00014-pkgconfig-upbdefs.patch @@ -1,13 +1,13 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 01988c2..b304cc9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -17705,7 +17705,7 @@ generate_pkgconfig( - "high performance general RPC framework" - "${gRPC_CORE_VERSION}" - "gpr openssl absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_variant" -- "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz" -+ "-lgrpc -lgrpc_upbdefs -laddress_sorting -lre2 -lupb_fastdecode -lupb_json -lupb_pb -lupb_handlers -lupb_textformat -lupb_reflection -lupb -lcares -lz -labsl_statusor -labsl_status -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_synchronization -labsl_time -labsl_time_zone -labsl_civil_time -labsl_graphcycles_internal -labsl_symbolize -labsl_demangle_internal -labsl_malloc_internal -labsl_stacktrace -labsl_debugging_internal -labsl_exponential_biased -labsl_cord -labsl_str_format_internal -labsl_hash -labsl_bad_variant_access -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_base -labsl_spinlock_wait -labsl_int128 -labsl_city -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity" - "" - "grpc.pc") - +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 01988c2..b304cc9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17705,7 +17705,7 @@ generate_pkgconfig( + "high performance general RPC framework" + "${gRPC_CORE_VERSION}" + "gpr openssl absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_variant" +- "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz" ++ "-lgrpc -lgrpc_upbdefs -laddress_sorting -lre2 -lupb_fastdecode -lupb_json -lupb_pb -lupb_handlers -lupb_textformat -lupb_reflection -lupb -lcares -lz -labsl_statusor -labsl_status -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_synchronization -labsl_time -labsl_time_zone -labsl_civil_time -labsl_graphcycles_internal -labsl_symbolize -labsl_demangle_internal -labsl_malloc_internal -labsl_stacktrace -labsl_debugging_internal -labsl_exponential_biased -labsl_cord -labsl_str_format_internal -labsl_hash -labsl_bad_variant_access -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_base -labsl_spinlock_wait -labsl_int128 -labsl_city -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity" + "" + "grpc.pc") + From f70cecf85572053785dbff2e699fe6409b098045 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Tue, 2 Nov 2021 16:18:01 +0800 Subject: [PATCH 23/25] update version --- versions/g-/grpc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/g-/grpc.json b/versions/g-/grpc.json index 9e15342a6ba802..c37ab52fb3cb67 100644 --- a/versions/g-/grpc.json +++ b/versions/g-/grpc.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "aa849661701da3a10cd8197c1da416e3a857eefc", + "git-tree": "d3a9f271ad50d404043c06a82f1bef62f34f4260", "version-semver": "1.41.0", "port-version": 0 }, From 35a08f64299d092055373891ae3ab224339952e0 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Wed, 10 Nov 2021 18:30:00 +0800 Subject: [PATCH 24/25] Remove unnecessary additional --- ports/grpc/00014-pkgconfig-upbdefs.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/grpc/00014-pkgconfig-upbdefs.patch b/ports/grpc/00014-pkgconfig-upbdefs.patch index 196c4096ccc3c1..2aa257b3ec3183 100644 --- a/ports/grpc/00014-pkgconfig-upbdefs.patch +++ b/ports/grpc/00014-pkgconfig-upbdefs.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 01988c2..b304cc9 100644 +index f7d677c..d527ff4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17705,7 +17705,7 @@ generate_pkgconfig( @@ -7,7 +7,7 @@ index 01988c2..b304cc9 100644 "${gRPC_CORE_VERSION}" "gpr openssl absl_base absl_bind_front absl_cord absl_core_headers absl_flat_hash_map absl_inlined_vector absl_memory absl_optional absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_variant" - "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz" -+ "-lgrpc -lgrpc_upbdefs -laddress_sorting -lre2 -lupb_fastdecode -lupb_json -lupb_pb -lupb_handlers -lupb_textformat -lupb_reflection -lupb -lcares -lz -labsl_statusor -labsl_status -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_synchronization -labsl_time -labsl_time_zone -labsl_civil_time -labsl_graphcycles_internal -labsl_symbolize -labsl_demangle_internal -labsl_malloc_internal -labsl_stacktrace -labsl_debugging_internal -labsl_exponential_biased -labsl_cord -labsl_str_format_internal -labsl_hash -labsl_bad_variant_access -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_base -labsl_spinlock_wait -labsl_int128 -labsl_city -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity" ++ "-lgrpc -lgrpc_upbdefs -laddress_sorting -lre2 -lupb_fastdecode -lupb_json -lupb_pb -lupb_handlers -lupb_textformat -lupb_reflection -lupb -lcares -lz" "" "grpc.pc") From 8659df0427adc0021709ff4165e5ae9671cda607 Mon Sep 17 00:00:00 2001 From: Jonliu1993 <13720414433@163.com> Date: Wed, 10 Nov 2021 18:30:42 +0800 Subject: [PATCH 25/25] update version --- versions/g-/grpc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/g-/grpc.json b/versions/g-/grpc.json index c37ab52fb3cb67..4d776dcd42b805 100644 --- a/versions/g-/grpc.json +++ b/versions/g-/grpc.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "d3a9f271ad50d404043c06a82f1bef62f34f4260", + "git-tree": "5e3795bf43afe5243e47e18ac66a28bc722207f5", "version-semver": "1.41.0", "port-version": 0 },