Skip to content

Commit

Permalink
[grpc] Update to v1.12.0 [protobuf] Update to v3.6.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jozefizso authored and ras0219-msft committed Jul 17, 2018
1 parent a1f0dcd commit c95b6bf
Show file tree
Hide file tree
Showing 11 changed files with 138 additions and 160 deletions.
2 changes: 1 addition & 1 deletion ports/caffe2/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ vcpkg_configure_cmake(
-DUSE_SNPE=OFF
-DUSE_ZMQ=OFF
-DBUILD_TEST=OFF
-DPROTOBUF_PROTOC_EXECUTABLE:FILEPATH=${CURRENT_INSTALLED_DIR}/tools/protoc.exe
-DPROTOBUF_PROTOC_EXECUTABLE:FILEPATH=${CURRENT_INSTALLED_DIR}/tools/protobuf/protoc.exe
)

vcpkg_install_cmake()
Expand Down
2 changes: 1 addition & 1 deletion ports/google-cloud-cpp/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: google-cloud-cpp
Version: 0.1.0
Version: 0.1.0-1
Build-Depends: grpc, gtest
Description: C++ Client Libraries for Google Cloud Platform APIs.
24 changes: 24 additions & 0 deletions ports/google-cloud-cpp/include-protobuf.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/bigtable/CMakeLists.txt b/bigtable/CMakeLists.txt
index 1b8089f..771e1ec 100644
--- a/bigtable/CMakeLists.txt
+++ b/bigtable/CMakeLists.txt
@@ -69,6 +69,10 @@ set(PROTOBUF_IMPORT_DIRS "${PROJECT_THIRD_PARTY_DIR}/googleapis" "${PROJECT_SOUR
if(GRPC_ROOT_DIR)
list(INSERT PROTOBUF_IMPORT_DIRS 0 "${GRPC_ROOT_DIR}/third_party/protobuf/src")
endif(GRPC_ROOT_DIR)
+find_path(PROTO_INCLUDE_DIR google/protobuf/descriptor.proto)
+if(PROTO_INCLUDE_DIR)
+ list(INSERT PROTOBUF_IMPORT_DIRS 0 "${PROTO_INCLUDE_DIR}")
+endif()

# Get the destination directories based on the GNU recommendations.
include(GNUInstallDirs)
@@ -110,7 +114,7 @@ enable_testing()

# Capture the compiler version and the git revision into variables, then
# generate a config file with the values.
-if (IS_DIRECTORY ${PROJECT_SOURCE_DIR}/.git)
+if (IS_DIRECTORY ${PROJECT_SOURCE_DIR}/.git AND 0)
execute_process(COMMAND git rev-parse --short HEAD
OUTPUT_VARIABLE GIT_HEAD_LOG ERROR_VARIABLE GIT_HEAD_LOG)
else ()
2 changes: 2 additions & 0 deletions ports/google-cloud-cpp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ vcpkg_from_github(
REF v0.1.0
SHA512 3947cc24ca1ed97309f055f17945afe2d6b22ae8f54f86d3395f8c491b7409d4b7bb12206889d04d07f51236e9fd5afd65b904c8c80521a3313588d8069545c2
HEAD_REF master
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/include-protobuf.patch"
)

set(GOOGLEAPIS_VERSION 92f10d7033c6fa36e1a5a369ab5aa8bafd564009)
Expand Down
2 changes: 1 addition & 1 deletion ports/grpc/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: grpc
Version: 1.10.1-3
Version: 1.12.0-2
Build-Depends: zlib, openssl, protobuf, c-ares (!uwp)
Description: An RPC library and framework
22 changes: 0 additions & 22 deletions ports/grpc/disable-csharp-ext.patch

This file was deleted.

129 changes: 57 additions & 72 deletions ports/grpc/fix-uwp.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 51f6e17..d33b147 100644
index f58ee19..dda72e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,6 +84,9 @@ if(UNIX)
@@ -87,6 +87,9 @@ if(UNIX)
endif()
if(WIN32)
set(_gRPC_PLATFORM_WINDOWS ON)
+ if(${CMAKE_SYSTEM_NAME} MATCHES "WindowsStore")
+ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ set(_gRPC_PLATFORM_UWP ON)
+ endif()
endif()

set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
@@ -144,6 +147,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR})
@@ -152,6 +155,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR})
# ``.proto`` files
#
function(protobuf_generate_grpc_cpp)
Expand All @@ -23,102 +23,87 @@ index 51f6e17..d33b147 100644
if(NOT ARGN)
message(SEND_ERROR "Error: PROTOBUF_GENERATE_GRPC_CPP() called without any proto files")
return()
@@ -178,6 +185,7 @@ function(protobuf_generate_grpc_cpp)
@@ -186,6 +193,7 @@ function(protobuf_generate_grpc_cpp)
endforeach()
endfunction()

+if(NOT _gRPC_PLATFORM_UWP)
add_custom_target(plugins
DEPENDS
grpc_cpp_plugin
@@ -199,6 +207,7 @@ add_custom_target(tools_c
gen_legal_metadata_characters
gen_percent_encoding_tables
)
+endif()

add_custom_target(tools_cxx
DEPENDS
@@ -3223,7 +3232,7 @@ if (gRPC_INSTALL)
)
endif()
@@ -215,6 +223,8 @@ add_custom_target(tools_cxx
add_custom_target(tools
DEPENDS tools_c tools_cxx)

-
+if(NOT _gRPC_PLATFORM_UWP)
add_library(grpc++_error_details
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.grpc.pb.cc
@@ -3285,6 +3294,7 @@ if (gRPC_INSTALL)
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
endif()
+endif()
+
if (gRPC_BUILD_TESTS)
add_custom_target(buildtests_c)
add_dependencies(buildtests_c algorithm_test)
@@ -3595,7 +3605,6 @@ foreach(_hdr
DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
)
endforeach()
-endif (gRPC_BUILD_CODEGEN)

@@ -3347,6 +3357,7 @@ endforeach()

endif (gRPC_BUILD_TESTS)

+if(NOT _gRPC_PLATFORM_UWP)
add_library(grpc++_reflection
src/cpp/ext/proto_server_reflection.cc
src/cpp/ext/proto_server_reflection_plugin.cc
@@ -3409,6 +3420,7 @@ if (gRPC_INSTALL)
if (gRPC_INSTALL)
@@ -3605,6 +3614,7 @@ if (gRPC_INSTALL)
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
endif()
+endif()
+endif (gRPC_BUILD_CODEGEN)

if (gRPC_BUILD_TESTS)

@@ -4197,6 +4209,7 @@ endforeach()

endif (gRPC_BUILD_TESTS)

+if(NOT _gRPC_PLATFORM_UWP)
add_library(grpc_plugin_support
src/compiler/cpp_generator.cc
src/compiler/csharp_generator.cc
@@ -4236,6 +4249,8 @@ target_link_libraries(grpc_plugin_support
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
)
+endif()
+

foreach(_hdr
include/grpc++/impl/codegen/config_protobuf.h
@@ -4248,7 +4263,7 @@ foreach(_hdr
@@ -3725,7 +3735,7 @@ foreach(_hdr
DESTINATION "${gRPC_INSTALL_INCLUDEDIR}/${_path}"
)
endforeach()
-endif (gRPC_BUILD_CODEGEN)
+


-
+if(NOT _gRPC_PLATFORM_UWP)
if (gRPC_INSTALL)
install(TARGETS grpc_plugin_support EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
@@ -4256,6 +4271,7 @@ if (gRPC_INSTALL)
@@ -3735,6 +3745,7 @@ if (gRPC_INSTALL)
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
endif()
+endif()
+endif (gRPC_BUILD_CODEGEN)

if (gRPC_BUILD_TESTS)

@@ -10252,6 +10268,7 @@ target_link_libraries(grpc_cli
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 55efe0e..f538f26 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
@@ -60,6 +60,8 @@ bool check_bios_data(const char* bios_data_file) {

endif (gRPC_BUILD_TESTS)
static void init_mu(void) { gpr_mu_init(&g_mu); }

+if(NOT _gRPC_PLATFORM_UWP)
add_executable(grpc_cpp_plugin
src/compiler/cpp_plugin.cc
)
@@ -10488,6 +10505,7 @@ if (gRPC_INSTALL)
ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR}
)
endif()
+endif()

if (gRPC_BUILD_TESTS)
+#if !defined(WINAPI_FAMILY) || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP
+
static bool run_powershell() {
SECURITY_ATTRIBUTES sa;
sa.nLength = sizeof(sa);
@@ -97,8 +99,12 @@ static bool run_powershell() {
CloseHandle(h);
return true;
}
+#endif

bool grpc_alts_is_running_on_gcp() {
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
+ g_is_on_compute_engine = false;
+#else
gpr_once_init(&g_once, init_mu);
gpr_mu_lock(&g_mu);
if (!g_compute_engine_detection_done) {
@@ -108,6 +114,7 @@ bool grpc_alts_is_running_on_gcp() {
g_compute_engine_detection_done = true;
}
gpr_mu_unlock(&g_mu);
+#endif
return g_is_on_compute_engine;
}

34 changes: 19 additions & 15 deletions ports/grpc/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,31 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO grpc/grpc
REF v1.10.1
SHA512 2221d902c60eada6dd1547a63d26bd3b30cb6710247b5e48523bacde498a3691cc177f1dbe9db8a007b8ae341a5b0c8ec999539e26a9bcff480a8d0b02140997
REF v1.12.0
SHA512 68a8c261ea570790974769d6c0ca8138cf4242b79e9ff74a11b10d35a27f98ff24c03f3d05932ac46811c0ba7d1a094388ae8dbeb495fc8e723ad74695994d49
HEAD_REF master
PATCHES
${CMAKE_CURRENT_LIST_DIR}/disable-csharp-ext.patch
${CMAKE_CURRENT_LIST_DIR}/fix-uwp.patch
)

if(VCPKG_CRT_LINKAGE STREQUAL static)
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(gRPC_BUILD_CODEGEN OFF)
else()
set(gRPC_BUILD_CODEGEN ON)
endif()

if(VCPKG_CRT_LINKAGE STREQUAL "static")
set(gRPC_MSVC_STATIC_RUNTIME ON)
else()
set(gRPC_MSVC_STATIC_RUNTIME OFF)
endif()


if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(cares_CARES_PROVIDER OFF)
else()
set(cares_CARES_PROVIDER "package")
endif()


vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
Expand All @@ -44,6 +47,7 @@ vcpkg_configure_cmake(
-DgRPC_ZLIB_PROVIDER=package
-DgRPC_SSL_PROVIDER=package
-DgRPC_PROTOBUF_PROVIDER=package
-DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG
-DgRPC_CARES_PROVIDER=${cares_CARES_PROVIDER}
-DgRPC_GFLAGS_PROVIDER=none
-DgRPC_BENCHMARK_PROVIDER=none
Expand All @@ -52,30 +56,30 @@ vcpkg_configure_cmake(
-DgRPC_INSTALL_LIBDIR:STRING=lib
-DgRPC_INSTALL_INCLUDEDIR:STRING=include
-DgRPC_INSTALL_CMAKEDIR:STRING=share/grpc
-DgRPC_BUILD_CODEGEN=${gRPC_BUILD_CODEGEN}
)

# gRPC runs built executables during the build, so they need access to the installed DLLs.
set(ENV{PATH} "$ENV{PATH};${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin")
vcpkg_install_cmake(ADD_BIN_TO_PATH)

vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH "share/grpc")

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright)

# Install tools and plugins
# Install tools
file(GLOB TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.exe")
if(TOOLS)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/grpc)
file(COPY ${TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/grpc)
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/grpc)
endif()

if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
else()
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) # Leave the executable files in bin/ and debug/bin
file(GLOB EXES "${CURRENT_PACKAGES_DIR}/bin/*.exe" "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe")
if(EXES)
file(REMOVE ${EXES})
endif()

# Ignore the C# extension DLL in bin/
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

vcpkg_copy_pdbs()
2 changes: 1 addition & 1 deletion ports/protobuf/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: protobuf
Version: 3.5.1-5
Version: 3.6.0.1
Description: Protocol Buffers - Google's data interchange format

Feature: zlib
Expand Down
4 changes: 2 additions & 2 deletions ports/protobuf/js-embed.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ index 107c1c5..233bcf6 100644
--- a/cmake/libprotoc.cmake
+++ b/cmake/libprotoc.cmake
@@ -73,7 +73,7 @@ set(libprotoc_files
${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_message_field.cc
${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc
${protobuf_source_dir}/src/google/protobuf/compiler/java/java_string_field.cc
${protobuf_source_dir}/src/google/protobuf/compiler/java/java_string_field_lite.cc
${protobuf_source_dir}/src/google/protobuf/compiler/js/js_generator.cc
- ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.cc
+ ${CMAKE_CURRENT_BINARY_DIR}/well_known_types_embed.cc
Expand Down
Loading

0 comments on commit c95b6bf

Please sign in to comment.