Skip to content

Commit f60bc12

Browse files
lidavidmkou
authored andcommitted
ARROW-13760: [C++] Bump required Protobuf when using Flight
This is to support the FlightSQL proposal in #10906. Closes #11006 from lidavidm/arrow-13760 Authored-by: David Li <li.davidm96@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 27affa3 commit f60bc12

3 files changed

Lines changed: 20 additions & 5 deletions

File tree

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,13 +1371,25 @@ macro(build_protobuf)
13711371
BUILD_COMMAND
13721372
${PROTOBUF_BUILD_COMMAND})
13731373
else()
1374+
# Strip lto flags (which may be added by dh_auto_configure)
1375+
# See https://github.com/protocolbuffers/protobuf/issues/7092
1376+
set(PROTOBUF_C_FLAGS ${EP_C_FLAGS})
1377+
set(PROTOBUF_CXX_FLAGS ${EP_CXX_FLAGS})
1378+
string(REPLACE "-flto=auto" "" PROTOBUF_C_FLAGS "${PROTOBUF_C_FLAGS}")
1379+
string(REPLACE "-ffat-lto-objects" "" PROTOBUF_C_FLAGS "${PROTOBUF_C_FLAGS}")
1380+
string(REPLACE "-flto=auto" "" PROTOBUF_CXX_FLAGS "${PROTOBUF_CXX_FLAGS}")
1381+
string(REPLACE "-ffat-lto-objects" "" PROTOBUF_CXX_FLAGS "${PROTOBUF_CXX_FLAGS}")
13741382
set(PROTOBUF_CMAKE_ARGS
13751383
${EP_COMMON_CMAKE_ARGS}
13761384
-DBUILD_SHARED_LIBS=OFF
13771385
-DCMAKE_INSTALL_LIBDIR=lib
13781386
"-DCMAKE_INSTALL_PREFIX=${PROTOBUF_PREFIX}"
13791387
-Dprotobuf_BUILD_TESTS=OFF
1380-
-Dprotobuf_DEBUG_POSTFIX=)
1388+
-Dprotobuf_DEBUG_POSTFIX=
1389+
"-DCMAKE_C_FLAGS=${PROTOBUF_C_FLAGS}"
1390+
"-DCMAKE_CXX_FLAGS=${PROTOBUF_CXX_FLAGS}"
1391+
"-DCMAKE_C_FLAGS_${UPPERCASE_BUILD_TYPE}=${PROTOBUF_C_FLAGS}"
1392+
"-DCMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}=${PROTOBUF_CXX_FLAGS}")
13811393
if(MSVC AND NOT ARROW_USE_STATIC_CRT)
13821394
list(APPEND PROTOBUF_CMAKE_ARGS "-Dprotobuf_MSVC_STATIC_RUNTIME=OFF")
13831395
endif()
@@ -1420,8 +1432,8 @@ endmacro()
14201432

14211433
if(ARROW_WITH_PROTOBUF)
14221434
if(ARROW_WITH_GRPC)
1423-
# gRPC 1.21.0 or later require Protobuf 3.7.0 or later.
1424-
set(ARROW_PROTOBUF_REQUIRED_VERSION "3.7.0")
1435+
# FlightSQL uses proto3 optionals, which require 3.15 or later.
1436+
set(ARROW_PROTOBUF_REQUIRED_VERSION "3.15.0")
14251437
elseif(ARROW_GANDIVA_JAVA)
14261438
# google::protobuf::MessageLite::ByteSize() is deprecated since
14271439
# Protobuf 3.4.0.

cpp/thirdparty/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ ARROW_MIMALLOC_BUILD_VERSION=v1.7.2
6262
ARROW_MIMALLOC_BUILD_SHA256_CHECKSUM=b1912e354565a4b698410f7583c0f83934a6dbb3ade54ab7ddcb1569320936bd
6363
ARROW_ORC_BUILD_VERSION=1.6.9
6464
ARROW_ORC_BUILD_SHA256_CHECKSUM=2b79f1152454a38abd7b361b407f65689e275f1fb28d4293892e42fbebcc0a9d
65-
ARROW_PROTOBUF_BUILD_VERSION=v3.14.0
66-
ARROW_PROTOBUF_BUILD_SHA256_CHECKSUM=6dd0f6b20094910fbb7f1f7908688df01af2d4f6c5c21331b9f636048674aebf
65+
ARROW_PROTOBUF_BUILD_VERSION=v3.17.3
66+
ARROW_PROTOBUF_BUILD_SHA256_CHECKSUM=77ad26d3f65222fd96ccc18b055632b0bfedf295cb748b712a98ba1ac0b704b2
6767
# Because of https://github.com/Tencent/rapidjson/pull/1323, we require
6868
# a pre-release version of RapidJSON to build with GCC 8 without
6969
# warnings.

docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ services:
449449
<<: *ccache
450450
ARROW_ENABLE_TIMING_TESTS: # inherit
451451
ARROW_MIMALLOC: "ON"
452+
Protobuf_SOURCE: "BUNDLED" # Need Protobuf >= 3.15
452453
volumes: &fedora-volumes
453454
- .:/arrow:delegated
454455
- ${DOCKER_VOLUME_PREFIX}fedora-ccache:/ccache:delegated
@@ -687,6 +688,7 @@ services:
687688
shm_size: *shm-size
688689
environment:
689690
<<: *ccache
691+
Protobuf_SOURCE: "BUNDLED" # Need Protobuf >= 3.15
690692
volumes: *fedora-volumes
691693
command: *python-command
692694

@@ -1353,6 +1355,7 @@ services:
13531355
<<: *ccache
13541356
ARROW_CUDA: "ON"
13551357
ARROW_GLIB_GTK_DOC: "true"
1358+
Protobuf_SOURCE: "BUNDLED" # Need Protobuf >= 3.15
13561359
volumes: *ubuntu-volumes
13571360
command: &docs-command >
13581361
/bin/bash -c "

0 commit comments

Comments
 (0)