Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update 3rd party libraries, part2 #3707

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion 3rd-party/submodule_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ info on where to find release information about the submodule.
**This file needs updating when a submodule is updated!**

### gRPC
Version: 1.52.1 (+[our patches](https://github.com/CanonicalLtd/grpc/compare/v1.52.1..ba8e7f72)) |
Version: 1.60.0 (+[our patches](https://github.com/canonical/grpc/compare/v1.60.0...canonical:grpc:multipass_on_grpc_1.60.0)) |
<https://github.com/CanonicalLtd/grpc.git> |
<https://github.com/grpc/grpc/releases>

Expand Down Expand Up @@ -50,3 +50,8 @@ Version: 1.9.4 |
Version: 1.13.3 |
<https://github.com/pocoproject/poco.git> |
<https://github.com/pocoproject/poco/releases>

### vcpkg
Version: 2024.09.30 |
<https://github.com/microsoft/vcpkg.git> |
<https://github.com/microsoft/vcpkg/releases>
2 changes: 1 addition & 1 deletion 3rd-party/vcpkg
Submodule vcpkg updated 7042 files
73 changes: 73 additions & 0 deletions 3rd-party/vcpkg-ports/grpc/00001-fix-uwp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ec370e9..4f7d770 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -237,6 +237,9 @@ if(UNIX)
endif()
if(WIN32)
set(_gRPC_PLATFORM_WINDOWS ON)
+ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ set(_gRPC_PLATFORM_UWP ON)
+ endif()
endif()

if (APPLE AND NOT DEFINED CMAKE_CXX_STANDARD)
@@ -267,6 +270,9 @@ if(MSVC)
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4267")
# TODO(jtattermusch): needed to build boringssl with VS2017, revisit later
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4987 /wd4774 /wd4819 /wd4996 /wd4619")
+ if(_gRPC_PLATFORM_UWP)
+ add_definitions(-DGRPC_ARES=0)
+ endif()
# Silences thousands of trucation warnings
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4503")
# Tell MSVC to build grpc using utf-8
@@ -439,6 +445,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR})
# ``.proto`` files
#
function(protobuf_generate_grpc_cpp)
+ if(_gRPC_PLATFORM_UWP)
+ return()
+ endif()
+
if(NOT ARGN)
message(SEND_ERROR "Error: PROTOBUF_GENERATE_GRPC_CPP() called without any proto files")
return()
@@ -561,6 +571,7 @@ if (gRPC_BUILD_GRPC_RUBY_PLUGIN)
list(APPEND _gRPC_PLUGIN_LIST grpc_ruby_plugin)
endif ()

+if(NOT _gRPC_PLATFORM_UWP)
add_custom_target(plugins
DEPENDS ${_gRPC_PLUGIN_LIST}
)
@@ -575,6 +586,7 @@ add_custom_target(tools_cxx

add_custom_target(tools
DEPENDS tools_c tools_cxx)
+endif()

protobuf_generate_grpc_cpp_with_import_path_correction(
src/proto/grpc/channelz/channelz.proto src/proto/grpc/channelz/channelz.proto
diff --git a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
index b034cca..5dbdfe3 100644
--- a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
+++ b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
@@ -40,6 +40,7 @@ bool check_bios_data(const char*) { return false; }
bool check_windows_registry_product_name(HKEY root_key,
const char* reg_key_path,
const char* reg_key_name) {
+ #if !defined(WINAPI_FAMILY) || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
const size_t kProductNameBufferSize = 256;
char const expected_substr[] = "Google";

@@ -72,6 +73,9 @@ bool check_windows_registry_product_name(HKEY root_key,
}

return strstr(buffer, expected_substr) != nullptr;
+#else
+ return false;
+#endif
}

} // namespace internal
10 changes: 5 additions & 5 deletions 3rd-party/vcpkg-ports/grpc/00004-link-gdi32-on-windows.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 25990a5d8a..8a632d2289 100644
index fce68b9..220f251 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -404,7 +404,7 @@ if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/xds)
@@ -432,7 +432,7 @@ if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/xds)
endif()

if(WIN32)
- set(_gRPC_BASELIB_LIBRARIES ws2_32 crypt32)
+ set(_gRPC_BASELIB_LIBRARIES wsock32 ws2_32 crypt32 gdi32)
- set(_gRPC_ALLTARGETS_LIBRARIES ${_gRPC_ALLTARGETS_LIBRARIES} ws2_32 crypt32)
+ set(_gRPC_ALLTARGETS_LIBRARIES ${_gRPC_ALLTARGETS_LIBRARIES} wsock32 ws2_32 crypt32 gdi32)
set(_gRPC_STATIC_WIN32 STATIC)
endif()

# Create directory for proto source files
12 changes: 6 additions & 6 deletions 3rd-party/vcpkg-ports/grpc/00005-fix-uwp-error.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.cc b/src/core/ext/transport/chttp2/transport/hpack_parser.cc
index b0d3a6465b..5c48f1aa30 100644
index 31bf464..d1007e4 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_parser.cc
+++ b/src/core/ext/transport/chttp2/transport/hpack_parser.cc
@@ -1037,7 +1037,7 @@ class HPackParser::Parser {
@@ -689,7 +689,7 @@ class HPackParser::Parser {
}

private:
void GPR_ATTRIBUTE_NOINLINE LogHeader(const HPackTable::Memento& memento) {
- const char* type;
+ const char* type = nullptr;
switch (log_info_.type) {
case LogInfo::kHeaders:
type = "HDR";
diff --git a/src/core/lib/slice/slice.cc b/src/core/lib/slice/slice.cc
index 898a62823c..6b31cdc082 100644
index 6180ef1..a8e8110 100644
--- a/src/core/lib/slice/slice.cc
+++ b/src/core/lib/slice/slice.cc
@@ -188,6 +188,7 @@ grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr<char> p,
Expand All @@ -33,10 +33,10 @@ index 898a62823c..6b31cdc082 100644
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 141b16e345..89d9d6dafd 100644
index 3dda49d..202caa5 100644
--- a/src/core/lib/surface/server.cc
+++ b/src/core/lib/surface/server.cc
@@ -902,7 +902,7 @@ grpc_call_error Server::QueueRequestedCall(size_t cq_idx, RequestedCall* rc) {
@@ -1057,7 +1057,7 @@ grpc_call_error Server::QueueRequestedCall(size_t cq_idx, RequestedCall* rc) {
FailCall(cq_idx, rc, GRPC_ERROR_CREATE("Server Shutdown"));
return GRPC_CALL_OK;
}
Expand Down
143 changes: 143 additions & 0 deletions 3rd-party/vcpkg-ports/grpc/00009-use-system-upb.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a3b39a1..8d7c1f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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) # vcpkg upb
add_library(upb ${_gRPC_STATIC_WIN32}
third_party/upb/upb/base/status.c
third_party/upb/upb/mem/alloc.c
@@ -3818,6 +3808,7 @@ if(gRPC_INSTALL)
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
endif()
+endif() # vcpkg upb

if(gRPC_BUILD_TESTS)

@@ -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"
- "libcares openssl re2 zlib"
+ "libcares openssl re2 zlib utf8_range"
"-lgrpc"
- "-laddress_sorting -lupb -lupb_textformat_lib -lupb_json_lib -lutf8_range_lib -lupb_collections_lib"
+ "-laddress_sorting -lupb"
"grpc.pc")

# grpc_unsecure .pc file
@@ -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"
- "libcares zlib"
+ "libcares zlib utf8_range"
"-lgrpc_unsecure"
- "-laddress_sorting -lutf8_range_lib -lupb -lupb_collections_lib"
+ "-laddress_sorting -lupb"
"grpc_unsecure.pc")

# grpc++ .pc file
@@ -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"
- "libcares openssl re2 zlib"
+ "libcares openssl re2 zlib utf8_range"
"-lgrpc++"
- "-laddress_sorting -lupb -lupb_textformat_lib -lupb_json_lib -lutf8_range_lib -lupb_collections_lib"
+ "-laddress_sorting -lupb"
"grpc++.pc")

# grpc++_unsecure .pc file
@@ -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"
- "libcares zlib"
+ "libcares zlib utf8_range"
"-lgrpc++_unsecure"
- "-laddress_sorting -lutf8_range_lib -lupb -lupb_collections_lib"
+ "-laddress_sorting -lupb"
"grpc++_unsecure.pc")
diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in
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)
@_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 9156e5f..31324fa 100644
--- a/cmake/upb.cmake
+++ b/cmake/upb.cmake
@@ -14,7 +14,15 @@

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 "")
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)
+
+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)
13 changes: 0 additions & 13 deletions 3rd-party/vcpkg-ports/grpc/00014-pkgconfig-upbdefs.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/cmake/download_archive.cmake b/cmake/download_archive.cmake
index 820aafafb7..a59b785c7e 100644
index 820aafa..a59b785 100644
--- a/cmake/download_archive.cmake
+++ b/cmake/download_archive.cmake
@@ -19,6 +19,7 @@ file(MAKE_DIRECTORY ${_download_archive_TEMPORARY_DIR})
Expand Down
12 changes: 12 additions & 0 deletions 3rd-party/vcpkg-ports/grpc/00016-fix-plugin-targets.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in
index 7cad2abca1..c287f3b413 100644
--- a/cmake/gRPCConfig.cmake.in
+++ b/cmake/gRPCConfig.cmake.in
@@ -12,6 +12,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules)

# Targets
include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake)
-if(NOT CMAKE_CROSSCOMPILING)
+if(@gRPC_BUILD_CODEGEN@)
include(${CMAKE_CURRENT_LIST_DIR}/gRPCPluginTargets.cmake)
endif()
36 changes: 36 additions & 0 deletions 3rd-party/vcpkg-ports/grpc/00017-abseil.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
index dde7570ede..43e06d7a69 100644
--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
+++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
@@ -32,6 +32,7 @@
#include "absl/strings/string_view.h"
#include "absl/strings/strip.h"
#include "absl/types/optional.h"
+#include "absl/strings/str_cat.h"

#include <grpc/impl/channel_arg_names.h>
#include <grpc/support/alloc.h>
diff --git a/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc b/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc
index 74f7392af9..656cdc427b 100644
--- a/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc
+++ b/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc
@@ -21,6 +21,7 @@
#include "src/core/lib/event_engine/cf_engine/cfstream_endpoint.h"
#include "src/core/lib/event_engine/trace.h"
#include "src/core/lib/gprpp/strerror.h"
+#include "absl/strings/str_cat.h"

namespace grpc_event_engine {
namespace experimental {
diff --git a/src/core/lib/gprpp/windows/directory_reader.cc b/src/core/lib/gprpp/windows/directory_reader.cc
index 790e213e78..103d68a5a3 100644
--- a/src/core/lib/gprpp/windows/directory_reader.cc
+++ b/src/core/lib/gprpp/windows/directory_reader.cc
@@ -28,6 +28,7 @@

#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
+#include "absl/strings/str_cat.h"

#include <grpc/support/log.h>

10 changes: 10 additions & 0 deletions 3rd-party/vcpkg-ports/grpc/gRPCTargets-vcpkg-tools.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
file(GLOB GRPC_PLUGINS "${_IMPORT_PREFIX}/../@HOST_TRIPLET@/tools/grpc/grpc_*_plugin*")

foreach(PLUGIN ${GRPC_PLUGINS})
get_filename_component(PLUGIN_NAME "${PLUGIN}" NAME_WE)
add_executable(gRPC::${PLUGIN_NAME} IMPORTED)
set_property(TARGET gRPC::${PLUGIN_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(gRPC::${PLUGIN_NAME} PROPERTIES
IMPORTED_LOCATION_RELEASE "${PLUGIN}"
)
endforeach()
Loading
Loading