From e05f3d9b6d3a202d9263f14328f403f3f71294a3 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Fri, 5 Jul 2024 14:30:42 +0900 Subject: [PATCH] GH-43134: [C++] Upgrade bundled google-cloud-cpp to 2.22.0 (#43136) ### Rationale for this change `google_cloud_cpp_mocks` depends on `GTest::gmock_main` but it's built without `BUILD_TESTING`. google-cloud-cpp finds GoogleTest only with `BUILD_TESTING`. ### What changes are included in this PR? The recent google-cloud-cpp doesn't build `google_cloud_cpp_mocks` without `BUILD_TESTING`. Note that we can't use 2.23.0 or later because they can't be built with MinGW-w64. See also: * https://github.com/mingw-w64/mingw-w64/issues/49 * https://github.com/googleapis/google-cloud-cpp/issues/14436 ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * GitHub Issue: #43134 Authored-by: Sutou Kouhei Signed-off-by: Sutou Kouhei --- ci/scripts/PKGBUILD | 6 ++++++ cpp/cmake_modules/ThirdpartyToolchain.cmake | 7 ++++++- cpp/thirdparty/versions.txt | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ci/scripts/PKGBUILD b/ci/scripts/PKGBUILD index f6bbc78be710e..e12099f2b405d 100644 --- a/ci/scripts/PKGBUILD +++ b/ci/scripts/PKGBUILD @@ -69,6 +69,12 @@ build() { mkdir -p ${cpp_build_dir} pushd ${cpp_build_dir} + # We use static cURL in google-cloud-cpp. If we can use cURL's CMake + # package, we don't need to specify CURL_STATICLIB explicitly. But + # we don't have cURL's CMake package. We need to use CXXFLAGS + # instead of ARROW_CXXFLAGS because ARROW_CXXFLAGS aren't passed to + # ExternProjects. + export CXXFLAGS="${CXXFLAGS} -DCURL_STATICLIB" # The Rtools libutf8proc is a static lib, but Findutf8proc.cmake doesn't # set the appropriate compiler definition. export CPPFLAGS="-DUTF8PROC_STATIC" diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index fe859a0121ca6..171c85baa86c3 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -4225,7 +4225,8 @@ macro(build_nlohmann_json) set(NLOHMANN_JSON_INCLUDE_DIR "${NLOHMANN_JSON_PREFIX}/include") set(NLOHMANN_JSON_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=" - -DJSON_BuildTests=OFF) + # google-cloud-cpp requires JSON_MultipleHeaders=ON + -DJSON_BuildTests=OFF -DJSON_MultipleHeaders=ON) set(NLOHMANN_JSON_BUILD_BYPRODUCTS ${NLOHMANN_JSON_PREFIX}/include/nlohmann/json.hpp) @@ -4294,6 +4295,7 @@ macro(build_google_cloud_cpp_storage) # We need this to build with OpenSSL 3.0. # See also: https://github.com/googleapis/google-cloud-cpp/issues/8544 -DGOOGLE_CLOUD_CPP_ENABLE_WERROR=OFF + -DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF -DOPENSSL_CRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} -DOPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} -DOPENSSL_SSL_LIBRARY=${OPENSSL_SSL_LIBRARY}) @@ -4380,6 +4382,9 @@ macro(build_google_cloud_cpp_storage) nlohmann_json::nlohmann_json OpenSSL::SSL OpenSSL::Crypto) + if(WIN32) + target_link_libraries(google-cloud-cpp::rest-internal INTERFACE ws2_32) + endif() add_library(google-cloud-cpp::storage STATIC IMPORTED) set_target_properties(google-cloud-cpp::storage diff --git a/cpp/thirdparty/versions.txt b/cpp/thirdparty/versions.txt index f080cf58bca85..986ac056b61a6 100644 --- a/cpp/thirdparty/versions.txt +++ b/cpp/thirdparty/versions.txt @@ -72,8 +72,8 @@ ARROW_GFLAGS_BUILD_VERSION=v2.2.2 ARROW_GFLAGS_BUILD_SHA256_CHECKSUM=34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf ARROW_GLOG_BUILD_VERSION=v0.5.0 ARROW_GLOG_BUILD_SHA256_CHECKSUM=eede71f28371bf39aa69b45de23b329d37214016e2055269b3b5e7cfd40b59f5 -ARROW_GOOGLE_CLOUD_CPP_BUILD_VERSION=v2.12.0 -ARROW_GOOGLE_CLOUD_CPP_BUILD_SHA256_CHECKSUM=8cda870803925c62de8716a765e03eb9d34249977e5cdb7d0d20367e997a55e2 +ARROW_GOOGLE_CLOUD_CPP_BUILD_VERSION=v2.22.0 +ARROW_GOOGLE_CLOUD_CPP_BUILD_SHA256_CHECKSUM=0c68782e57959c82e0c81def805c01460a042c1aae0c2feee905acaa2a2dc9bf ARROW_GRPC_BUILD_VERSION=v1.46.3 ARROW_GRPC_BUILD_SHA256_CHECKSUM=d6cbf22cb5007af71b61c6be316a79397469c58c82a942552a62e708bce60964 ARROW_GTEST_BUILD_VERSION=1.11.0