Skip to content

Commit

Permalink
[3rd-party] added vcpkg and grpc update
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeliao committed Oct 3, 2024
1 parent d79d2c9 commit 5bb9771
Show file tree
Hide file tree
Showing 16 changed files with 332 additions and 1,561 deletions.
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
Loading

0 comments on commit 5bb9771

Please sign in to comment.