[grpc] More de-vendoring (#40140)

This commit is contained in:
Kai Pastor 2024-07-30 08:08:48 +02:00 committed by GitHub
parent 5ac34f9b6f
commit 136a0d8b8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 84 additions and 34 deletions

View File

@ -1,25 +1,68 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a3b39a1637..8c1dc7223d 100644
index a3b39a1..8d7c1f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3455,7 +3455,7 @@ target_link_libraries(gtest
@@ -3213,17 +3213,6 @@ add_library(grpc_unsecure
src/core/tsi/local_transport_security.cc
src/core/tsi/transport_security.cc
src/core/tsi/transport_security_grpc.cc
- third_party/upb/upb/message/accessors.c
- third_party/upb/upb/mini_descriptor/build_enum.c
- third_party/upb/upb/mini_descriptor/decode.c
- third_party/upb/upb/mini_descriptor/internal/base92.c
- third_party/upb/upb/mini_descriptor/internal/encode.c
- third_party/upb/upb/mini_descriptor/link.c
- third_party/upb/upb/wire/decode.c
- third_party/upb/upb/wire/decode_fast.c
- third_party/upb/upb/wire/encode.c
- third_party/upb/upb/wire/eps_copy_input_stream.c
- third_party/upb/upb/wire/reader.c
${gRPC_ADDITIONAL_DLL_SRC}
)
@@ -3456,6 +3445,7 @@ target_link_libraries(gtest
endif()
-
+if (0)
+if(0) # vcpkg upb
add_library(upb ${_gRPC_STATIC_WIN32}
third_party/upb/upb/base/status.c
third_party/upb/upb/mem/alloc.c
@@ -3818,6 +3818,7 @@ if(gRPC_INSTALL)
@@ -3818,6 +3808,7 @@ if(gRPC_INSTALL)
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
endif()
+endif()
+endif() # vcpkg upb
if(gRPC_BUILD_TESTS)
@@ -30412,9 +30413,9 @@ generate_pkgconfig(
@@ -5190,25 +5181,6 @@ add_library(grpc_authorization_provider
src/core/tsi/alts/handshaker/transport_security_common_api.cc
src/core/tsi/transport_security.cc
src/core/tsi/transport_security_grpc.cc
- third_party/upb/upb/hash/common.c
- third_party/upb/upb/message/accessors.c
- third_party/upb/upb/message/array.c
- third_party/upb/upb/message/map.c
- third_party/upb/upb/message/map_sorter.c
- third_party/upb/upb/message/message.c
- third_party/upb/upb/mini_descriptor/build_enum.c
- third_party/upb/upb/mini_descriptor/decode.c
- third_party/upb/upb/mini_descriptor/internal/base92.c
- third_party/upb/upb/mini_descriptor/internal/encode.c
- third_party/upb/upb/mini_descriptor/link.c
- third_party/upb/upb/mini_table/extension_registry.c
- third_party/upb/upb/mini_table/internal/message.c
- third_party/upb/upb/mini_table/message.c
- third_party/upb/upb/wire/decode.c
- third_party/upb/upb/wire/decode_fast.c
- third_party/upb/upb/wire/encode.c
- third_party/upb/upb/wire/eps_copy_input_stream.c
- third_party/upb/upb/wire/reader.c
)
target_compile_features(grpc_authorization_provider PUBLIC cxx_std_14)
@@ -30412,9 +30384,9 @@ generate_pkgconfig(
"high performance general RPC framework"
"${gRPC_CORE_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr"
@ -31,7 +74,7 @@ index a3b39a1637..8c1dc7223d 100644
"grpc.pc")
# grpc_unsecure .pc file
@@ -30423,9 +30424,9 @@ generate_pkgconfig(
@@ -30423,9 +30395,9 @@ generate_pkgconfig(
"high performance general RPC framework without SSL"
"${gRPC_CORE_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr"
@ -43,7 +86,7 @@ index a3b39a1637..8c1dc7223d 100644
"grpc_unsecure.pc")
# grpc++ .pc file
@@ -30434,9 +30435,9 @@ generate_pkgconfig(
@@ -30434,9 +30406,9 @@ generate_pkgconfig(
"C++ wrapper for gRPC"
"${gRPC_CPP_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr grpc"
@ -55,7 +98,7 @@ index a3b39a1637..8c1dc7223d 100644
"grpc++.pc")
# grpc++_unsecure .pc file
@@ -30445,7 +30446,7 @@ generate_pkgconfig(
@@ -30445,7 +30417,7 @@ generate_pkgconfig(
"C++ wrapper for gRPC without SSL"
"${gRPC_CPP_VERSION}"
"absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr grpc_unsecure"
@ -66,7 +109,7 @@ index a3b39a1637..8c1dc7223d 100644
+ "-laddress_sorting -lupb"
"grpc++_unsecure.pc")
diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in
index 98d8c6d8b9..7cad2abca1 100644
index 98d8c6d..7cad2ab 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)
@ -78,29 +121,23 @@ index 98d8c6d8b9..7cad2abca1 100644
# Targets
include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake)
diff --git a/cmake/upb.cmake b/cmake/upb.cmake
index 9156e5f48f..6ff5125938 100644
index 9156e5f..31324fa 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.
@@ -14,7 +14,15 @@
+set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-gen" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-gen")
+if (0)
set(UPB_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/upb)
set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/third_party/utf8_range")
-set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/third_party/utf8_range")
+set(_gRPC_UPB_INCLUDE_DIR "")
set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-gen" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-gen")
set(_gRPC_UPB_LIBRARIES upb)
+else()
+ find_package(upb CONFIG REQUIRED)
+ set(_gRPC_UPB_INCLUDE_DIR)
+ set(_gRPC_FIND_UPB "if(NOT upb_FOUND)\n find_package(upb CONFIG REQUIRED)\nendif()")
+ add_library(upb_collections_lib ALIAS upb::upb)
+ add_library(upb_json_lib ALIAS upb::upb)
+ add_library(upb_textformat_lib ALIAS upb::upb)
+ add_library(upb ALIAS upb::upb)
+ add_library(utf8_range_lib ALIAS utf8_range::utf8_range)
+endif()
\ No newline at end of file
+
+find_package(upb CONFIG REQUIRED)
+set(_gRPC_FIND_UPB "find_dependency(upb CONFIG)")
+add_library(upb_collections_lib ALIAS upb::upb)
+add_library(upb_json_lib ALIAS upb::upb)
+add_library(upb_textformat_lib ALIAS upb::upb)
+add_library(upb ALIAS upb::upb)
+add_library(utf8_range_lib ALIAS utf8_range::utf8_range)

View File

@ -19,8 +19,18 @@ vcpkg_from_github(
00016-fix-plugin-targets.patch
00017-abseil.patch
)
# Ensure de-vendoring
file(REMOVE_RECURSE
"${SOURCE_PATH}/third_party/abseil-cpp"
"${SOURCE_PATH}/third_party/cares"
"${SOURCE_PATH}/third_party/protobuf"
"${SOURCE_PATH}/third_party/re2"
"${SOURCE_PATH}/third_party/upb"
"${SOURCE_PATH}/third_party/utf8_range"
"${SOURCE_PATH}/third_party/zlib"
)
if(NOT TARGET_TRIPLET STREQUAL HOST_TRIPLET)
if(VCPKG_CROSSCOMPILING)
vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/grpc")
endif()

View File

@ -1,6 +1,7 @@
{
"name": "grpc",
"version-semver": "1.60.0",
"port-version": 1,
"description": "gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere. gRPC enables client and server applications to communicate transparently, and simplifies the building of connected systems.",
"homepage": "https://github.com/grpc/grpc",
"license": "Apache-2.0",
@ -36,9 +37,6 @@
"zlib"
],
"features": {
"absl-sync": {
"description": "Deprecated."
},
"codegen": {
"description": "Build code generator machinery",
"supports": "!uwp"

View File

@ -3226,7 +3226,7 @@
},
"grpc": {
"baseline": "1.60.0",
"port-version": 0
"port-version": 1
},
"grppi": {
"baseline": "0.4.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "a0e82a8a701c3b0397dae373e16c527d1cafaae5",
"version-semver": "1.60.0",
"port-version": 1
},
{
"git-tree": "0f654950a7b38b7023e12c8579a09cf854097331",
"version-semver": "1.60.0",