Skip to content

Commit

Permalink
Step1 use 3rdparty v3 (vesoft-inc#404)
Browse files Browse the repository at this point in the history
* Step1 use 3rdparty v3 (vesoft-inc#3554)

* Switched to use third-party v3

1) Switched from HeaderClientChannel to the RocketChannel
   (common/thrif/ThriftClientManager-inc.h)
2) Fixed a bug in common/process/ProcessUtils.cpp
3) Fixed all UT
4) 99.9% of changes are mechanical: set_xxx(yyy)  ==> xxx_ref() = yyy
5) Only allow empty functions on a single line

* Solved merge conflicts

1) Solved merge conflicts
2) Solved ldap issues

* Fixed lint error

Co-authored-by: Sherman <sherman.ye@vesoft.com>
  • Loading branch information
nebula-bots and sherman-the-tank authored Jan 3, 2022
1 parent a4acc81 commit fe6f62b
Show file tree
Hide file tree
Showing 591 changed files with 11,970 additions and 7,190 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortFunctionsOnASingleLine: Empty
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
Expand Down
36 changes: 36 additions & 0 deletions cmake/FindBerkeleyDB.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# - Try to find BerkeleyDB includes dirs and libraries
#
# Usage of this module as follows:
#
# find_package(BerkeleyDB)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# Variables defined by this module:
#
# Bdb_FOUND System has BerkeleyDB, include and lib dirs found
# Bdb_INCLUDE_DIR The Berkeley includes directories.
# Bdb_LIBRARIES The Berkeley libraries.

# We are not looking for db.h here, in order to avoid conflicts with rocksdb/db.h
find_path(Bdb_INCLUDE_DIR
NAMES db_cxx.h
PATH_SUFFIXES berkeleydb-5.1.29)
find_library(Bdb_LIBRARIES
NAMES db-5.1
PATH_SUFFIXES berkeleydb-5.1.29)

if(Bdb_INCLUDE_DIR AND Bdb_LIBRARIES)
set(Bdb_FOUND TRUE)
mark_as_advanced(
Bdb_INCLUDE_DIR
Bdb_LIBRARIES
)
endif()

if(NOT Bdb_FOUND)
message(FATAL_ERROR "BerkeleyDB doesn't exist")
else()
message(STATUS "Found BerkeleyDB libraries: " ${Bdb_LIBRARIES})
endif()
10 changes: 6 additions & 4 deletions cmake/FindLdap.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@
#
# Ldap_FOUND System has Ldap, include and lib dirs found
# Ldap_INCLUDE_DIR The Ldap includes directories.
# Ldap_LIBRARY The Ldap library.
# Ldap_LIBRARIES The Ldap libraries.

find_path(Ldap_INCLUDE_DIR NAMES ldap.h)
find_library(Ldap_LIBRARY NAMES ldap)
find_library(Ldap_LIBRARIES NAMES ldap lber)

if(Ldap_INCLUDE_DIR AND Ldap_LIBRARY)
if(Ldap_INCLUDE_DIR AND Ldap_LIBRARIES)
set(Ldap_FOUND TRUE)
mark_as_advanced(
Ldap_INCLUDE_DIR
Ldap_LIBRARY
Ldap_LIBRARIES
)
endif()

if(NOT Ldap_FOUND)
message(FATAL_ERROR "Ldap doesn't exist")
else()
message(STATUS "Found LDAP libraries: " ${Ldap_LIBRARIES})
endif()
33 changes: 33 additions & 0 deletions cmake/FindSasl.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# - Try to find Sasl includes dirs and libraries
#
# Usage of this module as follows:
#
# find_package(Sasl)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# Variables defined by this module:
#
# Sasl_FOUND System has Sasl, include and lib dirs found
# Sasl_INCLUDE_DIR The Sasl includes directories.
# Sasl_LIBRARIES The Sasl libraries.

find_path(Sasl_INCLUDE_DIR
NAMES sasl.h
PATH_SUFFIXES sasl)
find_library(Sasl_LIBRARIES NAMES sasl2)

if(Sasl_INCLUDE_DIR AND Sasl_LIBRARIES)
set(Sasl_FOUND TRUE)
mark_as_advanced(
Sasl_INCLUDE_DIR
Sasl_LIBRARIES
)
endif()

if(NOT Sasl_FOUND)
message(FATAL_ERROR "Sasl doesn't exist")
else()
message(STATUS "Found Sasl libraries: " ${Sasl_LIBRARIES})
endif()
2 changes: 1 addition & 1 deletion cmake/nebula/GeneralCMakeOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ option(ENABLE_TESTING "Build unit tests" ON)
option(ENABLE_CCACHE "Use ccache to speed up compiling" ON)
option(ENABLE_WERROR "Regard warnings as errors" ON)
option(ENABLE_JEMALLOC "Use jemalloc as memory allocator" ON)
option(ENABLE_LDAP "Enable ldap" OFF)
option(ENABLE_LDAP "Enable ldap" ON)
option(ENABLE_ASAN "Build with AddressSanitizer" OFF)
option(ENABLE_UBSAN "Build with UndefinedBehaviourSanitizer" OFF)
option(ENABLE_TSAN "Build with ThreadSanitizer" OFF)
Expand Down
3 changes: 3 additions & 0 deletions cmake/nebula/NebulaCMakeMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ macro(nebula_link_libraries target)
boost_program_options
event
ldap
lber
${Sasl_LIBRARIES}
${Bdb_LIBRARIES}
double-conversion
s2
${OPENSSL_SSL_LIBRARY}
Expand Down
9 changes: 5 additions & 4 deletions cmake/nebula/ThirdPartyConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ message(">>>> Configuring third party for '${PROJECT_NAME}' <<<<")
# 4. /opt/vesoft/third-party, if exists
# 5. At last, one copy will be downloaded and installed to ${CMAKE_BINARY_DIR}/third-party/install

set(NEBULA_THIRDPARTY_VERSION "2.0")
set(NEBULA_THIRDPARTY_VERSION "3.0")

if(${DISABLE_CXX11_ABI})
SET(NEBULA_THIRDPARTY_ROOT ${CMAKE_BINARY_DIR}/third-party-98/install)
Expand Down Expand Up @@ -91,6 +91,8 @@ if(ENABLE_JEMALLOC)
endif()
if(ENABLE_LDAP)
find_package(Ldap REQUIRED)
find_package(Sasl REQUIRED)
find_package(BerkeleyDB REQUIRED)
endif()
find_package(Libevent REQUIRED)
find_package(Proxygen REQUIRED)
Expand All @@ -113,13 +115,12 @@ if (${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "x86_64")
find_package(Breakpad REQUIRED)
endif()

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L ${NEBULA_THIRDPARTY_ROOT}/lib")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L ${NEBULA_THIRDPARTY_ROOT}/lib64")
set(CMAKE_EXE_LINKER_FLAGS "-L ${NEBULA_THIRDPARTY_ROOT}/lib ${CMAKE_EXE_LINKER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "-L ${NEBULA_THIRDPARTY_ROOT}/lib64 ${CMAKE_EXE_LINKER_FLAGS}")

# All thrift libraries
set(THRIFT_LIBRARIES
thriftcpp2
rocketupgrade
async
thriftprotocol
transport
Expand Down
Loading

0 comments on commit fe6f62b

Please sign in to comment.