This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 8cb2d81 ARROW-10896: [C++][CMake] Rename internal RE2 package name to
"re2" from "RE2"
8cb2d81 is described below
commit 8cb2d81dc33f921974f8ef779a42d35a61ad195f
Author: Sutou Kouhei <[email protected]>
AuthorDate: Wed Dec 16 12:19:28 2020 +0900
ARROW-10896: [C++][CMake] Rename internal RE2 package name to "re2" from
"RE2"
Because upstream uses "re2". If we don't use different package name
such as "RE2", RE2 package is conflicted with other package that uses
RE2 such as gRPC.
This change also includes resolve_dependency() cleanup. There were
some custom resolve_dependency() like codes for packages that need our
custom "Alt" version such as Boost and gRPC. We can use
resolved_dependency() for these packages with the new HAVE_ALT option.
This change also renamed our Boost dependency name to "Boost" from
"BOOST". It means that users need to use -DBoost_SOURCE not
-DBOOST_SOURCE. To keep backward compatibility, -DBOOST_SOURCE is
still accepted when -DBoost_SOURCE isn't specified.
Users also need to use -Dre2_SOURCE not -DRE2_SOURCE. To keep backward
compatibility, -DRE2_SOURCE is still accepted when -Dre2_SOURCE isn't
specified.
Closes #8908 from kou/cpp-re2
Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
ci/scripts/msys2_setup.sh | 1 +
cpp/CMakeLists.txt | 6 +-
cpp/cmake_modules/FindRapidJSONAlt.cmake | 14 ++
cpp/cmake_modules/FindgRPCAlt.cmake | 13 ++
cpp/cmake_modules/FindgflagsAlt.cmake | 13 ++
.../{FindRE2.cmake => Findre2Alt.cmake} | 25 ++--
cpp/cmake_modules/ThirdpartyToolchain.cmake | 162 ++++++++-------------
cpp/src/arrow/flight/client_header_internal.cc | 3 +-
cpp/src/arrow/flight/customize_protobuf.h | 40 ++---
cpp/src/gandiva/CMakeLists.txt | 8 +-
cpp/src/gandiva/precompiled/CMakeLists.txt | 2 +-
.../debian.ubuntu-xenial/libarrow-dev.install | 2 +-
.../apache-arrow/debian/libarrow-dev.install | 2 +-
.../linux-packages/apache-arrow/yum/arrow.spec.in | 4 +-
14 files changed, 141 insertions(+), 154 deletions(-)
diff --git a/ci/scripts/msys2_setup.sh b/ci/scripts/msys2_setup.sh
index 6989f49..793c5bf 100755
--- a/ci/scripts/msys2_setup.sh
+++ b/ci/scripts/msys2_setup.sh
@@ -42,6 +42,7 @@ case "${target}" in
packages+=(${MINGW_PACKAGE_PREFIX}-protobuf)
packages+=(${MINGW_PACKAGE_PREFIX}-python3-numpy)
packages+=(${MINGW_PACKAGE_PREFIX}-rapidjson)
+ packages+=(${MINGW_PACKAGE_PREFIX}-re2)
packages+=(${MINGW_PACKAGE_PREFIX}-snappy)
packages+=(${MINGW_PACKAGE_PREFIX}-thrift)
packages+=(${MINGW_PACKAGE_PREFIX}-zlib)
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 27e1b3e..0f67c6a 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -751,10 +751,10 @@ if(ARROW_WITH_UTF8PROC)
endif()
if(ARROW_WITH_RE2)
- list(APPEND ARROW_LINK_LIBS RE2::re2)
- list(APPEND ARROW_STATIC_LINK_LIBS RE2::re2)
+ list(APPEND ARROW_LINK_LIBS re2::re2)
+ list(APPEND ARROW_STATIC_LINK_LIBS re2::re2)
if(RE2_SOURCE STREQUAL "SYSTEM")
- list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS RE2::re2)
+ list(APPEND ARROW_STATIC_INSTALL_INTERFACE_LIBS re2::re2)
endif()
endif()
diff --git a/cpp/cmake_modules/FindRapidJSONAlt.cmake
b/cpp/cmake_modules/FindRapidJSONAlt.cmake
index 088dd1a..a967ef6 100644
--- a/cpp/cmake_modules/FindRapidJSONAlt.cmake
+++ b/cpp/cmake_modules/FindRapidJSONAlt.cmake
@@ -15,6 +15,20 @@
# specific language governing permissions and limitations
# under the License.
+set(find_package_args)
+if(RapidJSONAlt_FIND_VERSION)
+ list(APPEND find_package_args ${RapidJSONAlt_FIND_VERSION})
+endif()
+if(RapidJSONAlt_FIND_QUIETLY)
+ list(APPEND find_package_args QUIET)
+endif()
+find_package(RapidJSON ${find_package_args})
+if(RapidJSON_FOUND)
+ set(RapidJSONAlt_FOUND TRUE)
+ set(RAPIDJSON_INCLUDE_DIR ${RAPIDJSON_INCLUDE_DIRS})
+ return()
+endif()
+
if(RapidJSON_ROOT)
find_path(RAPIDJSON_INCLUDE_DIR
NAMES rapidjson/rapidjson.h
diff --git a/cpp/cmake_modules/FindgRPCAlt.cmake
b/cpp/cmake_modules/FindgRPCAlt.cmake
index d6ba331..79fe017 100644
--- a/cpp/cmake_modules/FindgRPCAlt.cmake
+++ b/cpp/cmake_modules/FindgRPCAlt.cmake
@@ -11,6 +11,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+set(find_package_args)
+if(gRPCAlt_FIND_VERSION)
+ list(APPEND find_package_args ${gRPCAlt_FIND_VERSION})
+endif()
+if(gRPCAlt_FIND_QUIETLY)
+ list(APPEND find_package_args QUIET)
+endif()
+find_package(gRPC ${find_package_args})
+if(gRPC_FOUND)
+ set(gRPCAlt_FOUND TRUE)
+ return()
+endif()
+
unset(GRPC_ALT_VERSION)
if(ARROW_GRPC_USE_SHARED)
diff --git a/cpp/cmake_modules/FindgflagsAlt.cmake
b/cpp/cmake_modules/FindgflagsAlt.cmake
index cf6d265..e092ea3 100644
--- a/cpp/cmake_modules/FindgflagsAlt.cmake
+++ b/cpp/cmake_modules/FindgflagsAlt.cmake
@@ -15,6 +15,19 @@
# specific language governing permissions and limitations
# under the License.
+set(find_package_args)
+if(gflagsAlt_FIND_VERSION)
+ list(APPEND find_package_args ${gflagsAlt_FIND_VERSION})
+endif()
+if(gflagsAlt_FIND_QUIETLY)
+ list(APPEND find_package_args QUIET)
+endif()
+find_package(gflags ${find_package_args})
+if(gflags_FOUND)
+ set(gflagsAlt_FOUND TRUE)
+ return()
+endif()
+
# TODO: Support version detection.
if(gflags_ROOT)
diff --git a/cpp/cmake_modules/FindRE2.cmake
b/cpp/cmake_modules/Findre2Alt.cmake
similarity index 84%
rename from cpp/cmake_modules/FindRE2.cmake
rename to cpp/cmake_modules/Findre2Alt.cmake
index 645a20f..b9e4156 100644
--- a/cpp/cmake_modules/FindRE2.cmake
+++ b/cpp/cmake_modules/Findre2Alt.cmake
@@ -15,6 +15,19 @@
# specific language governing permissions and limitations
# under the License.
+set(find_package_args)
+if(re2Alt_FIND_VERSION)
+ list(APPEND find_package_args ${re2Alt_FIND_VERSION})
+endif()
+if(re2Alt_FIND_QUIETLY)
+ list(APPEND find_package_args QUIET)
+endif()
+find_package(re2 ${find_package_args})
+if(re2_FOUND)
+ set(re2Alt_FOUND TRUE)
+ return()
+endif()
+
find_package(PkgConfig QUIET)
pkg_check_modules(RE2_PC re2)
if(RE2_PC_FOUND)
@@ -60,16 +73,10 @@ else()
find_path(RE2_INCLUDE_DIR NAMES re2/re2.h PATH_SUFFIXES
${ARROW_INCLUDE_PATH_SUFFIXES})
endif()
-find_package_handle_standard_args(RE2 REQUIRED_VARS RE2_LIB RE2_INCLUDE_DIR)
+find_package_handle_standard_args(re2Alt REQUIRED_VARS RE2_LIB RE2_INCLUDE_DIR)
-if(RE2_FOUND)
- if(NOT TARGET RE2::re2)
- add_library(RE2::re2 UNKNOWN IMPORTED)
- set_target_properties(RE2::re2
- PROPERTIES IMPORTED_LOCATION "${RE2_LIB}"
- INTERFACE_INCLUDE_DIRECTORIES
"${RE2_INCLUDE_DIR}")
- endif()
- # Some third-party dependencies (namely gRPC) are on the look-out for a
lower-case re2 Target.
+# CMake 3.2 does uppercase the FOUND variable
+if(re2Alt_FOUND OR RE2ALT_FOUND)
if(NOT TARGET re2::re2)
add_library(re2::re2 UNKNOWN IMPORTED)
set_target_properties(re2::re2
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index af5cbdd..a1a6b21 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -52,7 +52,7 @@ endif()
set(ARROW_THIRDPARTY_DEPENDENCIES
AWSSDK
benchmark
- BOOST
+ Boost
Brotli
BZip2
c-ares
@@ -63,7 +63,7 @@ set(ARROW_THIRDPARTY_DEPENDENCIES
LLVM
Lz4
ORC
- RE2
+ re2
Protobuf
RapidJSON
Snappy
@@ -80,6 +80,22 @@ if(MSVC AND "${GTest_SOURCE}" STREQUAL "")
set(GTest_SOURCE "BUNDLED")
endif()
+# For backward compatibility. We use "BOOST_SOURCE" if "Boost_SOURCE"
+# isn't specified and "BOOST_SOURCE" is specified.
+# We renamed "BOOST" dependency name to "Boost" in 3.0.0 because
+# upstreams (CMake and Boost) use "Boost" not "BOOST" as package name.
+if("${Boost_SOURCE}" STREQUAL "" AND NOT "${BOOST_SOURCE}" STREQUAL "")
+ set(Boost_SOURCE ${BOOST_SOURCE})
+endif()
+
+# For backward compatibility. We use "RE2_SOURCE" if "re2_SOURCE"
+# isn't specified and "RE2_SOURCE" is specified.
+# We renamed "RE2" dependency name to "re2" in 3.0.0 because
+# upstream uses "re2" not "RE2" as package name.
+if("${re2_SOURCE}" STREQUAL "" AND NOT "${RE2_SOURCE}" STREQUAL "")
+ set(re2_SOURCE ${RE2_SOURCE})
+endif()
+
message(STATUS "Using ${ARROW_DEPENDENCY_SOURCE} approach to find
dependencies")
if(ARROW_DEPENDENCY_SOURCE STREQUAL "CONDA")
@@ -122,6 +138,8 @@ macro(build_dependency DEPENDENCY_NAME)
build_awssdk()
elseif("${DEPENDENCY_NAME}" STREQUAL "benchmark")
build_benchmark()
+ elseif("${DEPENDENCY_NAME}" STREQUAL "Boost")
+ build_boost()
elseif("${DEPENDENCY_NAME}" STREQUAL "Brotli")
build_brotli()
elseif("${DEPENDENCY_NAME}" STREQUAL "BZip2")
@@ -142,7 +160,9 @@ macro(build_dependency DEPENDENCY_NAME)
build_orc()
elseif("${DEPENDENCY_NAME}" STREQUAL "Protobuf")
build_protobuf()
- elseif("${DEPENDENCY_NAME}" STREQUAL "RE2")
+ elseif("${DEPENDENCY_NAME}" STREQUAL "RapidJSON")
+ build_rapidjson()
+ elseif("${DEPENDENCY_NAME}" STREQUAL "re2")
build_re2()
elseif("${DEPENDENCY_NAME}" STREQUAL "Snappy")
build_snappy()
@@ -161,18 +181,18 @@ endmacro()
# Find modules are needed by the consumer in case of a static build, or if the
# linkage is PUBLIC or INTERFACE.
-macro(provide_find_module DEPENDENCY_NAME)
- set(module_ "${CMAKE_SOURCE_DIR}/cmake_modules/Find${DEPENDENCY_NAME}.cmake")
+macro(provide_find_module PACKAGE_NAME)
+ set(module_ "${CMAKE_SOURCE_DIR}/cmake_modules/Find${PACKAGE_NAME}.cmake")
if(EXISTS "${module_}")
- message(STATUS "Providing cmake module for ${DEPENDENCY_NAME}")
+ message(STATUS "Providing cmake module for ${PACKAGE_NAME}")
install(FILES "${module_}" DESTINATION "${ARROW_CMAKE_INSTALL_DIR}")
endif()
unset(module_)
endmacro()
macro(resolve_dependency DEPENDENCY_NAME)
- set(options)
- set(one_value_args REQUIRED_VERSION)
+ set(options HAVE_ALT)
+ set(one_value_args REQUIRED_VERSION IS_RUNTIME_DEPENDENCY)
cmake_parse_arguments(ARG
"${options}"
"${one_value_args}"
@@ -181,14 +201,22 @@ macro(resolve_dependency DEPENDENCY_NAME)
if(ARG_UNPARSED_ARGUMENTS)
message(SEND_ERROR "Error: unrecognized arguments:
${ARG_UNPARSED_ARGUMENTS}")
endif()
+ if("${ARG_IS_RUNTIME_DEPENDENCY}" STREQUAL "")
+ set(ARG_IS_RUNTIME_DEPENDENCY TRUE)
+ endif()
+ if(ARG_HAVE_ALT)
+ set(PACKAGE_NAME "${DEPENDENCY_NAME}Alt")
+ else()
+ set(PACKAGE_NAME ${DEPENDENCY_NAME})
+ endif()
if(${DEPENDENCY_NAME}_SOURCE STREQUAL "AUTO")
if(ARG_REQUIRED_VERSION)
- find_package(${DEPENDENCY_NAME} ${ARG_REQUIRED_VERSION})
+ find_package(${PACKAGE_NAME} ${ARG_REQUIRED_VERSION})
else()
- find_package(${DEPENDENCY_NAME})
+ find_package(${PACKAGE_NAME})
endif()
- if(${${DEPENDENCY_NAME}_FOUND})
+ if(${${PACKAGE_NAME}_FOUND})
set(${DEPENDENCY_NAME}_SOURCE "SYSTEM")
else()
build_dependency(${DEPENDENCY_NAME})
@@ -198,14 +226,14 @@ macro(resolve_dependency DEPENDENCY_NAME)
build_dependency(${DEPENDENCY_NAME})
elseif(${DEPENDENCY_NAME}_SOURCE STREQUAL "SYSTEM")
if(ARG_REQUIRED_VERSION)
- find_package(${DEPENDENCY_NAME} ${ARG_REQUIRED_VERSION} REQUIRED)
+ find_package(${PACKAGE_NAME} ${ARG_REQUIRED_VERSION} REQUIRED)
else()
- find_package(${DEPENDENCY_NAME} REQUIRED)
+ find_package(${PACKAGE_NAME} REQUIRED)
endif()
endif()
- if(${DEPENDENCY_NAME}_SOURCE STREQUAL "SYSTEM")
- provide_find_module(${DEPENDENCY_NAME})
- list(APPEND ARROW_SYSTEM_DEPENDENCIES ${DEPENDENCY_NAME})
+ if(${DEPENDENCY_NAME}_SOURCE STREQUAL "SYSTEM" AND ARG_IS_RUNTIME_DEPENDENCY)
+ provide_find_module(${PACKAGE_NAME})
+ list(APPEND ARROW_SYSTEM_DEPENDENCIES ${PACKAGE_NAME})
endif()
endmacro()
@@ -865,16 +893,12 @@ else()
endif()
if(ARROW_BOOST_REQUIRED)
- if(BOOST_SOURCE STREQUAL "AUTO")
- find_package(BoostAlt ${ARROW_BOOST_REQUIRED_VERSION})
- if(NOT BoostAlt_FOUND)
- build_boost()
- endif()
- elseif(BOOST_SOURCE STREQUAL "BUNDLED")
- build_boost()
- elseif(BOOST_SOURCE STREQUAL "SYSTEM")
- find_package(BoostAlt ${ARROW_BOOST_REQUIRED_VERSION} REQUIRED)
- endif()
+ resolve_dependency(Boost
+ HAVE_ALT
+ REQUIRED_VERSION
+ ${ARROW_BOOST_REQUIRED_VERSION}
+ IS_RUNTIME_DEPENDENCY
+ ${ARROW_BOOST_REQUIRE_LIBRARY})
if(TARGET Boost::system)
set(BOOST_SYSTEM_LIBRARY Boost::system)
@@ -1208,24 +1232,7 @@ endmacro()
if(ARROW_NEED_GFLAGS)
set(ARROW_GFLAGS_REQUIRED_VERSION "2.1.0")
- if(gflags_SOURCE STREQUAL "AUTO")
- find_package(gflags ${ARROW_GFLAGS_REQUIRED_VERSION} QUIET)
- if(NOT gflags_FOUND)
- find_package(gflagsAlt ${ARROW_GFLAGS_REQUIRED_VERSION})
- endif()
- if(NOT gflags_FOUND AND NOT gflagsAlt_FOUND)
- build_gflags()
- endif()
- elseif(gflags_SOURCE STREQUAL "BUNDLED")
- build_gflags()
- elseif(gflags_SOURCE STREQUAL "SYSTEM")
- # gflagsConfig.cmake is not installed on Ubuntu/Debian
- # TODO: Make a bug report upstream
- find_package(gflags ${ARROW_GFLAGS_REQUIRED_VERSION})
- if(NOT gflags_FOUND)
- find_package(gflagsAlt ${ARROW_GFLAGS_REQUIRED_VERSION} REQUIRED)
- endif()
- endif()
+ resolve_dependency(gflags HAVE_ALT REQUIRED_VERSION
${ARROW_GFLAGS_REQUIRED_VERSION})
# TODO: Don't use global includes but rather target_include_directories
include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR})
@@ -1871,7 +1878,7 @@ if(ARROW_BUILD_BENCHMARKS)
endif()
macro(build_rapidjson)
- message(STATUS "Building rapidjson from source")
+ message(STATUS "Building RapidJSON from source")
set(RAPIDJSON_PREFIX
"${CMAKE_CURRENT_BINARY_DIR}/rapidjson_ep/src/rapidjson_ep-install")
set(RAPIDJSON_CMAKE_ARGS
@@ -1898,36 +1905,8 @@ endmacro()
if(ARROW_WITH_RAPIDJSON)
set(ARROW_RAPIDJSON_REQUIRED_VERSION "1.1.0")
- if(RapidJSON_SOURCE STREQUAL "AUTO")
- # Fedora packages place the package information at the wrong location.
- # https://bugzilla.redhat.com/show_bug.cgi?id=1680400
- find_package(RapidJSON
- ${ARROW_RAPIDJSON_REQUIRED_VERSION}
- QUIET
- HINTS
- "${CMAKE_ROOT}")
- if(RapidJSON_FOUND)
- set(RAPIDJSON_INCLUDE_DIR ${RAPIDJSON_INCLUDE_DIRS})
- else()
- # Ubuntu / Debian don't package the CMake config
- find_package(RapidJSONAlt ${ARROW_RAPIDJSON_REQUIRED_VERSION})
- endif()
- if(NOT RapidJSON_FOUND AND NOT RapidJSONAlt_FOUND)
- build_rapidjson()
- endif()
- elseif(RapidJSON_SOURCE STREQUAL "BUNDLED")
- build_rapidjson()
- elseif(RapidJSON_SOURCE STREQUAL "SYSTEM")
- # Fedora packages place the package information at the wrong location.
- # https://bugzilla.redhat.com/show_bug.cgi?id=1680400
- find_package(RapidJSON ${ARROW_RAPIDJSON_REQUIRED_VERSION} HINTS
"${CMAKE_ROOT}")
- if(RapidJSON_FOUND)
- set(RAPIDJSON_INCLUDE_DIR ${RAPIDJSON_INCLUDE_DIRS})
- else()
- # Ubuntu / Debian don't package the CMake config
- find_package(RapidJSONAlt ${ARROW_RAPIDJSON_REQUIRED_VERSION} REQUIRED)
- endif()
- endif()
+ resolve_dependency(RapidJSON HAVE_ALT REQUIRED_VERSION
+ ${ARROW_RAPIDJSON_REQUIRED_VERSION})
if(RapidJSON_INCLUDE_DIR)
set(RAPIDJSON_INCLUDE_DIR "${RapidJSON_INCLUDE_DIR}")
@@ -2130,7 +2109,7 @@ endif()
# RE2 (required for Gandiva)
macro(build_re2)
- message(STATUS "Building re2 from source")
+ message(STATUS "Building RE2 from source")
set(RE2_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/re2_ep-install")
set(RE2_STATIC_LIB
"${RE2_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}re2${CMAKE_STATIC_LIBRARY_SUFFIX}")
@@ -2145,23 +2124,23 @@ macro(build_re2)
BUILD_BYPRODUCTS "${RE2_STATIC_LIB}")
file(MAKE_DIRECTORY "${RE2_PREFIX}/include")
- add_library(RE2::re2 STATIC IMPORTED)
- set_target_properties(RE2::re2
+ add_library(re2::re2 STATIC IMPORTED)
+ set_target_properties(re2::re2
PROPERTIES IMPORTED_LOCATION "${RE2_STATIC_LIB}"
INTERFACE_INCLUDE_DIRECTORIES
"${RE2_PREFIX}/include")
add_dependencies(toolchain re2_ep)
- add_dependencies(RE2::re2 re2_ep)
+ add_dependencies(re2::re2 re2_ep)
- list(APPEND ARROW_BUNDLED_STATIC_LIBS RE2::re2)
+ list(APPEND ARROW_BUNDLED_STATIC_LIBS re2::re2)
endmacro()
if(ARROW_WITH_RE2)
- resolve_dependency(RE2)
+ resolve_dependency(re2 HAVE_ALT)
add_definitions(-DARROW_WITH_RE2)
# TODO: Don't use global includes but rather target_include_directories
- get_target_property(RE2_INCLUDE_DIR RE2::re2 INTERFACE_INCLUDE_DIRECTORIES)
+ get_target_property(RE2_INCLUDE_DIR re2::re2 INTERFACE_INCLUDE_DIRECTORIES)
include_directories(SYSTEM ${RE2_INCLUDE_DIR})
endif()
@@ -2578,24 +2557,7 @@ endmacro()
if(ARROW_WITH_GRPC)
set(ARROW_GRPC_REQUIRED_VERSION "1.17.0")
- if(gRPC_SOURCE STREQUAL "AUTO")
- find_package(gRPC ${ARROW_GRPC_REQUIRED_VERSION} QUIET)
- if(NOT gRPC_FOUND)
- # Ubuntu doesn't package the CMake config
- find_package(gRPCAlt ${ARROW_GRPC_REQUIRED_VERSION})
- endif()
- if(NOT gRPC_FOUND AND NOT gRPCAlt_FOUND)
- build_grpc()
- endif()
- elseif(gRPC_SOURCE STREQUAL "BUNDLED")
- build_grpc()
- elseif(gRPC_SOURCE STREQUAL "SYSTEM")
- find_package(gRPC ${ARROW_GRPC_REQUIRED_VERSION} QUIET)
- if(NOT gRPC_FOUND)
- # Ubuntu doesn't package the CMake config
- find_package(gRPCAlt ${ARROW_GRPC_REQUIRED_VERSION} REQUIRED)
- endif()
- endif()
+ resolve_dependency(gRPC HAVE_ALT REQUIRED_VERSION
${ARROW_GRPC_REQUIRED_VERSION})
if(TARGET gRPC::address_sorting)
set(GRPC_HAS_ADDRESS_SORTING TRUE)
diff --git a/cpp/src/arrow/flight/client_header_internal.cc
b/cpp/src/arrow/flight/client_header_internal.cc
index 2669b02..3ee0efa 100644
--- a/cpp/src/arrow/flight/client_header_internal.cc
+++ b/cpp/src/arrow/flight/client_header_internal.cc
@@ -28,7 +28,8 @@
#include "arrow/util/uri.h"
#include "arrow/util/value_parsing.h"
-#ifdef _WIN32
+// Mingw-w64 defines strcasecmp in string.h
+#if defined(_WIN32) && !defined(strcasecmp)
#define strcasecmp stricmp
#endif
diff --git a/cpp/src/arrow/flight/customize_protobuf.h
b/cpp/src/arrow/flight/customize_protobuf.h
index c41845c..1508af2 100644
--- a/cpp/src/arrow/flight/customize_protobuf.h
+++ b/cpp/src/arrow/flight/customize_protobuf.h
@@ -36,13 +36,6 @@
#include <grpc++/impl/codegen/config_protobuf.h>
#endif
-// It is necessary to undefined this macro so that the protobuf
-// SerializationTraits specialization is not declared in proto_utils.h. We've
-// copied that specialization below and modified it to exclude
-// protocol::FlightData from the default implementation so we can specialize
-// for our faster serialization-deserialization path
-#undef GRPC_OPEN_SOURCE_PROTO
-
#ifdef GRPCPP_PP_INCLUDE
#include <grpcpp/impl/codegen/proto_utils.h>
#else
@@ -90,38 +83,23 @@ class FlightData;
namespace grpc {
-// This class provides a protobuf serializer. It translates between protobuf
-// objects and grpc_byte_buffers. More information about SerializationTraits
can
-// be found in include/grpcpp/impl/codegen/serialization_traits.h.
-template <class T>
-class SerializationTraits<
- T, typename std::enable_if<
- std::is_base_of<grpc::protobuf::Message, T>::value &&
- !std::is_same<arrow::flight::protocol::FlightData,
T>::value>::type> {
- public:
- static Status Serialize(const grpc::protobuf::Message& msg, ByteBuffer* bb,
- bool* own_buffer) {
- return GenericSerialize<ProtoBufferWriter, T>(msg, bb, own_buffer);
- }
-
- static Status Deserialize(ByteBuffer* buffer, grpc::protobuf::Message* msg) {
- return GenericDeserialize<ProtoBufferReader, T>(buffer, msg);
- }
-};
+template <>
+class SerializationTraits<arrow::flight::protocol::FlightData> {
+#ifdef GRPC_CUSTOM_MESSAGELITE
+ using MessageType = grpc::protobuf::MessageLite;
+#else
+ using MessageType = grpc::protobuf::Message;
+#endif
-template <class T>
-class SerializationTraits<T, typename std::enable_if<std::is_same<
- arrow::flight::protocol::FlightData,
T>::value>::type> {
public:
// In the functions below, we cast back the Message argument to its real
// type (see ReadPayload() and WritePayload() for the initial cast).
- static Status Serialize(const grpc::protobuf::Message& msg, ByteBuffer* bb,
- bool* own_buffer) {
+ static Status Serialize(const MessageType& msg, ByteBuffer* bb, bool*
own_buffer) {
return arrow::flight::internal::FlightDataSerialize(
*reinterpret_cast<const arrow::flight::FlightPayload*>(&msg), bb,
own_buffer);
}
- static Status Deserialize(ByteBuffer* buffer, grpc::protobuf::Message* msg) {
+ static Status Deserialize(ByteBuffer* buffer, MessageType* msg) {
return arrow::flight::internal::FlightDataDeserialize(
buffer, reinterpret_cast<arrow::flight::internal::FlightData*>(msg));
}
diff --git a/cpp/src/gandiva/CMakeLists.txt b/cpp/src/gandiva/CMakeLists.txt
index fb14933..8a19ee5 100644
--- a/cpp/src/gandiva/CMakeLists.txt
+++ b/cpp/src/gandiva/CMakeLists.txt
@@ -89,9 +89,9 @@ set(SRC_FILES
random_generator_holder.cc
${GANDIVA_PRECOMPILED_CC_PATH})
-set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared LLVM::LLVM_INTERFACE
RE2::re2)
+set(GANDIVA_SHARED_PRIVATE_LINK_LIBS arrow_shared LLVM::LLVM_INTERFACE)
-set(GANDIVA_STATIC_LINK_LIBS arrow_static LLVM::LLVM_INTERFACE RE2::re2)
+set(GANDIVA_STATIC_LINK_LIBS arrow_static LLVM::LLVM_INTERFACE)
if(ARROW_GANDIVA_STATIC_LIBSTDCPP
AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX))
@@ -155,9 +155,9 @@ add_dependencies(gandiva ${GANDIVA_LIBRARIES})
arrow_install_all_headers("gandiva")
-set(GANDIVA_STATIC_TEST_LINK_LIBS gandiva_static RE2::re2
${ARROW_TEST_LINK_LIBS})
+set(GANDIVA_STATIC_TEST_LINK_LIBS gandiva_static ${ARROW_TEST_LINK_LIBS})
-set(GANDIVA_SHARED_TEST_LINK_LIBS gandiva_shared RE2::re2
${ARROW_TEST_LINK_LIBS})
+set(GANDIVA_SHARED_TEST_LINK_LIBS gandiva_shared ${ARROW_TEST_LINK_LIBS})
function(ADD_GANDIVA_TEST REL_TEST_NAME)
set(options USE_STATIC_LINKING)
diff --git a/cpp/src/gandiva/precompiled/CMakeLists.txt
b/cpp/src/gandiva/precompiled/CMakeLists.txt
index 59e8e2a..7343bc0 100644
--- a/cpp/src/gandiva/precompiled/CMakeLists.txt
+++ b/cpp/src/gandiva/precompiled/CMakeLists.txt
@@ -128,7 +128,7 @@ if(ARROW_BUILD_TESTS)
../decimal_type_util.cc
../decimal_xlarge.cc)
target_include_directories(gandiva-precompiled-test PRIVATE
${CMAKE_SOURCE_DIR}/src)
- target_link_libraries(gandiva-precompiled-test PRIVATE
${ARROW_TEST_LINK_LIBS} RE2::re2)
+ target_link_libraries(gandiva-precompiled-test PRIVATE
${ARROW_TEST_LINK_LIBS})
target_compile_definitions(gandiva-precompiled-test
PRIVATE
GANDIVA_UNIT_TEST=1
diff --git
a/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/libarrow-dev.install
b/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/libarrow-dev.install
index 84da58c..52fbbb3 100644
---
a/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/libarrow-dev.install
+++
b/dev/tasks/linux-packages/apache-arrow/debian.ubuntu-xenial/libarrow-dev.install
@@ -2,10 +2,10 @@ usr/include/arrow/
usr/lib/*/cmake/arrow/ArrowConfig*.cmake
usr/lib/*/cmake/arrow/ArrowOptions.cmake
usr/lib/*/cmake/arrow/ArrowTargets*.cmake
+usr/lib/*/cmake/arrow/Find*Alt.cmake
usr/lib/*/cmake/arrow/FindArrow.cmake
usr/lib/*/cmake/arrow/FindBrotli.cmake
usr/lib/*/cmake/arrow/FindLz4.cmake
-usr/lib/*/cmake/arrow/FindRE2.cmake
usr/lib/*/cmake/arrow/FindSnappy.cmake
usr/lib/*/cmake/arrow/Findutf8proc.cmake
usr/lib/*/cmake/arrow/Findzstd.cmake
diff --git a/dev/tasks/linux-packages/apache-arrow/debian/libarrow-dev.install
b/dev/tasks/linux-packages/apache-arrow/debian/libarrow-dev.install
index 84da58c..52fbbb3 100644
--- a/dev/tasks/linux-packages/apache-arrow/debian/libarrow-dev.install
+++ b/dev/tasks/linux-packages/apache-arrow/debian/libarrow-dev.install
@@ -2,10 +2,10 @@ usr/include/arrow/
usr/lib/*/cmake/arrow/ArrowConfig*.cmake
usr/lib/*/cmake/arrow/ArrowOptions.cmake
usr/lib/*/cmake/arrow/ArrowTargets*.cmake
+usr/lib/*/cmake/arrow/Find*Alt.cmake
usr/lib/*/cmake/arrow/FindArrow.cmake
usr/lib/*/cmake/arrow/FindBrotli.cmake
usr/lib/*/cmake/arrow/FindLz4.cmake
-usr/lib/*/cmake/arrow/FindRE2.cmake
usr/lib/*/cmake/arrow/FindSnappy.cmake
usr/lib/*/cmake/arrow/Findutf8proc.cmake
usr/lib/*/cmake/arrow/Findzstd.cmake
diff --git a/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in
b/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in
index 0428b3f..3015698 100644
--- a/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in
+++ b/dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in
@@ -262,12 +262,10 @@ Libraries and header files for Apache Arrow C++.
%{_libdir}/cmake/arrow/ArrowConfig*.cmake
%{_libdir}/cmake/arrow/ArrowOptions.cmake
%{_libdir}/cmake/arrow/ArrowTargets*.cmake
+%{_libdir}/cmake/arrow/Find*Alt.cmake
%{_libdir}/cmake/arrow/FindArrow.cmake
%{_libdir}/cmake/arrow/FindBrotli.cmake
%{_libdir}/cmake/arrow/FindLz4.cmake
-%if %{have_re2}
-%{_libdir}/cmake/arrow/FindRE2.cmake
-%endif
%{_libdir}/cmake/arrow/FindSnappy.cmake
%if %{have_utf8proc}
%{_libdir}/cmake/arrow/Findutf8proc.cmake