This is an automated email from the ASF dual-hosted git repository.
cgivre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git
The following commit(s) were added to refs/heads/master by this push:
new d16e314 DRILL-7727: Fix protobuf warning message
d16e314 is described below
commit d16e3144c4b51dccd322639711ffc8706f4c2e13
Author: Laurent Goujon <[email protected]>
AuthorDate: Wed Apr 29 16:09:50 2020 +0000
DRILL-7727: Fix protobuf warning message
Fix protobuf warning message about the use of ByteSize(), replaced with
ByteSizeLong().
Also add a minimum version requirement to match what is described in the
docs.
---
contrib/native/client/CMakeLists.txt | 11 +++++++++--
contrib/native/client/src/clientlib/rpcMessage.cpp | 6 +++---
contrib/native/client/src/protobuf/CMakeLists.txt | 2 +-
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/contrib/native/client/CMakeLists.txt
b/contrib/native/client/CMakeLists.txt
index c29fba8..ef01d4d 100644
--- a/contrib/native/client/CMakeLists.txt
+++ b/contrib/native/client/CMakeLists.txt
@@ -25,6 +25,13 @@ cmake_policy(SET CMP0043 NEW)
cmake_policy(SET CMP0048 NEW)
enable_testing()
+#
+# required version for dependencies
+#
+set (BOOST_MINIMUM_VERSION 1.54.0)
+set (PROTOBUF_MINIMUM_VERSION 3.6.1)
+
+
set (DRILL_ROOT ${CMAKE_SOURCE_DIR}/../../..)
if (NOT DEFINED DRILL_VERSION)
message("Detecting Drill version:")
@@ -100,7 +107,7 @@ else()
# set(Boost_NAMESPACE drill_boost)
endif()
-find_package(Boost 1.54.0 REQUIRED COMPONENTS regex system date_time chrono
thread random)
+find_package(Boost ${BOOST_MINIMUM_VERSION} REQUIRED COMPONENTS regex system
date_time chrono thread random)
include_directories(${Boost_INCLUDE_DIRS})
@@ -127,7 +134,7 @@ endif()
# Find Protobufs
-find_package(Protobuf REQUIRED )
+find_package(Protobuf ${PROTOBUF_MINIMUM_VERSION} REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIR})
if (MSVC)
diff --git a/contrib/native/client/src/clientlib/rpcMessage.cpp
b/contrib/native/client/src/clientlib/rpcMessage.cpp
index 7bfd6ff..88909d7 100644
--- a/contrib/native/client/src/clientlib/rpcMessage.cpp
+++ b/contrib/native/client/src/clientlib/rpcMessage.cpp
@@ -205,9 +205,9 @@ bool encode(DataBuf& buf, const OutBoundRpcMessage& msg) {
header.set_rpc_type(msg.m_rpc_type);
// calcute the length of the message
- int header_length = header.ByteSize();
- int proto_body_length = msg.m_pbody->ByteSize();
- int full_length = HEADER_TAG_LENGTH +
CodedOutputStream::VarintSize32(header_length) + header_length + \
+ long header_length = header.ByteSizeLong();
+ long proto_body_length = msg.m_pbody->ByteSizeLong();
+ long full_length = HEADER_TAG_LENGTH +
CodedOutputStream::VarintSize32(header_length) + header_length + \
PROTOBUF_BODY_TAG_LENGTH +
CodedOutputStream::VarintSize32(proto_body_length) + proto_body_length;
/*
diff --git a/contrib/native/client/src/protobuf/CMakeLists.txt
b/contrib/native/client/src/protobuf/CMakeLists.txt
index b113234..0ae79db 100644
--- a/contrib/native/client/src/protobuf/CMakeLists.txt
+++ b/contrib/native/client/src/protobuf/CMakeLists.txt
@@ -17,7 +17,7 @@
#
# Find Protobufs
-find_package(Protobuf REQUIRED)
+find_package(Protobuf ${PROTOBUF_MINIMUM_VERSION} REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIR})
#Generate Protobuf code