You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2020/08/16 07:59:31 UTC

[GitHub] [hbase-native-client] bharathv commented on a change in pull request #6: HBASE-23105: Download lib double conversion, fizz, update folly

bharathv commented on a change in pull request #6:
URL: https://github.com/apache/hbase-native-client/pull/6#discussion_r471077497



##########
File path: CMakeLists.txt
##########
@@ -82,16 +84,29 @@ if (DOWNLOAD_DEPENDENCIES)
 	
   set(PROTOBUF_PROTOC_EXECUTABLE "${Protobuf_BINARY_DIR}/bin/protoc" CACHE STRING "" FORCE)
   ## Add CMAKE_MODULE_PATHS
+
+if(NOT APPLE)
+    if(NOT WIN32)

Review comment:
       nit: indentation.

##########
File path: cmake/DownloadBoost.cmake
##########
@@ -26,7 +26,7 @@ function(download_boost SOURCE_DIR BUILD_DIR BOOST_LIBS)
   set(BOOST_INSTALL_DIR "${BUILD_DIR}/dependencies/boost-install")
 
   set(CFLAGS "-fPIC")
-  set(CXXFLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+  set(CXXFLAGS "${CMAKE_CXX_FLAGS} -fPIC -std=c++14")

Review comment:
       These are not inherited from the root CMakeLists?

##########
File path: CMakeLists.txt
##########
@@ -284,23 +304,13 @@ target_link_libraries(hbaseclient-shared ${CMAKE_DL_LIBS})
 add_executable(simple-client "${HBASE_SRC_DIR}/examples/simple-client.cc")
 set_target_properties(simple-client PROPERTIES COMPILE_FLAGS "  ")
 set_target_properties(simple-client PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin/examples")
-target_link_libraries(simple-client ${PROTOBUF_LIBRARY})
-target_link_libraries(simple-client ${Boost_LIBRARIES})
-target_link_libraries(simple-client ${SASL_LIBS})
-target_link_libraries(simple-client ${GFLAGS_SHARED_LIB})
-target_link_libraries(simple-client ${KRB5_LIBRARIES})
-target_link_libraries(simple-client ${ZOOKEEPER_LIBRARIES})
 target_link_libraries(simple-client hbaseclient-static ${CMAKE_THREAD_LIBS_INIT})
+target_link_libraries(simple-client ${WHOLE_ARCHIVE} ${Boost_context} ${NO_WHOLE_ARCHIVE})

Review comment:
       Whats the rationale behind this change?

##########
File path: cmake/patches/fizz.v2020.05.18.00.cmake
##########
@@ -0,0 +1,18 @@
+36c36
+< find_package(folly CONFIG REQUIRED)
+---
+> find_package(Folly  REQUIRED)
+46a47,54
+> 
+> if(NOT APPLE)
+>   if(NOT WIN32)

Review comment:
       Curious whats the story behind this?

##########
File path: cmake/DownloadDoubleConversion.cmake
##########
@@ -0,0 +1,31 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+## Download Double Conversion library. 
+## SOURCE_DIR is typically the cmake source directory
+function(download_doubleconversion SOURCE_DIR BUILD_DIR)
+
+  ExternalProject_Add(
+    doubleconversion-proj
+    PREFIX "${BUILD_DIR}/dependencies"
+    GIT_REPOSITORY "https://github.com/google/double-conversion.git"
+    GIT_TAG "master"

Review comment:
       pin a version? "master" can break things? 

##########
File path: cmake/DownloadFolly.cmake
##########
@@ -17,32 +17,27 @@
 
 ## Download facebook's folly library. 
 ## SOURCE_DIR is typically the cmake source directory
-## BUILD_DIR is the build directory, typically 'build'
-
 function(download_folly SOURCE_DIR BUILD_DIR)
-   
-  if (DOWNLOAD_DEPENDENCIES)
-    # Add custom boost include and lib paths.
-    set(CFLAGS "-fPIC -I${BOOST_ROOT}/include -lboost_context -lboost_coroutine -l${CMAKE_DL_LIBS}")
-    set(CXXFLAGS "${CMAKE_CXX_FLAGS} -fPIC -I${BOOST_ROOT}/include -lboost_context -lboost_coroutine -l${CMAKE_DL_LIBS}")
-    set(LDFLAGS "-L${BOOST_ROOT}/lib")
-    set(CONFIGURE_CMD ./configure --prefix=${BUILD_DIR}/dependencies/facebook-folly-proj-install
-      --with-boost-libdir=${BOOST_ROOT}/lib CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS} LDFLAGS=${LDFLAGS})
-  else()
-    set(CFLAGS "-fPIC -lboost_context -lboost_coroutine -l${CMAKE_DL_LIBS}")
-    set(CXXFLAGS "${CMAKE_CXX_FLAGS} -fPIC -lboost_context -lboost_coroutine -l${CMAKE_DL_LIBS}")
-    set(CONFIGURE_CMD ./configure --prefix=${BUILD_DIR}/dependencies/facebook-folly-proj-install CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS})
-  endif()
 
   ExternalProject_Add(
-      facebook-folly-proj
-      # TODO: Source version information from cmake file.
-      URL "https://github.com/facebook/folly/archive/v2017.09.04.00.tar.gz"
-      PREFIX "${BUILD_DIR}/dependencies"
-      SOURCE_DIR "${BUILD_DIR}/dependencies/facebook-folly-proj-src"
-      BINARY_DIR ${BUILD_DIR}/dependencies/facebook-folly-proj-src/folly
-      CONFIGURE_COMMAND autoreconf -ivf COMMAND ${CONFIGURE_CMD}
-      UPDATE_COMMAND ""
+    facebook-folly-proj
+    PREFIX "${BUILD_DIR}/dependencies"
+    GIT_REPOSITORY "https://github.com/facebook/folly.git"
+    GIT_TAG "v2020.05.18.00"
+    SOURCE_DIR "${BUILD_DIR}/dependencies/facebook-folly-proj-src"
+    PATCH_COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/cmake/doubleconversion/local/FindDoubleConversion.cmake" ${BUILD_DIR}/dependencies/facebook-folly-proj-src/CMake
+          COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/cmake/boost/local/FindBoost.cmake" ${BUILD_DIR}/dependencies/facebook-folly-proj-src/CMake
+    CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}

Review comment:
       Nice.. finally a version that supports cmake.

##########
File path: cmake/DownloadBoost.cmake
##########
@@ -49,4 +49,7 @@ function(download_boost SOURCE_DIR BUILD_DIR BOOST_LIBS)
      INSTALL_COMMAND ""
   )
   set(BOOST_ROOT ${BOOST_INSTALL_DIR} PARENT_SCOPE)
+  set(BOOST_INCLUDEDIR ${BOOST_ROOT}/include PARENT_SCOPE)

Review comment:
       These are also true for system boost libs? 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org