From 5ffe09b704117911b107afe34b91b81061678ba7 Mon Sep 17 00:00:00 2001 From: Yuan Date: Wed, 4 Feb 2026 16:09:00 +0000 Subject: [PATCH 01/12] [VL] Enable VCPKG on Macos Signed-off-by: Yuan --- dev/build-arrow.sh | 3 +- dev/vcpkg/env.sh | 1 + dev/vcpkg/ports/grpc/00001-fix-uwp.patch | 73 ++++++++++++++ .../grpc/00002-static-linking-in-linux.patch | 16 +++ .../ports/grpc/00003-undef-base64-macro.patch | 13 +++ .../grpc/00004-link-gdi32-on-windows.patch | 13 +++ .../ports/grpc/00005-fix-uwp-error.patch | 47 +++++++++ .../ports/grpc/00009-use-system-upb.patch | 91 +++++++++++++++++ .../ports/grpc/00012-fix-use-cxx17.patch | 16 +++ .../ports/grpc/00014-pkgconfig-upbdefs.patch | 13 +++ .../grpc/00015-disable-download-archive.patch | 12 +++ dev/vcpkg/ports/grpc/00016_add_header.patch | 12 +++ .../ports/grpc/gRPCTargets-vcpkg-tools.cmake | 10 ++ dev/vcpkg/ports/grpc/macos.patch | 12 +++ dev/vcpkg/ports/grpc/portfile.cmake | 99 +++++++++++++++++++ dev/vcpkg/ports/grpc/snprintf.patch | 12 +++ .../ports/grpc/vcpkg-cmake-wrapper.cmake | 2 + dev/vcpkg/ports/grpc/vcpkg.json | 48 +++++++++ dev/vcpkg/toolchain.cmake | 6 +- dev/vcpkg/triplets/arm64-osx-release.cmake | 16 +++ dev/vcpkg/vcpkg.json | 6 +- ep/build-velox/src/build-velox.sh | 2 +- 22 files changed, 516 insertions(+), 7 deletions(-) create mode 100644 dev/vcpkg/ports/grpc/00001-fix-uwp.patch create mode 100644 dev/vcpkg/ports/grpc/00002-static-linking-in-linux.patch create mode 100644 dev/vcpkg/ports/grpc/00003-undef-base64-macro.patch create mode 100644 dev/vcpkg/ports/grpc/00004-link-gdi32-on-windows.patch create mode 100644 dev/vcpkg/ports/grpc/00005-fix-uwp-error.patch create mode 100644 dev/vcpkg/ports/grpc/00009-use-system-upb.patch create mode 100644 dev/vcpkg/ports/grpc/00012-fix-use-cxx17.patch create mode 100644 dev/vcpkg/ports/grpc/00014-pkgconfig-upbdefs.patch create mode 100644 dev/vcpkg/ports/grpc/00015-disable-download-archive.patch create mode 100644 dev/vcpkg/ports/grpc/00016_add_header.patch create mode 100644 dev/vcpkg/ports/grpc/gRPCTargets-vcpkg-tools.cmake create mode 100644 dev/vcpkg/ports/grpc/macos.patch create mode 100644 dev/vcpkg/ports/grpc/portfile.cmake create mode 100644 dev/vcpkg/ports/grpc/snprintf.patch create mode 100644 dev/vcpkg/ports/grpc/vcpkg-cmake-wrapper.cmake create mode 100644 dev/vcpkg/ports/grpc/vcpkg.json create mode 100644 dev/vcpkg/triplets/arm64-osx-release.cmake diff --git a/dev/build-arrow.sh b/dev/build-arrow.sh index 41bebc7c4c27..2f247424ad96 100755 --- a/dev/build-arrow.sh +++ b/dev/build-arrow.sh @@ -56,10 +56,11 @@ function build_arrow_cpp() { -DARROW_DEPENDENCY_SOURCE=BUNDLED \ -DARROW_WITH_THRIFT=ON \ -DARROW_WITH_LZ4=ON \ - -DARROW_WITH_SNAPPY=ON \ + -DARROW_WITH_SNAPPY=OFF \ -DARROW_WITH_ZLIB=${ARROW_WITH_ZLIB} \ -DARROW_WITH_ZSTD=ON \ -DARROW_JEMALLOC=OFF \ + -DARROW_USE_JEMALLOC=OFF \ -DARROW_SIMD_LEVEL=NONE \ -DARROW_RUNTIME_SIMD_LEVEL=NONE \ -DARROW_WITH_UTF8PROC=OFF \ diff --git a/dev/vcpkg/env.sh b/dev/vcpkg/env.sh index a86a953e2b55..e7b9ff51274c 100755 --- a/dev/vcpkg/env.sh +++ b/dev/vcpkg/env.sh @@ -27,6 +27,7 @@ SCRIPT_ROOT="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" export VCPKG_ROOT="$SCRIPT_ROOT/.vcpkg" export VCPKG="$SCRIPT_ROOT/.vcpkg/vcpkg" export VCPKG_TRIPLET=$([ "${CPU_TARGET:-}" = "aarch64" ] && echo "arm64-linux-neon" || echo "x64-linux-avx") +export VCPKG_TRIPLET=$([ "$(uname)" == "Darwin" ] && echo "arm64-osx-release" || echo ${VCPKG_TRIPLET}) export VCPKG_TRIPLET_INSTALL_DIR=${SCRIPT_ROOT}/vcpkg_installed/${VCPKG_TRIPLET} ${SCRIPT_ROOT}/init.sh "$@" diff --git a/dev/vcpkg/ports/grpc/00001-fix-uwp.patch b/dev/vcpkg/ports/grpc/00001-fix-uwp.patch new file mode 100644 index 000000000000..2aea0afd765e --- /dev/null +++ b/dev/vcpkg/ports/grpc/00001-fix-uwp.patch @@ -0,0 +1,73 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 25990a5d8a..4bec4e1e72 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -219,6 +219,9 @@ if(UNIX) + endif() + if(WIN32) + set(_gRPC_PLATFORM_WINDOWS ON) ++ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") ++ set(_gRPC_PLATFORM_UWP ON) ++ endif() + endif() + + # Use C11 standard +@@ -263,6 +266,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 +@@ -430,6 +436,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() +@@ -552,6 +562,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} + ) +@@ -567,6 +578,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 5d2bdc14de..e9870c2656 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 +@@ -39,6 +39,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"; + +@@ -71,6 +72,9 @@ bool check_windows_registry_product_name(HKEY root_key, + } + + return strstr(buffer, expected_substr) != nullptr; ++#else ++ return false; ++#endif + } + + } // namespace internal diff --git a/dev/vcpkg/ports/grpc/00002-static-linking-in-linux.patch b/dev/vcpkg/ports/grpc/00002-static-linking-in-linux.patch new file mode 100644 index 000000000000..8999a24aea09 --- /dev/null +++ b/dev/vcpkg/ports/grpc/00002-static-linking-in-linux.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8f78306f77..e09f8fcc1e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -211,6 +211,11 @@ if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + endif() + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") + ++if (gRPC_STATIC_LINKING AND NOT _gRPC_PLATFORM_WINDOWS) ++ # Force to static link ++ set(CMAKE_EXE_LINKER_FLAGS "-Bstatic") ++endif() ++ + if(MSVC) + include(cmake/msvc_static_runtime.cmake) + add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS) diff --git a/dev/vcpkg/ports/grpc/00003-undef-base64-macro.patch b/dev/vcpkg/ports/grpc/00003-undef-base64-macro.patch new file mode 100644 index 000000000000..be182659d410 --- /dev/null +++ b/dev/vcpkg/ports/grpc/00003-undef-base64-macro.patch @@ -0,0 +1,13 @@ +diff --git a/src/core/lib/transport/transport.cc b/src/core/lib/transport/transport.cc +index 5d74ec2..89494b5 100644 +--- a/src/core/lib/transport/transport.cc ++++ b/src/core/lib/transport/transport.cc +@@ -77,6 +77,8 @@ void grpc_stream_ref_init(grpc_stream_refcount* refcount, int /*initial_refs*/, + : nullptr); + } + ++#undef move64 ++ + static void move64bits(uint64_t* from, uint64_t* to) { + *to += *from; + *from = 0; diff --git a/dev/vcpkg/ports/grpc/00004-link-gdi32-on-windows.patch b/dev/vcpkg/ports/grpc/00004-link-gdi32-on-windows.patch new file mode 100644 index 000000000000..54b55c60b89d --- /dev/null +++ b/dev/vcpkg/ports/grpc/00004-link-gdi32-on-windows.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 25990a5d8a..8a632d2289 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -404,7 +404,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) + endif() + + # Create directory for proto source files diff --git a/dev/vcpkg/ports/grpc/00005-fix-uwp-error.patch b/dev/vcpkg/ports/grpc/00005-fix-uwp-error.patch new file mode 100644 index 000000000000..23f885d48e48 --- /dev/null +++ b/dev/vcpkg/ports/grpc/00005-fix-uwp-error.patch @@ -0,0 +1,47 @@ +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 +--- 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 { + + 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 +--- 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 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; +@@ -206,7 +207,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 141b16e345..89d9d6dafd 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) { + FailCall(cq_idx, rc, GRPC_ERROR_CREATE("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/dev/vcpkg/ports/grpc/00009-use-system-upb.patch b/dev/vcpkg/ports/grpc/00009-use-system-upb.patch new file mode 100644 index 000000000000..8bafe8452b2e --- /dev/null +++ b/dev/vcpkg/ports/grpc/00009-use-system-upb.patch @@ -0,0 +1,91 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 23098aa578..a8e8bc274b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -85,6 +85,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") + +@@ -1631,6 +1634,7 @@ target_link_libraries(gpr + absl::time + absl::optional + absl::variant ++ ${_gRPC_UPB_LIBRARIES} + ) + if(_gRPC_PLATFORM_ANDROID) + target_link_libraries(gpr +@@ -2435,7 +2439,6 @@ target_link_libraries(grpc + gpr + ${_gRPC_SSL_LIBRARIES} + address_sorting +- upb + ) + if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) + target_link_libraries(grpc "-framework CoreFoundation") +@@ -2979,7 +2982,6 @@ target_link_libraries(grpc_unsecure + absl::utility + gpr + address_sorting +- upb + ) + if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) + target_link_libraries(grpc_unsecure "-framework CoreFoundation") +@@ -4251,6 +4253,7 @@ endif() + + endif() + ++if (gRPC_UPB_PROVIDER STREQUAL "module") + add_library(upb + third_party/upb/third_party/utf8_range/naive.c + third_party/upb/third_party/utf8_range/range2-neon.c +@@ -4319,7 +4322,7 @@ if(gRPC_INSTALL) + ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} + ) + endif() +- ++endif() + + if(gRPC_BUILD_TESTS) + +diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in +index 3623f4aa5e..df6ced560e 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 f2a0e508c3..09751f5ef0 100644 +--- a/cmake/upb.cmake ++++ b/cmake/upb.cmake +@@ -12,9 +12,19 @@ + # 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::fastdecode upb::json upb::upb upb::utf8_range upb::textformat upb::reflection upb::descriptor_upb_proto) ++ set(_gRPC_UPB_INCLUDE_DIR) ++ set(_gRPC_FIND_UPB "if(NOT upb_FOUND)\n find_package(upb CONFIG REQUIRED)\nendif()") ++endif() diff --git a/dev/vcpkg/ports/grpc/00012-fix-use-cxx17.patch b/dev/vcpkg/ports/grpc/00012-fix-use-cxx17.patch new file mode 100644 index 000000000000..56bc4367608e --- /dev/null +++ b/dev/vcpkg/ports/grpc/00012-fix-use-cxx17.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 25990a5d8a..ba8df92858 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -326,6 +326,11 @@ include(cmake/xxhash.cmake) + include(cmake/zlib.cmake) + include(cmake/download_archive.cmake) + ++if (ABSL_USE_CXX17) ++ message(STATUS "Found absl uses CXX17, enable CXX17 feature.") ++ set(CMAKE_CXX_STANDARD 17) ++endif() ++ + # Setup external proto library at third_party/envoy-api with 2 download URLs + if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/envoy-api) + # Download the archive via HTTP, validate the checksum, and extract to third_party/envoy-api. diff --git a/dev/vcpkg/ports/grpc/00014-pkgconfig-upbdefs.patch b/dev/vcpkg/ports/grpc/00014-pkgconfig-upbdefs.patch new file mode 100644 index 000000000000..1c2bda5b1b94 --- /dev/null +++ b/dev/vcpkg/ports/grpc/00014-pkgconfig-upbdefs.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 48019cce95..1eda700ae8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -23186,7 +23186,7 @@ generate_pkgconfig( + "high performance general RPC framework" + "${gRPC_CORE_VERSION}" + "gpr openssl absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional 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" +- "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz" ++ "-lgrpc -laddress_sorting -lre2 -lupb_textformat -lupb_mini_table -lupb -lupb_collections -lupb_reflection -lupb_extension_registry -lupb_json -lupb_fastdecode -lupb_utf8_range -ldescriptor_upb_proto -lcares -lz" + "" + "grpc.pc") + diff --git a/dev/vcpkg/ports/grpc/00015-disable-download-archive.patch b/dev/vcpkg/ports/grpc/00015-disable-download-archive.patch new file mode 100644 index 000000000000..b28bc72a7c91 --- /dev/null +++ b/dev/vcpkg/ports/grpc/00015-disable-download-archive.patch @@ -0,0 +1,12 @@ +diff --git a/cmake/download_archive.cmake b/cmake/download_archive.cmake +index 820aafafb7..a59b785c7e 100644 +--- a/cmake/download_archive.cmake ++++ b/cmake/download_archive.cmake +@@ -19,6 +19,7 @@ file(MAKE_DIRECTORY ${_download_archive_TEMPORARY_DIR}) + # Note that strip_prefix strips the directory path prefix of the extracted + # archive content, and it may strip multiple directories. + function(download_archive destination url hash strip_prefix) ++ return() + # Fetch and validate + set(_TEMPORARY_FILE ${_download_archive_TEMPORARY_DIR}/${strip_prefix}.tar.gz) + message(STATUS "Downloading from ${url}, if failed, please try configuring again") diff --git a/dev/vcpkg/ports/grpc/00016_add_header.patch b/dev/vcpkg/ports/grpc/00016_add_header.patch new file mode 100644 index 000000000000..ba166a5ee36b --- /dev/null +++ b/dev/vcpkg/ports/grpc/00016_add_header.patch @@ -0,0 +1,12 @@ +diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc +index 72e1b66..8dc1fd1 100644 +--- a/src/core/lib/iomgr/tcp_posix.cc ++++ b/src/core/lib/iomgr/tcp_posix.cc +@@ -47,6 +47,7 @@ + #include + #include + #include ++#include + + #include "src/core/lib/address_utils/sockaddr_utils.h" + #include "src/core/lib/debug/event_log.h" diff --git a/dev/vcpkg/ports/grpc/gRPCTargets-vcpkg-tools.cmake b/dev/vcpkg/ports/grpc/gRPCTargets-vcpkg-tools.cmake new file mode 100644 index 000000000000..1ed3509c9408 --- /dev/null +++ b/dev/vcpkg/ports/grpc/gRPCTargets-vcpkg-tools.cmake @@ -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() diff --git a/dev/vcpkg/ports/grpc/macos.patch b/dev/vcpkg/ports/grpc/macos.patch new file mode 100644 index 000000000000..ab21439d1931 --- /dev/null +++ b/dev/vcpkg/ports/grpc/macos.patch @@ -0,0 +1,12 @@ +diff --git a/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc b/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +index 96de4bbf0ba85..a202e815abe0e 100644 +--- a/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc ++++ b/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +@@ -18,6 +18,7 @@ + #include + #ifdef AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER + ++#include "absl/strings/str_cat.h" + #include "absl/strings/str_format.h" + + #include "src/core/lib/address_utils/parse_address.h" diff --git a/dev/vcpkg/ports/grpc/portfile.cmake b/dev/vcpkg/ports/grpc/portfile.cmake new file mode 100644 index 000000000000..9653bb095610 --- /dev/null +++ b/dev/vcpkg/ports/grpc/portfile.cmake @@ -0,0 +1,99 @@ +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO grpc/grpc + REF v1.51.1 + SHA512 1bc8e7a5a15b2dca88527d111cde398b0dc1921bbc945c6df8225b4225b8ac0b43155bcf743230ce7b5962d1ab948e9363229c98a879b1befc7a939a290fb888 + HEAD_REF master + PATCHES + 00001-fix-uwp.patch + 00002-static-linking-in-linux.patch + 00003-undef-base64-macro.patch + 00004-link-gdi32-on-windows.patch + 00005-fix-uwp-error.patch + 00009-use-system-upb.patch + snprintf.patch + 00012-fix-use-cxx17.patch + 00014-pkgconfig-upbdefs.patch + 00015-disable-download-archive.patch + 00016_add_header.patch +) + +if(NOT TARGET_TRIPLET STREQUAL HOST_TRIPLET) + vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/grpc") +endif() + +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" gRPC_MSVC_STATIC_RUNTIME) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" gRPC_STATIC_LINKING) + +if(VCPKG_TARGET_IS_UWP) + set(cares_CARES_PROVIDER OFF) +else() + set(cares_CARES_PROVIDER "package") +endif() + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + codegen gRPC_BUILD_CODEGEN +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS ${FEATURE_OPTIONS} + -DgRPC_INSTALL=ON + -DgRPC_BUILD_TESTS=OFF + -DgRPC_STATIC_LINKING=${gRPC_STATIC_LINKING} + -DgRPC_MSVC_STATIC_RUNTIME=${gRPC_MSVC_STATIC_RUNTIME} + -DgRPC_ZLIB_PROVIDER=package + -DgRPC_SSL_PROVIDER=package + -DgRPC_PROTOBUF_PROVIDER=package + -DgRPC_ABSL_PROVIDER=package + -DgRPC_UPB_PROVIDER=package + -DgRPC_RE2_PROVIDER=package + -DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG + -DgRPC_CARES_PROVIDER=${cares_CARES_PROVIDER} + -DgRPC_BENCHMARK_PROVIDER=none + -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}" + MAYBE_UNUSED_VARIABLES + gRPC_MSVC_STATIC_RUNTIME +) + +vcpkg_cmake_install(ADD_BIN_TO_PATH) + +vcpkg_cmake_config_fixup() + +if (gRPC_BUILD_CODEGEN) + vcpkg_copy_tools( + AUTO_CLEAN + TOOL_NAMES + grpc_php_plugin + grpc_python_plugin + grpc_node_plugin + grpc_objective_c_plugin + grpc_csharp_plugin + grpc_cpp_plugin + grpc_ruby_plugin + ) +else() + configure_file("${CMAKE_CURRENT_LIST_DIR}/gRPCTargets-vcpkg-tools.cmake" "${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-vcpkg-tools.cmake" @ONLY) +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_copy_pdbs() +if (VCPKG_TARGET_IS_WINDOWS) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig") +else() + vcpkg_fixup_pkgconfig() +endif() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/dev/vcpkg/ports/grpc/snprintf.patch b/dev/vcpkg/ports/grpc/snprintf.patch new file mode 100644 index 000000000000..b5012ad2dba8 --- /dev/null +++ b/dev/vcpkg/ports/grpc/snprintf.patch @@ -0,0 +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/dev/vcpkg/ports/grpc/vcpkg-cmake-wrapper.cmake b/dev/vcpkg/ports/grpc/vcpkg-cmake-wrapper.cmake new file mode 100644 index 000000000000..9adf0288084d --- /dev/null +++ b/dev/vcpkg/ports/grpc/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,2 @@ +list(REMOVE_AT ARGS 0) +_find_package(gRPC ${ARGS}) # Shouldn't this be fixed downstream instead of using a Wrapper? \ No newline at end of file diff --git a/dev/vcpkg/ports/grpc/vcpkg.json b/dev/vcpkg/ports/grpc/vcpkg.json new file mode 100644 index 000000000000..8647b3fb298e --- /dev/null +++ b/dev/vcpkg/ports/grpc/vcpkg.json @@ -0,0 +1,48 @@ +{ + "name": "grpc", + "version-semver": "1.51.1", + "port-version": 3, + "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", + "dependencies": [ + "abseil", + { + "name": "c-ares", + "platform": "!uwp" + }, + { + "name": "grpc", + "host": true, + "features": [ + "codegen" + ] + }, + "openssl", + "protobuf", + { + "name": "protobuf", + "host": true + }, + "re2", + "upb", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zlib" + ], + "features": { + "absl-sync": { + "description": "Deprecated." + }, + "codegen": { + "description": "Build code generator machinery", + "supports": "!uwp" + } + } +} diff --git a/dev/vcpkg/toolchain.cmake b/dev/vcpkg/toolchain.cmake index f4db8e7af53a..dfd7d3937361 100644 --- a/dev/vcpkg/toolchain.cmake +++ b/dev/vcpkg/toolchain.cmake @@ -38,8 +38,10 @@ set(CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH}) include($ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake) -set(CMAKE_EXE_LINKER_FLAGS "-static-libstdc++ -static-libgcc") -set(CMAKE_SHARED_LINKER_FLAGS "-static-libstdc++ -static-libgcc") +if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(CMAKE_EXE_LINKER_FLAGS "-static-libstdc++ -static-libgcc") + set(CMAKE_SHARED_LINKER_FLAGS "-static-libstdc++ -static-libgcc") +endif() # Disable boost new version warning for FindBoost module set(Boost_NO_WARN_NEW_VERSIONS ON) diff --git a/dev/vcpkg/triplets/arm64-osx-release.cmake b/dev/vcpkg/triplets/arm64-osx-release.cmake new file mode 100644 index 000000000000..53d73559c489 --- /dev/null +++ b/dev/vcpkg/triplets/arm64-osx-release.cmake @@ -0,0 +1,16 @@ +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_CMAKE_SYSTEM_NAME Darwin) +set(VCPKG_OSX_ARCHITECTURES arm64) + +set(VCPKG_BUILD_TYPE release) + + +set(VCPKG_C_FLAGS "") +set(VCPKG_CXX_FLAGS "-std=c++20") + +if("${PORT}" STREQUAL "grpc") + set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -Wno-missing-template-arg-list-after-template-kw") +endif() diff --git a/dev/vcpkg/vcpkg.json b/dev/vcpkg/vcpkg.json index aba59968f25a..00bb48c4b094 100644 --- a/dev/vcpkg/vcpkg.json +++ b/dev/vcpkg/vcpkg.json @@ -76,7 +76,7 @@ "features": [ "storage" ], - "version>=": "2.22.0" + "version>=": "2.37.0" } ] }, @@ -105,11 +105,11 @@ } }, "overrides": [ - { "name": "fmt", "version": "10.1.1" }, + { "name": "fmt", "version": "11.2.0" }, { "name": "liblzma", "version": "5.6.2" }, { "name": "xsimd", "version": "10.0.0" }, { "name": "protobuf", "version": "3.21.8"}, - { "name": "abseil", "version": "20230802.1"}, + { "name": "abseil", "version": "20240722.0"}, { "name": "re2", "version": "2023-07-01"}, { "name": "glog", "version": "0.6.0"}, { "name": "gflags", "version": "2.2.2"}, diff --git a/ep/build-velox/src/build-velox.sh b/ep/build-velox/src/build-velox.sh index 7a7b1f05649d..40263a28a365 100755 --- a/ep/build-velox/src/build-velox.sh +++ b/ep/build-velox/src/build-velox.sh @@ -102,7 +102,7 @@ function compile { # maintain compatibility, but it prints a diagnostic note about the unknown flag if a true warning # or error occurs. CXX_FLAGS='-Wno-error=stringop-overflow -Wno-error=cpp -Wno-missing-field-initializers \ - -Wno-error=uninitialized -Wno-unknown-warning-option -Wno-deprecated-declarations' + -Wno-error=uninitialized -Wno-unknown-warning-option -Wno-macro-redefined -Wno-deprecated-declarations -Wno-inconsistent-missing-override' COMPILE_OPTION="-DCMAKE_CXX_FLAGS=\"$CXX_FLAGS\" -DVELOX_ENABLE_PARQUET=ON -DVELOX_BUILD_TESTING=OFF \ -DVELOX_MONO_LIBRARY=ON -DVELOX_BUILD_RUNNER=OFF -DVELOX_SIMDJSON_SKIPUTF8VALIDATION=ON \ From 49647aea3a372b6260986adad1ef6e1fbc0fab0b Mon Sep 17 00:00:00 2001 From: Yuan Date: Wed, 4 Feb 2026 16:10:44 +0000 Subject: [PATCH 02/12] enable test Signed-off-by: Yuan --- .github/workflows/velox_weekly.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/velox_weekly.yml b/.github/workflows/velox_weekly.yml index 3ae0139671d5..97d7263a3e06 100644 --- a/.github/workflows/velox_weekly.yml +++ b/.github/workflows/velox_weekly.yml @@ -220,6 +220,6 @@ jobs: distribution: temurin java-version: 17 - name: Install Dependencies - run: brew install wget pkgconfig abseil ccache + run: brew install wget pkgconfig ccache cmake autoconf automake libtool - name: Build - run: ./dev/buildbundle-veloxbe.sh --run_setup_script=ON --build_arrow=ON --build_tests=ON --build_benchmarks=ON --spark_version=3.5 + run: ./dev/buildbundle-veloxbe.sh --enable_vcpkg=ON --run_setup_script=OFF --build_arrow=ON --build_tests=ON --build_benchmarks=ON --spark_version=3.5 From 77db100c0565685d16a9be204e49159d88734ca1 Mon Sep 17 00:00:00 2001 From: Yuan Date: Wed, 4 Feb 2026 16:21:11 +0000 Subject: [PATCH 03/12] fix Signed-off-by: Yuan --- .github/workflows/velox_weekly.yml | 2 +- dev/vcpkg/triplets/arm64-osx-release.cmake | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/velox_weekly.yml b/.github/workflows/velox_weekly.yml index 97d7263a3e06..c363b43b7798 100644 --- a/.github/workflows/velox_weekly.yml +++ b/.github/workflows/velox_weekly.yml @@ -220,6 +220,6 @@ jobs: distribution: temurin java-version: 17 - name: Install Dependencies - run: brew install wget pkgconfig ccache cmake autoconf automake libtool + run: brew install wget pkgconfig ccache cmake autoconf automake libtool autoconf-archive bison flex - name: Build run: ./dev/buildbundle-veloxbe.sh --enable_vcpkg=ON --run_setup_script=OFF --build_arrow=ON --build_tests=ON --build_benchmarks=ON --spark_version=3.5 diff --git a/dev/vcpkg/triplets/arm64-osx-release.cmake b/dev/vcpkg/triplets/arm64-osx-release.cmake index 53d73559c489..ff42b314ec69 100644 --- a/dev/vcpkg/triplets/arm64-osx-release.cmake +++ b/dev/vcpkg/triplets/arm64-osx-release.cmake @@ -9,8 +9,8 @@ set(VCPKG_BUILD_TYPE release) set(VCPKG_C_FLAGS "") -set(VCPKG_CXX_FLAGS "-std=c++20") +set(VCPKG_CXX_FLAGS "-std=c++20 -Wno-missing-template-arg-list-after-template-kw") -if("${PORT}" STREQUAL "grpc") - set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -Wno-missing-template-arg-list-after-template-kw") -endif() +#if("${PORT}" STREQUAL "grpc") +# set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -Wno-missing-template-arg-list-after-template-kw") +#endif() From defcb0e5bc844ecbdf65220e5117809e67852fd2 Mon Sep 17 00:00:00 2001 From: Yuan Date: Thu, 5 Feb 2026 08:27:46 +0000 Subject: [PATCH 04/12] remove grpc port Signed-off-by: Yuan --- dev/vcpkg/ports/grpc/00001-fix-uwp.patch | 73 -------------- .../grpc/00002-static-linking-in-linux.patch | 16 --- .../ports/grpc/00003-undef-base64-macro.patch | 13 --- .../grpc/00004-link-gdi32-on-windows.patch | 13 --- .../ports/grpc/00005-fix-uwp-error.patch | 47 --------- .../ports/grpc/00009-use-system-upb.patch | 91 ----------------- .../ports/grpc/00012-fix-use-cxx17.patch | 16 --- .../ports/grpc/00014-pkgconfig-upbdefs.patch | 13 --- .../grpc/00015-disable-download-archive.patch | 12 --- dev/vcpkg/ports/grpc/00016_add_header.patch | 12 --- .../ports/grpc/gRPCTargets-vcpkg-tools.cmake | 10 -- dev/vcpkg/ports/grpc/macos.patch | 12 --- dev/vcpkg/ports/grpc/portfile.cmake | 99 ------------------- dev/vcpkg/ports/grpc/snprintf.patch | 12 --- .../ports/grpc/vcpkg-cmake-wrapper.cmake | 2 - dev/vcpkg/ports/grpc/vcpkg.json | 48 --------- 16 files changed, 489 deletions(-) delete mode 100644 dev/vcpkg/ports/grpc/00001-fix-uwp.patch delete mode 100644 dev/vcpkg/ports/grpc/00002-static-linking-in-linux.patch delete mode 100644 dev/vcpkg/ports/grpc/00003-undef-base64-macro.patch delete mode 100644 dev/vcpkg/ports/grpc/00004-link-gdi32-on-windows.patch delete mode 100644 dev/vcpkg/ports/grpc/00005-fix-uwp-error.patch delete mode 100644 dev/vcpkg/ports/grpc/00009-use-system-upb.patch delete mode 100644 dev/vcpkg/ports/grpc/00012-fix-use-cxx17.patch delete mode 100644 dev/vcpkg/ports/grpc/00014-pkgconfig-upbdefs.patch delete mode 100644 dev/vcpkg/ports/grpc/00015-disable-download-archive.patch delete mode 100644 dev/vcpkg/ports/grpc/00016_add_header.patch delete mode 100644 dev/vcpkg/ports/grpc/gRPCTargets-vcpkg-tools.cmake delete mode 100644 dev/vcpkg/ports/grpc/macos.patch delete mode 100644 dev/vcpkg/ports/grpc/portfile.cmake delete mode 100644 dev/vcpkg/ports/grpc/snprintf.patch delete mode 100644 dev/vcpkg/ports/grpc/vcpkg-cmake-wrapper.cmake delete mode 100644 dev/vcpkg/ports/grpc/vcpkg.json diff --git a/dev/vcpkg/ports/grpc/00001-fix-uwp.patch b/dev/vcpkg/ports/grpc/00001-fix-uwp.patch deleted file mode 100644 index 2aea0afd765e..000000000000 --- a/dev/vcpkg/ports/grpc/00001-fix-uwp.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 25990a5d8a..4bec4e1e72 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -219,6 +219,9 @@ if(UNIX) - endif() - if(WIN32) - set(_gRPC_PLATFORM_WINDOWS ON) -+ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") -+ set(_gRPC_PLATFORM_UWP ON) -+ endif() - endif() - - # Use C11 standard -@@ -263,6 +266,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 -@@ -430,6 +436,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() -@@ -552,6 +562,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} - ) -@@ -567,6 +578,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 5d2bdc14de..e9870c2656 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 -@@ -39,6 +39,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"; - -@@ -71,6 +72,9 @@ bool check_windows_registry_product_name(HKEY root_key, - } - - return strstr(buffer, expected_substr) != nullptr; -+#else -+ return false; -+#endif - } - - } // namespace internal diff --git a/dev/vcpkg/ports/grpc/00002-static-linking-in-linux.patch b/dev/vcpkg/ports/grpc/00002-static-linking-in-linux.patch deleted file mode 100644 index 8999a24aea09..000000000000 --- a/dev/vcpkg/ports/grpc/00002-static-linking-in-linux.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8f78306f77..e09f8fcc1e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -211,6 +211,11 @@ if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) - endif() - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") - -+if (gRPC_STATIC_LINKING AND NOT _gRPC_PLATFORM_WINDOWS) -+ # Force to static link -+ set(CMAKE_EXE_LINKER_FLAGS "-Bstatic") -+endif() -+ - if(MSVC) - include(cmake/msvc_static_runtime.cmake) - add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS) diff --git a/dev/vcpkg/ports/grpc/00003-undef-base64-macro.patch b/dev/vcpkg/ports/grpc/00003-undef-base64-macro.patch deleted file mode 100644 index be182659d410..000000000000 --- a/dev/vcpkg/ports/grpc/00003-undef-base64-macro.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/core/lib/transport/transport.cc b/src/core/lib/transport/transport.cc -index 5d74ec2..89494b5 100644 ---- a/src/core/lib/transport/transport.cc -+++ b/src/core/lib/transport/transport.cc -@@ -77,6 +77,8 @@ void grpc_stream_ref_init(grpc_stream_refcount* refcount, int /*initial_refs*/, - : nullptr); - } - -+#undef move64 -+ - static void move64bits(uint64_t* from, uint64_t* to) { - *to += *from; - *from = 0; diff --git a/dev/vcpkg/ports/grpc/00004-link-gdi32-on-windows.patch b/dev/vcpkg/ports/grpc/00004-link-gdi32-on-windows.patch deleted file mode 100644 index 54b55c60b89d..000000000000 --- a/dev/vcpkg/ports/grpc/00004-link-gdi32-on-windows.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 25990a5d8a..8a632d2289 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -404,7 +404,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) - endif() - - # Create directory for proto source files diff --git a/dev/vcpkg/ports/grpc/00005-fix-uwp-error.patch b/dev/vcpkg/ports/grpc/00005-fix-uwp-error.patch deleted file mode 100644 index 23f885d48e48..000000000000 --- a/dev/vcpkg/ports/grpc/00005-fix-uwp-error.patch +++ /dev/null @@ -1,47 +0,0 @@ -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 ---- 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 { - - 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 ---- 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 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; -@@ -206,7 +207,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 141b16e345..89d9d6dafd 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) { - FailCall(cq_idx, rc, GRPC_ERROR_CREATE("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/dev/vcpkg/ports/grpc/00009-use-system-upb.patch b/dev/vcpkg/ports/grpc/00009-use-system-upb.patch deleted file mode 100644 index 8bafe8452b2e..000000000000 --- a/dev/vcpkg/ports/grpc/00009-use-system-upb.patch +++ /dev/null @@ -1,91 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 23098aa578..a8e8bc274b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -85,6 +85,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") - -@@ -1631,6 +1634,7 @@ target_link_libraries(gpr - absl::time - absl::optional - absl::variant -+ ${_gRPC_UPB_LIBRARIES} - ) - if(_gRPC_PLATFORM_ANDROID) - target_link_libraries(gpr -@@ -2435,7 +2439,6 @@ target_link_libraries(grpc - gpr - ${_gRPC_SSL_LIBRARIES} - address_sorting -- upb - ) - if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) - target_link_libraries(grpc "-framework CoreFoundation") -@@ -2979,7 +2982,6 @@ target_link_libraries(grpc_unsecure - absl::utility - gpr - address_sorting -- upb - ) - if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) - target_link_libraries(grpc_unsecure "-framework CoreFoundation") -@@ -4251,6 +4253,7 @@ endif() - - endif() - -+if (gRPC_UPB_PROVIDER STREQUAL "module") - add_library(upb - third_party/upb/third_party/utf8_range/naive.c - third_party/upb/third_party/utf8_range/range2-neon.c -@@ -4319,7 +4322,7 @@ if(gRPC_INSTALL) - ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} - ) - endif() -- -+endif() - - if(gRPC_BUILD_TESTS) - -diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in -index 3623f4aa5e..df6ced560e 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 f2a0e508c3..09751f5ef0 100644 ---- a/cmake/upb.cmake -+++ b/cmake/upb.cmake -@@ -12,9 +12,19 @@ - # 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::fastdecode upb::json upb::upb upb::utf8_range upb::textformat upb::reflection upb::descriptor_upb_proto) -+ set(_gRPC_UPB_INCLUDE_DIR) -+ set(_gRPC_FIND_UPB "if(NOT upb_FOUND)\n find_package(upb CONFIG REQUIRED)\nendif()") -+endif() diff --git a/dev/vcpkg/ports/grpc/00012-fix-use-cxx17.patch b/dev/vcpkg/ports/grpc/00012-fix-use-cxx17.patch deleted file mode 100644 index 56bc4367608e..000000000000 --- a/dev/vcpkg/ports/grpc/00012-fix-use-cxx17.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 25990a5d8a..ba8df92858 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -326,6 +326,11 @@ include(cmake/xxhash.cmake) - include(cmake/zlib.cmake) - include(cmake/download_archive.cmake) - -+if (ABSL_USE_CXX17) -+ message(STATUS "Found absl uses CXX17, enable CXX17 feature.") -+ set(CMAKE_CXX_STANDARD 17) -+endif() -+ - # Setup external proto library at third_party/envoy-api with 2 download URLs - if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/envoy-api) - # Download the archive via HTTP, validate the checksum, and extract to third_party/envoy-api. diff --git a/dev/vcpkg/ports/grpc/00014-pkgconfig-upbdefs.patch b/dev/vcpkg/ports/grpc/00014-pkgconfig-upbdefs.patch deleted file mode 100644 index 1c2bda5b1b94..000000000000 --- a/dev/vcpkg/ports/grpc/00014-pkgconfig-upbdefs.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 48019cce95..1eda700ae8 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -23186,7 +23186,7 @@ generate_pkgconfig( - "high performance general RPC framework" - "${gRPC_CORE_VERSION}" - "gpr openssl absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional 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" -- "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz" -+ "-lgrpc -laddress_sorting -lre2 -lupb_textformat -lupb_mini_table -lupb -lupb_collections -lupb_reflection -lupb_extension_registry -lupb_json -lupb_fastdecode -lupb_utf8_range -ldescriptor_upb_proto -lcares -lz" - "" - "grpc.pc") - diff --git a/dev/vcpkg/ports/grpc/00015-disable-download-archive.patch b/dev/vcpkg/ports/grpc/00015-disable-download-archive.patch deleted file mode 100644 index b28bc72a7c91..000000000000 --- a/dev/vcpkg/ports/grpc/00015-disable-download-archive.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/cmake/download_archive.cmake b/cmake/download_archive.cmake -index 820aafafb7..a59b785c7e 100644 ---- a/cmake/download_archive.cmake -+++ b/cmake/download_archive.cmake -@@ -19,6 +19,7 @@ file(MAKE_DIRECTORY ${_download_archive_TEMPORARY_DIR}) - # Note that strip_prefix strips the directory path prefix of the extracted - # archive content, and it may strip multiple directories. - function(download_archive destination url hash strip_prefix) -+ return() - # Fetch and validate - set(_TEMPORARY_FILE ${_download_archive_TEMPORARY_DIR}/${strip_prefix}.tar.gz) - message(STATUS "Downloading from ${url}, if failed, please try configuring again") diff --git a/dev/vcpkg/ports/grpc/00016_add_header.patch b/dev/vcpkg/ports/grpc/00016_add_header.patch deleted file mode 100644 index ba166a5ee36b..000000000000 --- a/dev/vcpkg/ports/grpc/00016_add_header.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc -index 72e1b66..8dc1fd1 100644 ---- a/src/core/lib/iomgr/tcp_posix.cc -+++ b/src/core/lib/iomgr/tcp_posix.cc -@@ -47,6 +47,7 @@ - #include - #include - #include -+#include - - #include "src/core/lib/address_utils/sockaddr_utils.h" - #include "src/core/lib/debug/event_log.h" diff --git a/dev/vcpkg/ports/grpc/gRPCTargets-vcpkg-tools.cmake b/dev/vcpkg/ports/grpc/gRPCTargets-vcpkg-tools.cmake deleted file mode 100644 index 1ed3509c9408..000000000000 --- a/dev/vcpkg/ports/grpc/gRPCTargets-vcpkg-tools.cmake +++ /dev/null @@ -1,10 +0,0 @@ -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() diff --git a/dev/vcpkg/ports/grpc/macos.patch b/dev/vcpkg/ports/grpc/macos.patch deleted file mode 100644 index ab21439d1931..000000000000 --- a/dev/vcpkg/ports/grpc/macos.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc b/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc -index 96de4bbf0ba85..a202e815abe0e 100644 ---- a/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc -+++ b/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc -@@ -18,6 +18,7 @@ - #include - #ifdef AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER - -+#include "absl/strings/str_cat.h" - #include "absl/strings/str_format.h" - - #include "src/core/lib/address_utils/parse_address.h" diff --git a/dev/vcpkg/ports/grpc/portfile.cmake b/dev/vcpkg/ports/grpc/portfile.cmake deleted file mode 100644 index 9653bb095610..000000000000 --- a/dev/vcpkg/ports/grpc/portfile.cmake +++ /dev/null @@ -1,99 +0,0 @@ -if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -endif() - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO grpc/grpc - REF v1.51.1 - SHA512 1bc8e7a5a15b2dca88527d111cde398b0dc1921bbc945c6df8225b4225b8ac0b43155bcf743230ce7b5962d1ab948e9363229c98a879b1befc7a939a290fb888 - HEAD_REF master - PATCHES - 00001-fix-uwp.patch - 00002-static-linking-in-linux.patch - 00003-undef-base64-macro.patch - 00004-link-gdi32-on-windows.patch - 00005-fix-uwp-error.patch - 00009-use-system-upb.patch - snprintf.patch - 00012-fix-use-cxx17.patch - 00014-pkgconfig-upbdefs.patch - 00015-disable-download-archive.patch - 00016_add_header.patch -) - -if(NOT TARGET_TRIPLET STREQUAL HOST_TRIPLET) - vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/grpc") -endif() - -string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" gRPC_MSVC_STATIC_RUNTIME) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" gRPC_STATIC_LINKING) - -if(VCPKG_TARGET_IS_UWP) - set(cares_CARES_PROVIDER OFF) -else() - set(cares_CARES_PROVIDER "package") -endif() - -vcpkg_check_features( - OUT_FEATURE_OPTIONS FEATURE_OPTIONS - FEATURES - codegen gRPC_BUILD_CODEGEN -) - -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}" - OPTIONS ${FEATURE_OPTIONS} - -DgRPC_INSTALL=ON - -DgRPC_BUILD_TESTS=OFF - -DgRPC_STATIC_LINKING=${gRPC_STATIC_LINKING} - -DgRPC_MSVC_STATIC_RUNTIME=${gRPC_MSVC_STATIC_RUNTIME} - -DgRPC_ZLIB_PROVIDER=package - -DgRPC_SSL_PROVIDER=package - -DgRPC_PROTOBUF_PROVIDER=package - -DgRPC_ABSL_PROVIDER=package - -DgRPC_UPB_PROVIDER=package - -DgRPC_RE2_PROVIDER=package - -DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG - -DgRPC_CARES_PROVIDER=${cares_CARES_PROVIDER} - -DgRPC_BENCHMARK_PROVIDER=none - -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}" - MAYBE_UNUSED_VARIABLES - gRPC_MSVC_STATIC_RUNTIME -) - -vcpkg_cmake_install(ADD_BIN_TO_PATH) - -vcpkg_cmake_config_fixup() - -if (gRPC_BUILD_CODEGEN) - vcpkg_copy_tools( - AUTO_CLEAN - TOOL_NAMES - grpc_php_plugin - grpc_python_plugin - grpc_node_plugin - grpc_objective_c_plugin - grpc_csharp_plugin - grpc_cpp_plugin - grpc_ruby_plugin - ) -else() - configure_file("${CMAKE_CURRENT_LIST_DIR}/gRPCTargets-vcpkg-tools.cmake" "${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-vcpkg-tools.cmake" @ONLY) -endif() - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/include") - -vcpkg_copy_pdbs() -if (VCPKG_TARGET_IS_WINDOWS) - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig") -else() - vcpkg_fixup_pkgconfig() -endif() - -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/dev/vcpkg/ports/grpc/snprintf.patch b/dev/vcpkg/ports/grpc/snprintf.patch deleted file mode 100644 index b5012ad2dba8..000000000000 --- a/dev/vcpkg/ports/grpc/snprintf.patch +++ /dev/null @@ -1,12 +0,0 @@ -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/dev/vcpkg/ports/grpc/vcpkg-cmake-wrapper.cmake b/dev/vcpkg/ports/grpc/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 9adf0288084d..000000000000 --- a/dev/vcpkg/ports/grpc/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,2 +0,0 @@ -list(REMOVE_AT ARGS 0) -_find_package(gRPC ${ARGS}) # Shouldn't this be fixed downstream instead of using a Wrapper? \ No newline at end of file diff --git a/dev/vcpkg/ports/grpc/vcpkg.json b/dev/vcpkg/ports/grpc/vcpkg.json deleted file mode 100644 index 8647b3fb298e..000000000000 --- a/dev/vcpkg/ports/grpc/vcpkg.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "grpc", - "version-semver": "1.51.1", - "port-version": 3, - "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", - "dependencies": [ - "abseil", - { - "name": "c-ares", - "platform": "!uwp" - }, - { - "name": "grpc", - "host": true, - "features": [ - "codegen" - ] - }, - "openssl", - "protobuf", - { - "name": "protobuf", - "host": true - }, - "re2", - "upb", - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - }, - "zlib" - ], - "features": { - "absl-sync": { - "description": "Deprecated." - }, - "codegen": { - "description": "Build code generator machinery", - "supports": "!uwp" - } - } -} From 2078a2a792f7185e2918182052bc494e8b0125ce Mon Sep 17 00:00:00 2001 From: Yuan Date: Thu, 5 Feb 2026 09:04:39 +0000 Subject: [PATCH 05/12] Revert "remove grpc port" This reverts commit 8aec2162f7bc5f242815e52c03851864f8d60c2b. --- dev/vcpkg/ports/grpc/00001-fix-uwp.patch | 73 ++++++++++++++ .../grpc/00002-static-linking-in-linux.patch | 16 +++ .../ports/grpc/00003-undef-base64-macro.patch | 13 +++ .../grpc/00004-link-gdi32-on-windows.patch | 13 +++ .../ports/grpc/00005-fix-uwp-error.patch | 47 +++++++++ .../ports/grpc/00009-use-system-upb.patch | 91 +++++++++++++++++ .../ports/grpc/00012-fix-use-cxx17.patch | 16 +++ .../ports/grpc/00014-pkgconfig-upbdefs.patch | 13 +++ .../grpc/00015-disable-download-archive.patch | 12 +++ dev/vcpkg/ports/grpc/00016_add_header.patch | 12 +++ .../ports/grpc/gRPCTargets-vcpkg-tools.cmake | 10 ++ dev/vcpkg/ports/grpc/macos.patch | 12 +++ dev/vcpkg/ports/grpc/portfile.cmake | 99 +++++++++++++++++++ dev/vcpkg/ports/grpc/snprintf.patch | 12 +++ .../ports/grpc/vcpkg-cmake-wrapper.cmake | 2 + dev/vcpkg/ports/grpc/vcpkg.json | 48 +++++++++ 16 files changed, 489 insertions(+) create mode 100644 dev/vcpkg/ports/grpc/00001-fix-uwp.patch create mode 100644 dev/vcpkg/ports/grpc/00002-static-linking-in-linux.patch create mode 100644 dev/vcpkg/ports/grpc/00003-undef-base64-macro.patch create mode 100644 dev/vcpkg/ports/grpc/00004-link-gdi32-on-windows.patch create mode 100644 dev/vcpkg/ports/grpc/00005-fix-uwp-error.patch create mode 100644 dev/vcpkg/ports/grpc/00009-use-system-upb.patch create mode 100644 dev/vcpkg/ports/grpc/00012-fix-use-cxx17.patch create mode 100644 dev/vcpkg/ports/grpc/00014-pkgconfig-upbdefs.patch create mode 100644 dev/vcpkg/ports/grpc/00015-disable-download-archive.patch create mode 100644 dev/vcpkg/ports/grpc/00016_add_header.patch create mode 100644 dev/vcpkg/ports/grpc/gRPCTargets-vcpkg-tools.cmake create mode 100644 dev/vcpkg/ports/grpc/macos.patch create mode 100644 dev/vcpkg/ports/grpc/portfile.cmake create mode 100644 dev/vcpkg/ports/grpc/snprintf.patch create mode 100644 dev/vcpkg/ports/grpc/vcpkg-cmake-wrapper.cmake create mode 100644 dev/vcpkg/ports/grpc/vcpkg.json diff --git a/dev/vcpkg/ports/grpc/00001-fix-uwp.patch b/dev/vcpkg/ports/grpc/00001-fix-uwp.patch new file mode 100644 index 000000000000..2aea0afd765e --- /dev/null +++ b/dev/vcpkg/ports/grpc/00001-fix-uwp.patch @@ -0,0 +1,73 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 25990a5d8a..4bec4e1e72 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -219,6 +219,9 @@ if(UNIX) + endif() + if(WIN32) + set(_gRPC_PLATFORM_WINDOWS ON) ++ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") ++ set(_gRPC_PLATFORM_UWP ON) ++ endif() + endif() + + # Use C11 standard +@@ -263,6 +266,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 +@@ -430,6 +436,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() +@@ -552,6 +562,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} + ) +@@ -567,6 +578,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 5d2bdc14de..e9870c2656 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 +@@ -39,6 +39,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"; + +@@ -71,6 +72,9 @@ bool check_windows_registry_product_name(HKEY root_key, + } + + return strstr(buffer, expected_substr) != nullptr; ++#else ++ return false; ++#endif + } + + } // namespace internal diff --git a/dev/vcpkg/ports/grpc/00002-static-linking-in-linux.patch b/dev/vcpkg/ports/grpc/00002-static-linking-in-linux.patch new file mode 100644 index 000000000000..8999a24aea09 --- /dev/null +++ b/dev/vcpkg/ports/grpc/00002-static-linking-in-linux.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8f78306f77..e09f8fcc1e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -211,6 +211,11 @@ if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + endif() + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") + ++if (gRPC_STATIC_LINKING AND NOT _gRPC_PLATFORM_WINDOWS) ++ # Force to static link ++ set(CMAKE_EXE_LINKER_FLAGS "-Bstatic") ++endif() ++ + if(MSVC) + include(cmake/msvc_static_runtime.cmake) + add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS) diff --git a/dev/vcpkg/ports/grpc/00003-undef-base64-macro.patch b/dev/vcpkg/ports/grpc/00003-undef-base64-macro.patch new file mode 100644 index 000000000000..be182659d410 --- /dev/null +++ b/dev/vcpkg/ports/grpc/00003-undef-base64-macro.patch @@ -0,0 +1,13 @@ +diff --git a/src/core/lib/transport/transport.cc b/src/core/lib/transport/transport.cc +index 5d74ec2..89494b5 100644 +--- a/src/core/lib/transport/transport.cc ++++ b/src/core/lib/transport/transport.cc +@@ -77,6 +77,8 @@ void grpc_stream_ref_init(grpc_stream_refcount* refcount, int /*initial_refs*/, + : nullptr); + } + ++#undef move64 ++ + static void move64bits(uint64_t* from, uint64_t* to) { + *to += *from; + *from = 0; diff --git a/dev/vcpkg/ports/grpc/00004-link-gdi32-on-windows.patch b/dev/vcpkg/ports/grpc/00004-link-gdi32-on-windows.patch new file mode 100644 index 000000000000..54b55c60b89d --- /dev/null +++ b/dev/vcpkg/ports/grpc/00004-link-gdi32-on-windows.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 25990a5d8a..8a632d2289 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -404,7 +404,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) + endif() + + # Create directory for proto source files diff --git a/dev/vcpkg/ports/grpc/00005-fix-uwp-error.patch b/dev/vcpkg/ports/grpc/00005-fix-uwp-error.patch new file mode 100644 index 000000000000..23f885d48e48 --- /dev/null +++ b/dev/vcpkg/ports/grpc/00005-fix-uwp-error.patch @@ -0,0 +1,47 @@ +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 +--- 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 { + + 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 +--- 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 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; +@@ -206,7 +207,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 141b16e345..89d9d6dafd 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) { + FailCall(cq_idx, rc, GRPC_ERROR_CREATE("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/dev/vcpkg/ports/grpc/00009-use-system-upb.patch b/dev/vcpkg/ports/grpc/00009-use-system-upb.patch new file mode 100644 index 000000000000..8bafe8452b2e --- /dev/null +++ b/dev/vcpkg/ports/grpc/00009-use-system-upb.patch @@ -0,0 +1,91 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 23098aa578..a8e8bc274b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -85,6 +85,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") + +@@ -1631,6 +1634,7 @@ target_link_libraries(gpr + absl::time + absl::optional + absl::variant ++ ${_gRPC_UPB_LIBRARIES} + ) + if(_gRPC_PLATFORM_ANDROID) + target_link_libraries(gpr +@@ -2435,7 +2439,6 @@ target_link_libraries(grpc + gpr + ${_gRPC_SSL_LIBRARIES} + address_sorting +- upb + ) + if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) + target_link_libraries(grpc "-framework CoreFoundation") +@@ -2979,7 +2982,6 @@ target_link_libraries(grpc_unsecure + absl::utility + gpr + address_sorting +- upb + ) + if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) + target_link_libraries(grpc_unsecure "-framework CoreFoundation") +@@ -4251,6 +4253,7 @@ endif() + + endif() + ++if (gRPC_UPB_PROVIDER STREQUAL "module") + add_library(upb + third_party/upb/third_party/utf8_range/naive.c + third_party/upb/third_party/utf8_range/range2-neon.c +@@ -4319,7 +4322,7 @@ if(gRPC_INSTALL) + ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} + ) + endif() +- ++endif() + + if(gRPC_BUILD_TESTS) + +diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in +index 3623f4aa5e..df6ced560e 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 f2a0e508c3..09751f5ef0 100644 +--- a/cmake/upb.cmake ++++ b/cmake/upb.cmake +@@ -12,9 +12,19 @@ + # 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::fastdecode upb::json upb::upb upb::utf8_range upb::textformat upb::reflection upb::descriptor_upb_proto) ++ set(_gRPC_UPB_INCLUDE_DIR) ++ set(_gRPC_FIND_UPB "if(NOT upb_FOUND)\n find_package(upb CONFIG REQUIRED)\nendif()") ++endif() diff --git a/dev/vcpkg/ports/grpc/00012-fix-use-cxx17.patch b/dev/vcpkg/ports/grpc/00012-fix-use-cxx17.patch new file mode 100644 index 000000000000..56bc4367608e --- /dev/null +++ b/dev/vcpkg/ports/grpc/00012-fix-use-cxx17.patch @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 25990a5d8a..ba8df92858 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -326,6 +326,11 @@ include(cmake/xxhash.cmake) + include(cmake/zlib.cmake) + include(cmake/download_archive.cmake) + ++if (ABSL_USE_CXX17) ++ message(STATUS "Found absl uses CXX17, enable CXX17 feature.") ++ set(CMAKE_CXX_STANDARD 17) ++endif() ++ + # Setup external proto library at third_party/envoy-api with 2 download URLs + if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/envoy-api) + # Download the archive via HTTP, validate the checksum, and extract to third_party/envoy-api. diff --git a/dev/vcpkg/ports/grpc/00014-pkgconfig-upbdefs.patch b/dev/vcpkg/ports/grpc/00014-pkgconfig-upbdefs.patch new file mode 100644 index 000000000000..1c2bda5b1b94 --- /dev/null +++ b/dev/vcpkg/ports/grpc/00014-pkgconfig-upbdefs.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 48019cce95..1eda700ae8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -23186,7 +23186,7 @@ generate_pkgconfig( + "high performance general RPC framework" + "${gRPC_CORE_VERSION}" + "gpr openssl absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional 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" +- "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz" ++ "-lgrpc -laddress_sorting -lre2 -lupb_textformat -lupb_mini_table -lupb -lupb_collections -lupb_reflection -lupb_extension_registry -lupb_json -lupb_fastdecode -lupb_utf8_range -ldescriptor_upb_proto -lcares -lz" + "" + "grpc.pc") + diff --git a/dev/vcpkg/ports/grpc/00015-disable-download-archive.patch b/dev/vcpkg/ports/grpc/00015-disable-download-archive.patch new file mode 100644 index 000000000000..b28bc72a7c91 --- /dev/null +++ b/dev/vcpkg/ports/grpc/00015-disable-download-archive.patch @@ -0,0 +1,12 @@ +diff --git a/cmake/download_archive.cmake b/cmake/download_archive.cmake +index 820aafafb7..a59b785c7e 100644 +--- a/cmake/download_archive.cmake ++++ b/cmake/download_archive.cmake +@@ -19,6 +19,7 @@ file(MAKE_DIRECTORY ${_download_archive_TEMPORARY_DIR}) + # Note that strip_prefix strips the directory path prefix of the extracted + # archive content, and it may strip multiple directories. + function(download_archive destination url hash strip_prefix) ++ return() + # Fetch and validate + set(_TEMPORARY_FILE ${_download_archive_TEMPORARY_DIR}/${strip_prefix}.tar.gz) + message(STATUS "Downloading from ${url}, if failed, please try configuring again") diff --git a/dev/vcpkg/ports/grpc/00016_add_header.patch b/dev/vcpkg/ports/grpc/00016_add_header.patch new file mode 100644 index 000000000000..ba166a5ee36b --- /dev/null +++ b/dev/vcpkg/ports/grpc/00016_add_header.patch @@ -0,0 +1,12 @@ +diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc +index 72e1b66..8dc1fd1 100644 +--- a/src/core/lib/iomgr/tcp_posix.cc ++++ b/src/core/lib/iomgr/tcp_posix.cc +@@ -47,6 +47,7 @@ + #include + #include + #include ++#include + + #include "src/core/lib/address_utils/sockaddr_utils.h" + #include "src/core/lib/debug/event_log.h" diff --git a/dev/vcpkg/ports/grpc/gRPCTargets-vcpkg-tools.cmake b/dev/vcpkg/ports/grpc/gRPCTargets-vcpkg-tools.cmake new file mode 100644 index 000000000000..1ed3509c9408 --- /dev/null +++ b/dev/vcpkg/ports/grpc/gRPCTargets-vcpkg-tools.cmake @@ -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() diff --git a/dev/vcpkg/ports/grpc/macos.patch b/dev/vcpkg/ports/grpc/macos.patch new file mode 100644 index 000000000000..ab21439d1931 --- /dev/null +++ b/dev/vcpkg/ports/grpc/macos.patch @@ -0,0 +1,12 @@ +diff --git a/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc b/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +index 96de4bbf0ba85..a202e815abe0e 100644 +--- a/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc ++++ b/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +@@ -18,6 +18,7 @@ + #include + #ifdef AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER + ++#include "absl/strings/str_cat.h" + #include "absl/strings/str_format.h" + + #include "src/core/lib/address_utils/parse_address.h" diff --git a/dev/vcpkg/ports/grpc/portfile.cmake b/dev/vcpkg/ports/grpc/portfile.cmake new file mode 100644 index 000000000000..9653bb095610 --- /dev/null +++ b/dev/vcpkg/ports/grpc/portfile.cmake @@ -0,0 +1,99 @@ +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO grpc/grpc + REF v1.51.1 + SHA512 1bc8e7a5a15b2dca88527d111cde398b0dc1921bbc945c6df8225b4225b8ac0b43155bcf743230ce7b5962d1ab948e9363229c98a879b1befc7a939a290fb888 + HEAD_REF master + PATCHES + 00001-fix-uwp.patch + 00002-static-linking-in-linux.patch + 00003-undef-base64-macro.patch + 00004-link-gdi32-on-windows.patch + 00005-fix-uwp-error.patch + 00009-use-system-upb.patch + snprintf.patch + 00012-fix-use-cxx17.patch + 00014-pkgconfig-upbdefs.patch + 00015-disable-download-archive.patch + 00016_add_header.patch +) + +if(NOT TARGET_TRIPLET STREQUAL HOST_TRIPLET) + vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/grpc") +endif() + +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" gRPC_MSVC_STATIC_RUNTIME) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" gRPC_STATIC_LINKING) + +if(VCPKG_TARGET_IS_UWP) + set(cares_CARES_PROVIDER OFF) +else() + set(cares_CARES_PROVIDER "package") +endif() + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + codegen gRPC_BUILD_CODEGEN +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS ${FEATURE_OPTIONS} + -DgRPC_INSTALL=ON + -DgRPC_BUILD_TESTS=OFF + -DgRPC_STATIC_LINKING=${gRPC_STATIC_LINKING} + -DgRPC_MSVC_STATIC_RUNTIME=${gRPC_MSVC_STATIC_RUNTIME} + -DgRPC_ZLIB_PROVIDER=package + -DgRPC_SSL_PROVIDER=package + -DgRPC_PROTOBUF_PROVIDER=package + -DgRPC_ABSL_PROVIDER=package + -DgRPC_UPB_PROVIDER=package + -DgRPC_RE2_PROVIDER=package + -DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG + -DgRPC_CARES_PROVIDER=${cares_CARES_PROVIDER} + -DgRPC_BENCHMARK_PROVIDER=none + -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}" + MAYBE_UNUSED_VARIABLES + gRPC_MSVC_STATIC_RUNTIME +) + +vcpkg_cmake_install(ADD_BIN_TO_PATH) + +vcpkg_cmake_config_fixup() + +if (gRPC_BUILD_CODEGEN) + vcpkg_copy_tools( + AUTO_CLEAN + TOOL_NAMES + grpc_php_plugin + grpc_python_plugin + grpc_node_plugin + grpc_objective_c_plugin + grpc_csharp_plugin + grpc_cpp_plugin + grpc_ruby_plugin + ) +else() + configure_file("${CMAKE_CURRENT_LIST_DIR}/gRPCTargets-vcpkg-tools.cmake" "${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-vcpkg-tools.cmake" @ONLY) +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_copy_pdbs() +if (VCPKG_TARGET_IS_WINDOWS) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig") +else() + vcpkg_fixup_pkgconfig() +endif() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/dev/vcpkg/ports/grpc/snprintf.patch b/dev/vcpkg/ports/grpc/snprintf.patch new file mode 100644 index 000000000000..b5012ad2dba8 --- /dev/null +++ b/dev/vcpkg/ports/grpc/snprintf.patch @@ -0,0 +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/dev/vcpkg/ports/grpc/vcpkg-cmake-wrapper.cmake b/dev/vcpkg/ports/grpc/vcpkg-cmake-wrapper.cmake new file mode 100644 index 000000000000..9adf0288084d --- /dev/null +++ b/dev/vcpkg/ports/grpc/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,2 @@ +list(REMOVE_AT ARGS 0) +_find_package(gRPC ${ARGS}) # Shouldn't this be fixed downstream instead of using a Wrapper? \ No newline at end of file diff --git a/dev/vcpkg/ports/grpc/vcpkg.json b/dev/vcpkg/ports/grpc/vcpkg.json new file mode 100644 index 000000000000..8647b3fb298e --- /dev/null +++ b/dev/vcpkg/ports/grpc/vcpkg.json @@ -0,0 +1,48 @@ +{ + "name": "grpc", + "version-semver": "1.51.1", + "port-version": 3, + "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", + "dependencies": [ + "abseil", + { + "name": "c-ares", + "platform": "!uwp" + }, + { + "name": "grpc", + "host": true, + "features": [ + "codegen" + ] + }, + "openssl", + "protobuf", + { + "name": "protobuf", + "host": true + }, + "re2", + "upb", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zlib" + ], + "features": { + "absl-sync": { + "description": "Deprecated." + }, + "codegen": { + "description": "Build code generator machinery", + "supports": "!uwp" + } + } +} From e532fd73c0a3a7ac0af6dbf1427caaffe5e3e45d Mon Sep 17 00:00:00 2001 From: Yuan Date: Thu, 5 Feb 2026 10:48:42 +0000 Subject: [PATCH 06/12] fix google cloud Signed-off-by: Yuan --- dev/vcpkg/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/vcpkg/vcpkg.json b/dev/vcpkg/vcpkg.json index 00bb48c4b094..82ce695f908d 100644 --- a/dev/vcpkg/vcpkg.json +++ b/dev/vcpkg/vcpkg.json @@ -76,7 +76,7 @@ "features": [ "storage" ], - "version>=": "2.37.0" + "version>=": "2.22.0" } ] }, From 8276f39af19fcb7ae0ae5f95a9805ee38ba473c3 Mon Sep 17 00:00:00 2001 From: Yuan Date: Thu, 5 Feb 2026 12:04:22 +0000 Subject: [PATCH 07/12] fix Signed-off-by: Yuan --- dev/vcpkg/triplets/arm64-osx-release.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/dev/vcpkg/triplets/arm64-osx-release.cmake b/dev/vcpkg/triplets/arm64-osx-release.cmake index ff42b314ec69..c619716bea46 100644 --- a/dev/vcpkg/triplets/arm64-osx-release.cmake +++ b/dev/vcpkg/triplets/arm64-osx-release.cmake @@ -11,6 +11,3 @@ set(VCPKG_BUILD_TYPE release) set(VCPKG_C_FLAGS "") set(VCPKG_CXX_FLAGS "-std=c++20 -Wno-missing-template-arg-list-after-template-kw") -#if("${PORT}" STREQUAL "grpc") -# set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -Wno-missing-template-arg-list-after-template-kw") -#endif() From 1658aa18aa16bf1877ef16806c4eb16606acb596 Mon Sep 17 00:00:00 2001 From: Yuan Date: Thu, 5 Feb 2026 14:44:52 +0000 Subject: [PATCH 08/12] move to arm Signed-off-by: Yuan --- .github/workflows/velox_backend_arm.yml | 20 ++++++++++++++++++++ .github/workflows/velox_weekly.yml | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/velox_backend_arm.yml b/.github/workflows/velox_backend_arm.yml index bd566abe1060..645648407a24 100644 --- a/.github/workflows/velox_backend_arm.yml +++ b/.github/workflows/velox_backend_arm.yml @@ -195,3 +195,23 @@ jobs: with: name: ${{ github.job }}-test-log path: "**/target/*.log" + + build-on-macos: + strategy: + fail-fast: false + if: ${{ startsWith(github.repository, 'apache/') }} + runs-on: macos-15 + env: + INSTALL_PREFIX: /tmp/deps-install + NUM_THREADS: 4 + steps: + - uses: actions/checkout@v5 + - name: Set up Java 17 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - name: Install Dependencies + run: brew install wget pkgconfig ccache cmake autoconf automake libtool autoconf-archive bison flex + - name: Build + run: ./dev/buildbundle-veloxbe.sh --enable_vcpkg=ON --run_setup_script=OFF --build_arrow=ON --build_tests=ON --build_benchmarks=ON --spark_version=3.5 diff --git a/.github/workflows/velox_weekly.yml b/.github/workflows/velox_weekly.yml index c363b43b7798..3ae0139671d5 100644 --- a/.github/workflows/velox_weekly.yml +++ b/.github/workflows/velox_weekly.yml @@ -220,6 +220,6 @@ jobs: distribution: temurin java-version: 17 - name: Install Dependencies - run: brew install wget pkgconfig ccache cmake autoconf automake libtool autoconf-archive bison flex + run: brew install wget pkgconfig abseil ccache - name: Build - run: ./dev/buildbundle-veloxbe.sh --enable_vcpkg=ON --run_setup_script=OFF --build_arrow=ON --build_tests=ON --build_benchmarks=ON --spark_version=3.5 + run: ./dev/buildbundle-veloxbe.sh --run_setup_script=ON --build_arrow=ON --build_tests=ON --build_benchmarks=ON --spark_version=3.5 From eaaaeb4bdd78680f418e99a4a02adcfca14e030b Mon Sep 17 00:00:00 2001 From: Yuan Date: Fri, 13 Mar 2026 14:15:47 +0000 Subject: [PATCH 09/12] fix glog linking Signed-off-by: Yuan --- cpp/core/CMakeLists.txt | 1 + cpp/core/symbols.map | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/core/CMakeLists.txt b/cpp/core/CMakeLists.txt index 58dd301b6968..039a83d45d04 100644 --- a/cpp/core/CMakeLists.txt +++ b/cpp/core/CMakeLists.txt @@ -230,6 +230,7 @@ endif() target_link_libraries(gluten PUBLIC Arrow::arrow Arrow::arrow_bundled_dependencies) +add_compile_definitions(GLOG_CUSTOM_PREFIX=gluten) target_link_libraries(gluten PRIVATE google::glog) install(TARGETS gluten DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/cpp/core/symbols.map b/cpp/core/symbols.map index 78300ed6d160..e659ec7f4873 100644 --- a/cpp/core/symbols.map +++ b/cpp/core/symbols.map @@ -11,6 +11,5 @@ *google::*; fL*::FLAGS_*; gflags_mutex_namespace::*; - glog_internal_namespace_::*; }; }; From 0921ae4318eb10da38728268228eec243e3b0858 Mon Sep 17 00:00:00 2001 From: Yuan Date: Fri, 13 Mar 2026 21:38:31 +0000 Subject: [PATCH 10/12] using shared glog and gflags Signed-off-by: Yuan --- dev/vcpkg/triplets/arm64-osx-release.cmake | 7 +++++++ ep/build-velox/src/build-velox.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dev/vcpkg/triplets/arm64-osx-release.cmake b/dev/vcpkg/triplets/arm64-osx-release.cmake index c619716bea46..39b5c5786403 100644 --- a/dev/vcpkg/triplets/arm64-osx-release.cmake +++ b/dev/vcpkg/triplets/arm64-osx-release.cmake @@ -11,3 +11,10 @@ set(VCPKG_BUILD_TYPE release) set(VCPKG_C_FLAGS "") set(VCPKG_CXX_FLAGS "-std=c++20 -Wno-missing-template-arg-list-after-template-kw") +if(PORT MATCHES "glog") + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() + +if(PORT MATCHES "gflags") + set(VCPKG_LIBRARY_LINKAGE dynamic) +endif() diff --git a/ep/build-velox/src/build-velox.sh b/ep/build-velox/src/build-velox.sh index 40263a28a365..c9aa607377b1 100755 --- a/ep/build-velox/src/build-velox.sh +++ b/ep/build-velox/src/build-velox.sh @@ -138,7 +138,7 @@ function compile { -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc" fi if [ -n "${GLUTEN_VCPKG_ENABLED:-}" ]; then - COMPILE_OPTION="$COMPILE_OPTION -DVELOX_GFLAGS_TYPE=static" + COMPILE_OPTION="$COMPILE_OPTION -DVELOX_GFLAGS_TYPE=shared" fi COMPILE_OPTION="$COMPILE_OPTION -DCMAKE_BUILD_TYPE=${BUILD_TYPE}" From 87c68933b77385eafc1e05c336280365d380cb23 Mon Sep 17 00:00:00 2001 From: Yuan Date: Fri, 13 Mar 2026 21:40:25 +0000 Subject: [PATCH 11/12] enable cpp test Signed-off-by: Yuan --- .github/workflows/velox_backend_arm.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/velox_backend_arm.yml b/.github/workflows/velox_backend_arm.yml index 645648407a24..f2354b26fa2e 100644 --- a/.github/workflows/velox_backend_arm.yml +++ b/.github/workflows/velox_backend_arm.yml @@ -215,3 +215,6 @@ jobs: run: brew install wget pkgconfig ccache cmake autoconf automake libtool autoconf-archive bison flex - name: Build run: ./dev/buildbundle-veloxbe.sh --enable_vcpkg=ON --run_setup_script=OFF --build_arrow=ON --build_tests=ON --build_benchmarks=ON --spark_version=3.5 + - name: Run CPP unit test + run: | + cd ./cpp/build && ctest -V From f80a40ede20441905576db6b121be2d61fb0b9ef Mon Sep 17 00:00:00 2001 From: Yuan Date: Sat, 14 Mar 2026 13:08:46 +0000 Subject: [PATCH 12/12] fix Signed-off-by: Yuan --- ep/build-velox/src/build-velox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ep/build-velox/src/build-velox.sh b/ep/build-velox/src/build-velox.sh index c9aa607377b1..d4886dffdb21 100755 --- a/ep/build-velox/src/build-velox.sh +++ b/ep/build-velox/src/build-velox.sh @@ -137,8 +137,8 @@ function compile { COMPILE_OPTION="$COMPILE_OPTION -DVELOX_ENABLE_CUDF=ON -DCMAKE_CUDA_ARCHITECTURES=75 \ -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc" fi - if [ -n "${GLUTEN_VCPKG_ENABLED:-}" ]; then - COMPILE_OPTION="$COMPILE_OPTION -DVELOX_GFLAGS_TYPE=shared" + if [ -n "${GLUTEN_VCPKG_ENABLED:-}" ] && [ ! "${CMAKE_SYSTEM_NAME}" == "Darwin" ]; then + COMPILE_OPTION="$COMPILE_OPTION -DVELOX_GFLAGS_TYPE=static" fi COMPILE_OPTION="$COMPILE_OPTION -DCMAKE_BUILD_TYPE=${BUILD_TYPE}"