mirror of https://gitee.com/bigwinds/arangodb
more cleanup
This commit is contained in:
parent
2f3fe0feea
commit
4b2b85f1b5
584
CMakeLists.txt
584
CMakeLists.txt
|
@ -10,16 +10,6 @@ if (POLICY CMP0037)
|
|||
cmake_policy(SET CMP0037 NEW)
|
||||
endif ()
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE RelWithDebInfo
|
||||
CACHE string
|
||||
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
|
||||
FORCE
|
||||
)
|
||||
endif ()
|
||||
|
||||
project(ArangoDB)
|
||||
|
||||
if (APPLE)
|
||||
if (NOT DEFINED CMAKE_C_COMPILER)
|
||||
set(CMAKE_C_COMPILER /usr/bin/clang)
|
||||
|
@ -30,6 +20,16 @@ if (APPLE)
|
|||
endif ()
|
||||
endif ()
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE RelWithDebInfo
|
||||
CACHE string
|
||||
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
|
||||
FORCE
|
||||
)
|
||||
endif ()
|
||||
|
||||
project(ArangoDB)
|
||||
|
||||
# where to find CMAKE modules
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
|
||||
|
||||
|
@ -285,17 +285,7 @@ if (SOLARIS)
|
|||
endif ()
|
||||
|
||||
math(EXPR BITS "8*${CMAKE_SIZEOF_VOID_P}")
|
||||
add_definitions("-DTRI_BITS=${BITS}")
|
||||
|
||||
################################################################################
|
||||
## TCMALLOC
|
||||
################################################################################
|
||||
|
||||
set(USE_TCMALLOC, TRUE)
|
||||
|
||||
if (WINDOWS OR SOLARIS)
|
||||
set(USE_TCMALLOC, FALSE)
|
||||
endif ()
|
||||
add_definitions("-DARANGODB_BITS=${BITS}")
|
||||
|
||||
################################################################################
|
||||
# BUILD TYPES
|
||||
|
@ -361,7 +351,7 @@ if (USE_BACKTRACE)
|
|||
set(BT_LIBS "" CACHE path "Debug Helper libraries")
|
||||
endif ()
|
||||
|
||||
add_definitions("-DHAVE_BACKTRACE=1")
|
||||
add_definitions("-DARANGODB_ENABLE_BACKTRACE=1")
|
||||
else ()
|
||||
set(BT_LIBS "" CACHE path "Debug Helper libraries")
|
||||
endif ()
|
||||
|
@ -376,7 +366,7 @@ option(USE_MAINTAINER_MODE
|
|||
)
|
||||
|
||||
if (USE_MAINTAINER_MODE)
|
||||
add_definitions("-DTRI_ENABLE_MAINTAINER_MODE=1")
|
||||
add_definitions("-DARANGODB_ENABLE_MAINTAINER_MODE=1")
|
||||
endif ()
|
||||
|
||||
################################################################################
|
||||
|
@ -389,7 +379,7 @@ option(USE_FAILURE_TESTS
|
|||
)
|
||||
|
||||
if (USE_FAILURE_TESTS)
|
||||
add_definitions("-DTRI_ENABLE_FAILURE_TESTS=1")
|
||||
add_definitions("-DARANGODB_ENABLE_FAILURE_TESTS=1")
|
||||
endif ()
|
||||
|
||||
################################################################################
|
||||
|
@ -445,6 +435,20 @@ if (OPENSSL_VERSION)
|
|||
endif ()
|
||||
endif ()
|
||||
|
||||
################################################################################
|
||||
## TCMALLOC
|
||||
################################################################################
|
||||
|
||||
set(USE_TCMALLOC, TRUE)
|
||||
|
||||
if (WINDOWS OR SOLARIS)
|
||||
set(USE_TCMALLOC, FALSE)
|
||||
endif ()
|
||||
|
||||
if (USE_TCMALLOC)
|
||||
find_package(tcmalloc)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
## 3RD PARTY
|
||||
################################################################################
|
||||
|
@ -496,269 +500,11 @@ add_definitions("-DARANGODB_V8_VERSION=\"${V8_VERSION}\"")
|
|||
|
||||
include_directories(${ICU_INCLUDE_DIR})
|
||||
|
||||
################################################################################
|
||||
##
|
||||
################################################################################
|
||||
|
||||
################################################################################
|
||||
## PATHS
|
||||
################################################################################
|
||||
|
||||
option(USE_RELATIVE
|
||||
"Do you want to have all path are relative to the binary"
|
||||
OFF
|
||||
)
|
||||
|
||||
if (USE_RELATIVE)
|
||||
|
||||
# /etc -------------------------------
|
||||
set(ETCDIR_NATIVE "./etc/relative")
|
||||
set(ETCDIR_INSTALL "etc/relative")
|
||||
|
||||
# etcd -------------------------------
|
||||
file(TO_NATIVE_PATH "${ETCDIR_NATIVE}" ETCDIR_NATIVE)
|
||||
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ETCDIR_ESCAPED "${ETCDIR_NATIVE}")
|
||||
|
||||
# /var -------------------------------
|
||||
set(VARDIR ""
|
||||
CACHE path
|
||||
"System configuration directory (defaults to prefix/var/arangodb)"
|
||||
)
|
||||
|
||||
if (VARDIR STREQUAL "")
|
||||
set(VARDIR_NATIVE "${CMAKE_INSTALL_PREFIX}/var")
|
||||
set(VARDIR_INSTALL "var")
|
||||
else ()
|
||||
set(VARDIR_NATIVE "${VARDIR}")
|
||||
set(VARDIR_INSTALL "${VARDIR}")
|
||||
endif ()
|
||||
|
||||
file(TO_NATIVE_PATH "${VARDIR_NATIVE}" VARDIR_NATIVE)
|
||||
|
||||
# database
|
||||
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/lib/arangodb")
|
||||
|
||||
# apps
|
||||
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/lib/arangodb-apps")
|
||||
|
||||
# logs
|
||||
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/log/arangodb")
|
||||
|
||||
# tri_package
|
||||
set(TRI_PKGDATADIR "${CMAKE_INSTALL_PREFIX}/share/arangodb")
|
||||
|
||||
# resources
|
||||
set(TRI_RESOURCEDIR "resources")
|
||||
|
||||
# bin dir ----------------------------
|
||||
set(ARANGODB_INSTALL_BIN "bin")
|
||||
set(TRI_BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
|
||||
# MS stuff ---------------------------
|
||||
if (MSVC)
|
||||
set(ARANGODB_INSTALL_SBIN "bin")
|
||||
set(TRI_SBINDIR "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
else ()
|
||||
set(ARANGODB_INSTALL_SBIN "sbin")
|
||||
set(TRI_SBINDIR "${CMAKE_INSTALL_PREFIX}/sbin")
|
||||
endif ()
|
||||
|
||||
add_definitions("-D_SYSCONFDIR_=\"${ETCDIR_ESCAPED}\"")
|
||||
else ()
|
||||
# etcd -------------------------------
|
||||
set(ETCDIR "" CACHE path "System configuration directory (defaults to prefix/etc)")
|
||||
|
||||
# /etc -------------------------------
|
||||
if (ETCDIR STREQUAL "")
|
||||
set(ETCDIR_NATIVE "${CMAKE_INSTALL_PREFIX}/etc/arangodb")
|
||||
set(ETCDIR_INSTALL "etc/arangodb")
|
||||
else ()
|
||||
set(ETCDIR_NATIVE "${ETCDIR}/arangodb")
|
||||
set(ETCDIR_INSTALL "${ETCDIR}/arangodb")
|
||||
endif ()
|
||||
|
||||
# MS stuff ---------------------------
|
||||
if (MSVC)
|
||||
file(TO_NATIVE_PATH "${ETCDIR_INSTALL}" ETCDIR_INSTALL)
|
||||
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ETCDIR_ESCAPED "${ETCDIR_INSTALL}")
|
||||
else ()
|
||||
file(TO_NATIVE_PATH "${ETCDIR_NATIVE}" ETCDIR_NATIVE)
|
||||
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ETCDIR_ESCAPED "${ETCDIR_NATIVE}")
|
||||
endif ()
|
||||
|
||||
add_definitions("-D_SYSCONFDIR_=\"${ETCDIR_ESCAPED}\"")
|
||||
|
||||
# /var
|
||||
set(VARDIR ""
|
||||
CACHE path
|
||||
"System configuration directory (defaults to prefix/var/arangodb)"
|
||||
)
|
||||
|
||||
if (VARDIR STREQUAL "")
|
||||
set(VARDIR_NATIVE "${CMAKE_INSTALL_PREFIX}/var")
|
||||
set(VARDIR_INSTALL "var")
|
||||
else ()
|
||||
set(VARDIR_NATIVE "${VARDIR}")
|
||||
set(VARDIR_INSTALL "${VARDIR}")
|
||||
endif ()
|
||||
|
||||
file(TO_NATIVE_PATH "${VARDIR_NATIVE}" VARDIR_NATIVE)
|
||||
|
||||
# database directory
|
||||
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/lib/arangodb")
|
||||
|
||||
# apps
|
||||
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/lib/arangodb-apps")
|
||||
|
||||
# logs
|
||||
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/log/arangodb")
|
||||
|
||||
# package
|
||||
set(TRI_PKGDATADIR "${CMAKE_INSTALL_PREFIX}/share/arangodb")
|
||||
|
||||
# resources
|
||||
set(TRI_RESOURCEDIR "resources")
|
||||
|
||||
# binaries
|
||||
if (MSVC)
|
||||
set(ARANGODB_INSTALL_BIN "bin")
|
||||
set(TRI_BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
else ()
|
||||
set(ARANGODB_INSTALL_BIN "bin")
|
||||
set(TRI_BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
endif ()
|
||||
|
||||
# sbinaries
|
||||
if (MSVC)
|
||||
set(ARANGODB_INSTALL_SBIN "bin")
|
||||
set(TRI_SBINDIR "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
else ()
|
||||
set(ARANGODB_INSTALL_SBIN "sbin")
|
||||
set(TRI_SBINDIR "${CMAKE_INSTALL_PREFIX}/sbin")
|
||||
endif ()
|
||||
endif (USE_RELATIVE)
|
||||
|
||||
# MS Windows -------------------------------------------------------------------
|
||||
if (MSVC)
|
||||
# icon paths
|
||||
file(TO_NATIVE_PATH
|
||||
"${TRI_RESOURCEDIR}/Icons/arangodb.ico"
|
||||
RELATIVE_ARANGO_ICON
|
||||
)
|
||||
|
||||
file(TO_NATIVE_PATH
|
||||
"${PROJECT_SOURCE_DIR}/Installation/Windows/Icons/arangodb.bmp"
|
||||
ARANGO_IMG
|
||||
)
|
||||
|
||||
file(TO_NATIVE_PATH
|
||||
"${PROJECT_SOURCE_DIR}/Installation/Windows/Icons/arangodb.ico"
|
||||
ARANGO_ICON
|
||||
)
|
||||
|
||||
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ARANGO_IMG "${ARANGO_IMG}")
|
||||
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ARANGO_ICON "${ARANGO_ICON}")
|
||||
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" RELATIVE_ARANGO_ICON "${RELATIVE_ARANGO_ICON}")
|
||||
|
||||
# versioning
|
||||
set(CMAKE_MODULE_PATH
|
||||
${CMAKE_MODULE_PATH}
|
||||
${PROJECT_SOURCE_DIR}/Installation/Windows/version
|
||||
)
|
||||
|
||||
include("${PROJECT_SOURCE_DIR}/Installation/Windows/version/generate_product_version.cmake")
|
||||
endif ()
|
||||
|
||||
################################################################################
|
||||
## INSTALL
|
||||
################################################################################
|
||||
|
||||
if (NOT WINDOWS)
|
||||
install(
|
||||
PROGRAMS ${PROJECT_SOURCE_DIR}/bin/etcd-arango
|
||||
DESTINATION ${ARANGODB_INSTALL_BIN}
|
||||
)
|
||||
endif ()
|
||||
|
||||
# Global macros ----------------------------------------------------------------
|
||||
macro (generate_root_config name)
|
||||
FILE(READ ${PROJECT_SOURCE_DIR}/etc/arangodb/${name}.conf.in FileContent)
|
||||
STRING(REPLACE "@PKGDATADIR@" "@ROOTDIR@/share/arangodb"
|
||||
FileContent "${FileContent}")
|
||||
STRING(REPLACE "@LOCALSTATEDIR@" "@ROOTDIR@/var"
|
||||
FileContent "${FileContent}")
|
||||
STRING(REPLACE "@SBINDIR@" "@ROOTDIR@/bin"
|
||||
FileContent "${FileContent}")
|
||||
STRING(REPLACE "@LIBEXECDIR@/arangodb" "@ROOTDIR@/bin"
|
||||
FileContent "${FileContent}")
|
||||
STRING(REPLACE "@SYSCONFDIR@" "@ROOTDIR@/etc/arangodb"
|
||||
FileContent "${FileContent}")
|
||||
if (MSVC)
|
||||
STRING(REPLACE "@PROGRAM_SUFFIX@" ".exe"
|
||||
FileContent "${FileContent}")
|
||||
STRING(REGEX REPLACE "[\r\n]file =" "\n# file ="
|
||||
FileContent "${FileContent}")
|
||||
endif ()
|
||||
FILE(WRITE ${PROJECT_BINARY_DIR}/etc/arangodb/${name}.conf "${FileContent}")
|
||||
endmacro ()
|
||||
|
||||
# generates config file using the configured paths ----------------------------
|
||||
macro (generate_path_config name)
|
||||
FILE(READ ${PROJECT_SOURCE_DIR}/etc/arangodb/${name}.conf.in FileContent)
|
||||
STRING(REPLACE "@PKGDATADIR@" "${TRI_PKGDATADIR}"
|
||||
FileContent "${FileContent}")
|
||||
STRING(REPLACE "@LOCALSTATEDIR@" "${VARDIR_NATIVE}"
|
||||
FileContent "${FileContent}")
|
||||
FILE(WRITE ${PROJECT_BINARY_DIR}/etc/arangodb/${name}.conf "${FileContent}")
|
||||
endmacro ()
|
||||
|
||||
# installs a config file -------------------------------------------------------
|
||||
macro (install_config name)
|
||||
if (MSVC OR DARWIN)
|
||||
generate_root_config(${name})
|
||||
else ()
|
||||
generate_path_config(${name})
|
||||
endif ()
|
||||
install(
|
||||
FILES ${PROJECT_BINARY_DIR}/etc/arangodb/${name}.conf
|
||||
DESTINATION ${ETCDIR_INSTALL})
|
||||
endmacro ()
|
||||
|
||||
# installs a readme file converting EOL ----------------------------------------
|
||||
macro (install_readme input where output)
|
||||
FILE(READ ${PROJECT_SOURCE_DIR}/${input} FileContent)
|
||||
STRING(REPLACE "\r" "" FileContent "${FileContent}")
|
||||
if (MSVC)
|
||||
STRING(REPLACE "\n" "\r\n" FileContent "${FileContent}")
|
||||
endif ()
|
||||
FILE(WRITE ${PROJECT_BINARY_DIR}/${output} "${FileContent}")
|
||||
install(
|
||||
FILES ${PROJECT_BINARY_DIR}/${output}
|
||||
DESTINATION ${where})
|
||||
endmacro ()
|
||||
|
||||
# installs a link to an executable ---------------------------------------------
|
||||
macro (install_command_alias name where alias)
|
||||
if (MSVC)
|
||||
add_custom_command(
|
||||
TARGET ${name}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${name}>
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${alias}.exe)
|
||||
install(
|
||||
PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${alias}.exe
|
||||
DESTINATION ${where})
|
||||
else ()
|
||||
add_custom_command(
|
||||
TARGET ${name}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink ${name}
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${alias})
|
||||
install(
|
||||
PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${alias}
|
||||
DESTINATION ${where})
|
||||
endif ()
|
||||
endmacro ()
|
||||
include(ArangoDBMacros)
|
||||
|
||||
################################################################################
|
||||
## SUB-PROJECTS
|
||||
|
@ -768,275 +514,3 @@ add_subdirectory(lib)
|
|||
add_subdirectory(arangosh)
|
||||
add_subdirectory(arangod)
|
||||
add_subdirectory(UnitTests)
|
||||
|
||||
get_cmake_property(_variableNames VARIABLES)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# ICU ---------------------------------------------------------------------------
|
||||
# V8 ----------------------------------------------------------------------------
|
||||
|
||||
# Boost ------------------------------------------------------------------------
|
||||
|
||||
# Tcmalloc ---------------------------------------------------------------------
|
||||
if (USE_TCMALLOC)
|
||||
find_package(tcmalloc)
|
||||
endif()
|
||||
|
||||
# sub directories --------------------------------------------------------------
|
||||
|
||||
#if(BUILD_STATIC_EXECUTABLES)
|
||||
# set(CMAKE_EXE_LINKER_FLAGS -static)
|
||||
# set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
|
||||
# set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS) # remove -Wl,-Bdynamic
|
||||
# set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
|
||||
# set(CMAKE_SHARED_LIBRARY_C_FLAGS) # remove -fPIC
|
||||
# set(CMAKE_SHARED_LIBRARY_CXX_FLAGS)
|
||||
# set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) # remove -rdynamic
|
||||
# set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
|
||||
# # Maybe this works as well, haven't tried yet.
|
||||
# # set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
|
||||
#else(BUILD_STATIC_EXECUTABLES)
|
||||
# # Set RPATH to use for installed targets; append linker search path
|
||||
# set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LOFAR_LIBDIR}")
|
||||
# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
#endif(BUILD_STATIC_EXECUTABLES)
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#get_cmake_property(_variableNames VARIABLES)
|
||||
#foreach (_variableName ${_variableNames})
|
||||
# message(STATUS "${_variableName}=${${_variableName}}")
|
||||
#endforeach ()
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
# install ----------------------------------------------------------------------
|
||||
install(DIRECTORY ${PROJECT_SOURCE_DIR}/Documentation/man/
|
||||
DESTINATION share/man)
|
||||
|
||||
if (MSVC)
|
||||
install_readme(README . README.txt)
|
||||
install_readme(README.md . README.md)
|
||||
install_readme(README.windows . README.windows.txt)
|
||||
endif ()
|
||||
|
||||
if (MSVC)
|
||||
install_readme(LICENSE . LICENSE.txt)
|
||||
install_readme(LICENSES-OTHER-COMPONENTS.md . LICENSES-OTHER-COMPONENTS.md)
|
||||
else ()
|
||||
install_readme(README share/doc/arangodb README)
|
||||
install_readme(README.md share/doc/arangodb README.md)
|
||||
install_readme(LICENSE share/doc/arangodb LICENSE)
|
||||
install_readme(LICENSES-OTHER-COMPONENTS.md share/doc/arangodb LICENSES-OTHER-COMPONENTS.md)
|
||||
endif ()
|
||||
|
||||
# Build package ----------------------------------------------------------------
|
||||
# Posible options are:
|
||||
# - dmg-cli: Mac OS X shell client application
|
||||
# - debian: debian package
|
||||
set(BUILD_PACKAGE "unknown" CACHE path "Package type to build")
|
||||
|
||||
# OSX
|
||||
if (BUILD_PACKAGE STREQUAL "dmg-cli")
|
||||
option(DARWIN "Building for MacOS" ON)
|
||||
else ()
|
||||
option(DARWIN "Building for MacOS" OFF)
|
||||
endif ()
|
||||
|
||||
# Windows
|
||||
if (MSVC)
|
||||
else ()
|
||||
set(CPACK_SET_DESTDIR ON)
|
||||
endif ()
|
||||
|
||||
# General
|
||||
set(CPACK_PACKAGE_VENDOR "ArangoDB GmbH")
|
||||
set(CPACK_PACKAGE_CONTACT "info@arangodb.org")
|
||||
set(CPACK_PACKAGE_VERSION "${ARANGODB_VERSION}")
|
||||
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||
|
||||
set(CPACK_STRIP_FILES "ON")
|
||||
|
||||
if (DARWIN)
|
||||
set(CPACK_PACKAGE_NAME "ArangoDB-CLI")
|
||||
elseif (BUILD_PACKAGE STREQUAL "debian")
|
||||
set(CPACK_PACKAGE_NAME "arangodb")
|
||||
elseif (MSVC)
|
||||
set(CPACK_PACKAGE_NAME "ArangoDB")
|
||||
endif ()
|
||||
|
||||
# debian
|
||||
if (BUILD_PACKAGE STREQUAL "debian")
|
||||
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "database")
|
||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
|
||||
"${PROJECT_SOURCE_DIR}/Installation/Debian/postinst;${PROJECT_SOURCE_DIR}/Installation/Debian/preinst;${PROJECT_SOURCE_DIR}/Installation/Debian/postrm;${PROJECT_SOURCE_DIR}/Installation/Debian/prerm;")
|
||||
|
||||
install(
|
||||
FILES ${PROJECT_SOURCE_DIR}/Installation/Debian/rc.arangodb
|
||||
PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
DESTINATION /etc/init.d
|
||||
RENAME arangodb)
|
||||
|
||||
install(
|
||||
CODE
|
||||
"EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/share/arangodb/js/apps)")
|
||||
|
||||
install(
|
||||
CODE
|
||||
"EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink /var/lib/arangodb-apps \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/share/arangodb/js/apps/databases)")
|
||||
endif ()
|
||||
|
||||
# OSX bundle
|
||||
if (DARWIN)
|
||||
set(CPACK_BUNDLE_NAME "${CPACK_PACKAGE_NAME}")
|
||||
set(CPACK_BUNDLE_PLIST "${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/Info.plist")
|
||||
set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/icon.icns")
|
||||
set(CPACK_BUNDLE_STARTUP_COMMAND "${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/arangodb-cli.sh")
|
||||
endif ()
|
||||
|
||||
# MS installer
|
||||
if (MSVC)
|
||||
set(CPACK_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Installation/Windows/Templates")
|
||||
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL 1)
|
||||
set(BITS 64)
|
||||
|
||||
if (CMAKE_CL_64)
|
||||
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
|
||||
SET(BITS 64)
|
||||
else ()
|
||||
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
|
||||
SET(BITS 32)
|
||||
endif ()
|
||||
|
||||
message(STATUS "ARANGO_IMG: ${ARANGO_IMG}")
|
||||
message(STATUS "ARANGO_ICON: ${ARANGO_ICON}")
|
||||
message(STATUS "RELATIVE_ARANGO_ICON: ${RELATIVE_ARANGO_ICON}")
|
||||
|
||||
install(
|
||||
DIRECTORY "${PROJECT_SOURCE_DIR}/Installation/Windows/Icons"
|
||||
DESTINATION ${TRI_RESOURCEDIR})
|
||||
|
||||
set(CPACK_NSIS_DEFINES "
|
||||
!define BITS ${BITS}
|
||||
!define TRI_FRIENDLY_SVC_NAME '${ARANGODB_FRIENDLY_STRING}'
|
||||
!define TRI_AARDVARK_URL 'http://127.0.0.1:8529'
|
||||
")
|
||||
|
||||
set(CPACK_PACKAGE_ICON ${ARANGO_ICON})
|
||||
|
||||
set(CPACK_NSIS_MODIFY_PATH ON)
|
||||
set(CPACK_NSIS_MUI_ICON ${ARANGO_ICON})
|
||||
set(CPACK_NSIS_MUI_UNIICON ${ARANGO_ICON})
|
||||
set(CPACK_NSIS_INSTALLED_ICON_NAME ${RELATIVE_ARANGO_ICON})
|
||||
set(CPACK_NSIS_DISPLAY_NAME, ${ARANGODB_DISPLAY_NAME})
|
||||
set(CPACK_NSIS_HELP_LINK ${ARANGODB_HELP_LINK})
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT ${ARANGODB_URL_INFO_ABOUT})
|
||||
set(CPACK_NSIS_CONTACT ${ARANGODB_CONTACT})
|
||||
|
||||
# etcd
|
||||
if (CMAKE_CL_64)
|
||||
install(PROGRAMS WindowsLibraries/64/bin/etcd-arango.exe
|
||||
DESTINATION ${ARANGODB_INSTALL_SBIN})
|
||||
|
||||
install(FILES WindowsLibraries/64/icudtl.dat
|
||||
DESTINATION share/arangodb
|
||||
RENAME icudt54l.dat)
|
||||
else ()
|
||||
install(PROGRAMS WindowsLibraries/32/bin/etcd-arango.exe
|
||||
DESTINATION ${ARANGODB_INSTALL_SBIN})
|
||||
|
||||
install(FILES WindowsLibraries/32/icudtl.dat
|
||||
DESTINATION share/arangodb
|
||||
RENAME icudt54l.dat)
|
||||
endif ()
|
||||
|
||||
endif ()
|
||||
|
||||
|
||||
# Custom targets ----------------------------------------------------------------
|
||||
|
||||
# swagger
|
||||
add_custom_target (swagger
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
${PROJECT_SOURCE_DIR}/Documentation/Scripts/generateSwagger.py
|
||||
${PROJECT_SOURCE_DIR}
|
||||
${PROJECT_SOURCE_DIR}/js/apps/system/_admin/aardvark/APP/api-docs api-docs
|
||||
${PROJECT_SOURCE_DIR}/Documentation/DocuBlocks/Rest/
|
||||
> ${PROJECT_SOURCE_DIR}/js/apps/system/_admin/aardvark/APP/api-docs.json)
|
||||
|
||||
# love
|
||||
add_custom_target (love
|
||||
COMMENT "ArangoDB loves you."
|
||||
COMMAND ""
|
||||
)
|
||||
|
||||
|
||||
# Finally: user cpack
|
||||
include(CPack)
|
||||
|
||||
|
||||
################################################################################
|
||||
### @brief install client-side JavaScript files
|
||||
################################################################################
|
||||
|
||||
install(
|
||||
DIRECTORY ${PROJECT_SOURCE_DIR}/js/common ${PROJECT_SOURCE_DIR}/js/client
|
||||
DESTINATION share/arangodb/js
|
||||
FILES_MATCHING PATTERN "*.js"
|
||||
REGEX "^.*/common/test-data$" EXCLUDE
|
||||
REGEX "^.*/common/tests$" EXCLUDE
|
||||
REGEX "^.*/client/tests$" EXCLUDE)
|
||||
|
||||
## -----------------------------------------------------------------------------
|
||||
## --SECTION-- END-OF-FILE
|
||||
## -----------------------------------------------------------------------------
|
||||
|
||||
## Local Variables:
|
||||
## mode: outline-minor
|
||||
## outline-regexp: "^\\(### @brief\\|## --SECTION--\\|# -\\*- \\)"
|
||||
## End:
|
||||
|
||||
################################################################################
|
||||
### @brief install server-side JavaScript files
|
||||
################################################################################
|
||||
|
||||
install(
|
||||
DIRECTORY ${PROJECT_BINARY_DIR}/js
|
||||
DESTINATION share/arangodb)
|
||||
|
||||
################################################################################
|
||||
### @brief install log directory
|
||||
################################################################################
|
||||
|
||||
install(
|
||||
DIRECTORY ${PROJECT_BINARY_DIR}/var/log/arangodb
|
||||
DESTINATION ${VARDIR_INSTALL}/log)
|
||||
|
||||
################################################################################
|
||||
### @brief install database directory
|
||||
################################################################################
|
||||
|
||||
install(
|
||||
DIRECTORY ${PROJECT_BINARY_DIR}/var/lib/arangodb
|
||||
DESTINATION ${VARDIR_INSTALL}/lib)
|
||||
|
||||
################################################################################
|
||||
### @brief install apps directory
|
||||
################################################################################
|
||||
|
||||
install(
|
||||
DIRECTORY ${PROJECT_BINARY_DIR}/var/lib/arangodb-apps
|
||||
DESTINATION ${VARDIR_INSTALL}/lib)
|
||||
|
||||
## -----------------------------------------------------------------------------
|
||||
## --SECTION-- END-OF-FILE
|
||||
## -----------------------------------------------------------------------------
|
||||
|
||||
## Local Variables:
|
||||
## mode: outline-minor
|
||||
## outline-regexp: "### @brief\\|## --SECTION--\\|# -\\*- "
|
||||
## End:
|
||||
|
|
|
@ -41,7 +41,7 @@ if (USE_BOOST_UNITTESTS)
|
|||
${ICU_LIBS}
|
||||
${OPENSSL_LIBRARIES}
|
||||
${ZLIB_LIBS}
|
||||
${Boost_UNIT_TESTS_LIBRARIES}
|
||||
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${CMAKE_DL_LIBS}
|
||||
${SYSTEM_LIBRARIES}
|
||||
|
@ -66,7 +66,7 @@ if (USE_BOOST_UNITTESTS)
|
|||
${OPENSSL_LIBRARIES}
|
||||
${ZLIB_LIBS}
|
||||
${Boost_LIBRARIES}
|
||||
${Boost_UNIT_TESTS_LIBRARIES}
|
||||
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${CMAKE_DL_LIBS}
|
||||
${SYSTEM_LIBRARIES}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include "Basics/StringBuffer.h"
|
||||
#include "Basics/Utf8Helper.h"
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
|
@ -911,7 +911,7 @@ uint64_t AstNode::hashValue(uint64_t hash) const {
|
|||
/// @brief dump the node (for debugging purposes)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
void AstNode::dump(int level) const {
|
||||
for (int i = 0; i < level; ++i) {
|
||||
std::cout << " ";
|
||||
|
|
|
@ -286,7 +286,7 @@ struct AstNode {
|
|||
/// @brief dump the node (for debugging purposes)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
void dump(int) const;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -640,7 +640,7 @@ void Condition::normalize(ExecutionPlan* plan) {
|
|||
|
||||
optimize(plan);
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
if (_root != nullptr) {
|
||||
// _root->dump(0);
|
||||
validateAst(_root, 0);
|
||||
|
@ -664,7 +664,7 @@ void Condition::normalize() {
|
|||
_root = transformNode(_root);
|
||||
_root = fixRoot(_root, 0);
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
if (_root != nullptr) {
|
||||
// _root->dump(0);
|
||||
validateAst(_root, 0);
|
||||
|
@ -1369,7 +1369,7 @@ void Condition::storeAttributeAccess(VariableUsageType& variableUsage,
|
|||
/// @brief validate the condition's AST
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
void Condition::validateAst(AstNode const* node, int level) {
|
||||
if (level == 0) {
|
||||
TRI_ASSERT(node->type == NODE_TYPE_OPERATOR_NARY_OR);
|
||||
|
|
|
@ -333,7 +333,7 @@ class Condition {
|
|||
/// @brief validate the condition's AST
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
void validateAst(AstNode const*, int);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -566,7 +566,7 @@ void ExecutionNode::invalidateCost() {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool ExecutionNode::walk(WalkerWorker<ExecutionNode>* worker) {
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
// Only do every node exactly once
|
||||
// note: this check is not required normally because execution
|
||||
// plans do not contain cycles
|
||||
|
|
|
@ -1919,7 +1919,7 @@ bool ExecutionPlan::isDeadSimple() const {
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ class ExecutionPlan {
|
|||
/// @brief show an overview over the plan
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
void show();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -224,7 +224,7 @@ static void RegisterInvalidArgumentWarning(arangodb::aql::Query* query,
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static TRI_json_t* SafeCopyJson(TRI_json_t const* src) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_ASSERT(src != nullptr);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ AqlValue V8Expression::execute(v8::Isolate* isolate, Query* query,
|
|||
// won't modify their arguments is unsafe
|
||||
auto constantValues = v8::Local<v8::Object>::New(isolate, _constantValues);
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
// a hash function for hashing V8 object contents
|
||||
auto hasher =
|
||||
[](v8::Isolate* isolate, v8::Handle<v8::Value> const obj) -> uint64_t {
|
||||
|
@ -155,7 +155,7 @@ AqlValue V8Expression::execute(v8::Isolate* isolate, Query* query,
|
|||
auto func = v8::Local<v8::Function>::New(isolate, _func);
|
||||
result = func->Call(func, 3, args);
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
// now that the V8 function call is finished, check that our
|
||||
// constants actually were not modified
|
||||
uint64_t cmpHash = hasher(isolate, constantValues);
|
||||
|
|
|
@ -54,7 +54,7 @@ class WalkerWorker {
|
|||
T* // sub
|
||||
) {}
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
|
||||
bool done(T* en) {
|
||||
// make sure a node is only processed once
|
||||
|
@ -81,7 +81,7 @@ class WalkerWorker {
|
|||
#endif
|
||||
|
||||
private:
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
std::unordered_set<T*> _done;
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -295,8 +295,8 @@ ClusterCommResult const ClusterComm::asyncRequest(
|
|||
}
|
||||
|
||||
#ifdef DEBUG_CLUSTER_COMM
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#if HAVE_BACKTRACE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#if ARANGODB_ENABLE_BACKTRACE
|
||||
std::string bt;
|
||||
TRI_GetBacktrace(bt);
|
||||
std::replace(bt.begin(), bt.end(), '\n', ';'); // replace all '\n' to ';'
|
||||
|
@ -424,8 +424,8 @@ std::unique_ptr<ClusterCommResult> ClusterComm::syncRequest(
|
|||
|
||||
headersCopy["Authorization"] = ServerState::instance()->getAuthentication();
|
||||
#ifdef DEBUG_CLUSTER_COMM
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#if HAVE_BACKTRACE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#if ARANGODB_ENABLE_BACKTRACE
|
||||
std::string bt;
|
||||
TRI_GetBacktrace(bt);
|
||||
std::replace(bt.begin(), bt.end(), '\n', ';'); // replace all '\n' to ';'
|
||||
|
|
|
@ -828,7 +828,7 @@ void ArangoServer::defineHandlers(HttpHandlerFactory* factory) {
|
|||
RestHandlerCreator<WorkMonitorHandler>::createNoData, nullptr);
|
||||
|
||||
// This handler is to activate SYS_DEBUG_FAILAT on DB servers
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
factory->addPrefixHandler("/_admin/debug",
|
||||
RestHandlerCreator<RestDebugHandler>::createNoData,
|
||||
nullptr);
|
||||
|
|
|
@ -455,7 +455,7 @@ static void WINAPI ServiceCtrl(DWORD dwCtrlCode) {
|
|||
|
||||
#include <DbgHelp.h>
|
||||
LONG CALLBACK unhandledExceptionHandler(EXCEPTION_POINTERS* e) {
|
||||
#if HAVE_BACKTRACE
|
||||
#if ARANGODB_ENABLE_BACKTRACE
|
||||
|
||||
if ((e != nullptr) && (e->ExceptionRecord != nullptr)) {
|
||||
LOG_FATAL_WINDOWS("Unhandled exception: %d",
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "RestServer/ArangoServer.h"
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
|
@ -107,7 +107,7 @@ int main(int argc, char* argv[]) {
|
|||
// caught an error during shutdown
|
||||
res = EXIT_FAILURE;
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
std::cerr << "Caught an exception during shutdown" << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ static void ProcessRequestStatistics(TRI_request_statistics_t* statistics) {
|
|||
statistics->reset();
|
||||
|
||||
// put statistics item back onto the freelist
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
bool ok = RequestFreeList.push(statistics);
|
||||
TRI_ASSERT(ok);
|
||||
#else
|
||||
|
@ -154,7 +154,7 @@ void TRI_ReleaseRequestStatistics(TRI_request_statistics_t* statistics) {
|
|||
}
|
||||
|
||||
if (!statistics->_ignore) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
bool ok = RequestFinishedList.push(statistics);
|
||||
TRI_ASSERT(ok);
|
||||
#else
|
||||
|
@ -163,7 +163,7 @@ void TRI_ReleaseRequestStatistics(TRI_request_statistics_t* statistics) {
|
|||
} else {
|
||||
statistics->reset();
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
bool ok = RequestFreeList.push(statistics);
|
||||
TRI_ASSERT(ok);
|
||||
#else
|
||||
|
@ -250,7 +250,7 @@ void TRI_ReleaseConnectionStatistics(TRI_connection_statistics_t* statistics) {
|
|||
statistics->reset();
|
||||
|
||||
// put statistics item back onto the freelist
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
bool ok = ConnectionFreeList.push(statistics);
|
||||
TRI_ASSERT(ok);
|
||||
#else
|
||||
|
@ -525,7 +525,7 @@ void TRI_InitializeStatistics() {
|
|||
|
||||
for (size_t i = 0; i < QUEUE_SIZE; ++i) {
|
||||
auto entry = new TRI_request_statistics_t;
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
bool ok = RequestFreeList.push(entry);
|
||||
TRI_ASSERT(ok);
|
||||
#else
|
||||
|
@ -539,7 +539,7 @@ void TRI_InitializeStatistics() {
|
|||
|
||||
for (size_t i = 0; i < QUEUE_SIZE; ++i) {
|
||||
auto entry = new TRI_connection_statistics_t;
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
bool ok = ConnectionFreeList.push(entry);
|
||||
TRI_ASSERT(ok);
|
||||
#else
|
||||
|
|
|
@ -106,7 +106,7 @@ class SingleCollectionWriteTransaction : public SingleCollectionTransaction {
|
|||
bool forceSync) {
|
||||
TRI_ASSERT(json != nullptr);
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
if (_numWrites++ > N) {
|
||||
return TRI_ERROR_TRANSACTION_INTERNAL;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ class SingleCollectionWriteTransaction : public SingleCollectionTransaction {
|
|||
|
||||
int createDocument(TRI_doc_mptr_copy_t* mptr, VPackSlice const& slice,
|
||||
bool forceSync) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
if (_numWrites++ > N) {
|
||||
return TRI_ERROR_TRANSACTION_INTERNAL;
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ class SingleCollectionWriteTransaction : public SingleCollectionTransaction {
|
|||
bool forceSync, void const* data) {
|
||||
TRI_ASSERT(json != nullptr);
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
if (_numWrites++ > N) {
|
||||
return TRI_ERROR_TRANSACTION_INTERNAL;
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ class SingleCollectionWriteTransaction : public SingleCollectionTransaction {
|
|||
|
||||
int createEdge(TRI_doc_mptr_copy_t* mptr, VPackSlice const& slice,
|
||||
bool forceSync, void const* data) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
if (_numWrites++ > N) {
|
||||
return TRI_ERROR_TRANSACTION_INTERNAL;
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ class SingleCollectionWriteTransaction : public SingleCollectionTransaction {
|
|||
|
||||
int createDocument(TRI_voc_key_t key, TRI_doc_mptr_copy_t* mptr,
|
||||
TRI_shaped_json_t const* shaped, bool forceSync) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
if (_numWrites++ > N) {
|
||||
return TRI_ERROR_TRANSACTION_INTERNAL;
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ class SingleCollectionWriteTransaction : public SingleCollectionTransaction {
|
|||
int createEdge(TRI_voc_key_t key, TRI_doc_mptr_copy_t* mptr,
|
||||
TRI_shaped_json_t const* shaped, bool forceSync,
|
||||
void const* data) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
if (_numWrites++ > N) {
|
||||
return TRI_ERROR_TRANSACTION_INTERNAL;
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ class SingleCollectionWriteTransaction : public SingleCollectionTransaction {
|
|||
TRI_voc_rid_t* actualRevision) {
|
||||
TRI_ASSERT(json != nullptr);
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
if (_numWrites++ > N) {
|
||||
return TRI_ERROR_TRANSACTION_INTERNAL;
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ class SingleCollectionWriteTransaction : public SingleCollectionTransaction {
|
|||
TRI_doc_update_policy_e policy, bool forceSync,
|
||||
TRI_voc_rid_t expectedRevision,
|
||||
TRI_voc_rid_t* actualRevision) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
if (_numWrites++ > N) {
|
||||
return TRI_ERROR_TRANSACTION_INTERNAL;
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ class SingleCollectionWriteTransaction : public SingleCollectionTransaction {
|
|||
int deleteDocument(std::string const& key, TRI_doc_update_policy_e policy,
|
||||
bool forceSync, TRI_voc_rid_t expectedRevision,
|
||||
TRI_voc_rid_t* actualRevision) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
if (_numWrites++ > N) {
|
||||
return TRI_ERROR_TRANSACTION_INTERNAL;
|
||||
}
|
||||
|
@ -294,7 +294,7 @@ class SingleCollectionWriteTransaction : public SingleCollectionTransaction {
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int truncate(bool forceSync) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
if (_numWrites++ > N) {
|
||||
return TRI_ERROR_TRANSACTION_INTERNAL;
|
||||
}
|
||||
|
|
|
@ -1268,7 +1268,7 @@ void TRI_InitV8Actions(v8::Isolate* isolate, v8::Handle<v8::Context> context,
|
|||
/// Below Debugging Functions. Only compiled in maintainer mode.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
static bool clusterSendToAllServers(
|
||||
std::string const& dbname,
|
||||
std::string const& path, // Note: Has to be properly encoded!
|
||||
|
@ -1317,7 +1317,7 @@ static bool clusterSendToAllServers(
|
|||
/// intentionally cause a segmentation violation
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
static void JS_DebugSegfault(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
||||
TRI_V8_TRY_CATCH_BEGIN(isolate);
|
||||
v8::HandleScope scope(isolate);
|
||||
|
@ -1346,7 +1346,7 @@ static void JS_DebugSegfault(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
/// Set a point for an intentional system failure
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
static void JS_DebugSetFailAt(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
||||
TRI_V8_TRY_CATCH_BEGIN(isolate);
|
||||
v8::HandleScope scope(isolate);
|
||||
|
@ -1389,7 +1389,7 @@ static void JS_DebugSetFailAt(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
/// Remove a point for an intentional system failure
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
static void JS_DebugRemoveFailAt(
|
||||
v8::FunctionCallbackInfo<v8::Value> const& args) {
|
||||
TRI_V8_TRY_CATCH_BEGIN(isolate);
|
||||
|
@ -1444,7 +1444,7 @@ static void JS_DebugClearFailAt(
|
|||
}
|
||||
|
||||
// if failure testing is not enabled, this is a no-op
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
TRI_ClearFailurePointsDebugging();
|
||||
|
||||
if (ServerState::instance()->isCoordinator()) {
|
||||
|
@ -1476,7 +1476,7 @@ void TRI_InitV8DebugUtils(v8::Isolate* isolate, v8::Handle<v8::Context> context,
|
|||
TRI_AddGlobalFunctionVocbase(isolate, context,
|
||||
TRI_V8_ASCII_STRING("SYS_DEBUG_CLEAR_FAILAT"),
|
||||
JS_DebugClearFailAt);
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
TRI_AddGlobalFunctionVocbase(isolate, context,
|
||||
TRI_V8_ASCII_STRING("SYS_DEBUG_SEGFAULT"),
|
||||
JS_DebugSegfault);
|
||||
|
|
|
@ -121,7 +121,7 @@ static void WeakCollectionCallback(const v8::WeakCallbackData<
|
|||
TRI_ReleaseVocBase(collection->_vocbase);
|
||||
|
||||
// find the persistent handle
|
||||
#if TRI_ENABLE_MAINTAINER_MODE
|
||||
#if ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
auto const& it = v8g->JSCollections.find(collection);
|
||||
TRI_ASSERT(it != v8g->JSCollections.end());
|
||||
#endif
|
||||
|
|
|
@ -3480,7 +3480,7 @@ static void JS_VersionVocbaseCol(
|
|||
/// @brief checks all data pointers in a collection
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
static void JS_CheckPointersVocbaseCol(
|
||||
v8::FunctionCallbackInfo<v8::Value> const& args) {
|
||||
TRI_V8_TRY_CATCH_BEGIN(isolate);
|
||||
|
@ -4062,7 +4062,7 @@ void TRI_InitV8collection(v8::Handle<v8::Context> context, TRI_server_t* server,
|
|||
rt = ft->InstanceTemplate();
|
||||
rt->SetInternalFieldCount(3);
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING("checkPointers"),
|
||||
JS_CheckPointersVocbaseCol);
|
||||
#endif
|
||||
|
|
|
@ -796,7 +796,7 @@ static void PropertyQueryShapedJson(
|
|||
|
||||
if (sid == TRI_SHAPE_ILLEGAL) {
|
||||
// invalid shape
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(WARN) << "invalid shape id '" << sid << "' found for key '" << key.c_str() << "'";
|
||||
#endif
|
||||
TRI_V8_RETURN(v8::Handle<v8::Integer>());
|
||||
|
|
|
@ -106,7 +106,7 @@ static inline std::string TRI_EXTRACT_MARKER_KEY(
|
|||
return slice.get(TRI_VOC_ATTRIBUTE_KEY).copyString();
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
// invalid marker type
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -138,7 +138,7 @@ static inline TRI_voc_rid_t TRI_EXTRACT_MARKER_RID(
|
|||
return arangodb::velocypack::readUInt64(value.start() + 1);
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
// invalid marker type
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -177,7 +177,7 @@ static inline bool TRI_MATCHES_MARKER_KEY(arangodb::Transaction* trx,
|
|||
return (memcmp(p, key, len) == 0);
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
// invalid marker type
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -214,7 +214,7 @@ static inline bool TRI_MATCHES_MARKER_KEY(arangodb::Transaction* trx,
|
|||
return (memcmp(p, q, llen) == 0);
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
// invalid marker type
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
|
|
@ -865,7 +865,7 @@ int VocShaper::insertShape(TRI_df_marker_t const* marker,
|
|||
LOG(TRACE) << "found duplicate shape markers for id " << l->_sid << " in collection '" << name.c_str() << "' in shape dictionary";
|
||||
} else {
|
||||
LOG(ERR) << "found heterogenous shape markers for id " << l->_sid << " in collection '" << name.c_str() << "' in shape dictionary";
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
}
|
||||
|
@ -885,7 +885,7 @@ int VocShaper::insertShape(TRI_df_marker_t const* marker,
|
|||
LOG(TRACE) << "found duplicate shape markers for id " << l->_sid << " in collection '" << name.c_str() << "' in shape ids table";
|
||||
} else {
|
||||
LOG(ERR) << "found heterogenous shape markers for id " << l->_sid << " in collection '" << name.c_str() << "' in shape ids table";
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
}
|
||||
|
@ -1040,14 +1040,14 @@ bool VocShaper::extractShapedJson(TRI_shaped_json_t const* document,
|
|||
TRI_shape_access_t const* accessor = findAccessor(document->_sid, pid);
|
||||
|
||||
if (accessor == nullptr) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(TRACE) << "failed to get accessor for sid " << document->_sid << " and path " << pid;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
if (accessor->_resultSid == TRI_SHAPE_ILLEGAL) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(TRACE) << "expecting any object for path " << pid << ", got nothing";
|
||||
#endif
|
||||
*shape = nullptr;
|
||||
|
@ -1058,7 +1058,7 @@ bool VocShaper::extractShapedJson(TRI_shaped_json_t const* document,
|
|||
*shape = lookupShapeId(accessor->_resultSid);
|
||||
|
||||
if (*shape == nullptr) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(TRACE) << "expecting any object for path " << pid << ", got unknown shape id " << accessor->_resultSid;
|
||||
#endif
|
||||
*shape = nullptr;
|
||||
|
@ -1067,7 +1067,7 @@ bool VocShaper::extractShapedJson(TRI_shaped_json_t const* document,
|
|||
}
|
||||
|
||||
if (sid != 0 && sid != accessor->_resultSid) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(TRACE) << "expecting sid " << sid << " for path " << pid << ", got sid " << accessor->_resultSid;
|
||||
#endif
|
||||
return false;
|
||||
|
@ -1076,7 +1076,7 @@ bool VocShaper::extractShapedJson(TRI_shaped_json_t const* document,
|
|||
bool ok = TRI_ExecuteShapeAccessor(accessor, document, result);
|
||||
|
||||
if (!ok) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(TRACE) << "failed to get accessor for sid " << document->_sid << " and path " << pid;
|
||||
#endif
|
||||
return false;
|
||||
|
|
|
@ -637,7 +637,7 @@ arangodb::Index* TRI_document_collection_t::lookupIndex(
|
|||
/// @brief return a pointer to the shaper
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
VocShaper* TRI_document_collection_t::getShaper() const {
|
||||
if (!_ditches.contains(arangodb::Ditch::TRI_DITCH_DOCUMENT)) {
|
||||
}
|
||||
|
@ -1355,7 +1355,7 @@ static int OpenIteratorApplyInsert(open_iterator_state_t* state,
|
|||
|
||||
SetRevision(document, d->_rid, false);
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
|
||||
#if 0
|
||||
// currently disabled because it is too chatty in trace mode
|
||||
|
@ -1510,7 +1510,7 @@ static int OpenIteratorApplyRemove(open_iterator_state_t* state,
|
|||
|
||||
TRI_voc_key_t key = ((char*)d) + d->_offsetKey;
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(TRACE) << "deletion: fid " << operation->_fid << ", key " << (char*)key << ", rid " << d->_rid << ", deletion " << marker->_tick;
|
||||
#endif
|
||||
|
||||
|
@ -3134,7 +3134,7 @@ static int FillIndexSequential(arangodb::Transaction* trx,
|
|||
idx->sizeHint(trx, nrUsed);
|
||||
|
||||
if (nrUsed > 0) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
static int const LoopSize = 10000;
|
||||
int counter = 0;
|
||||
int loops = 0;
|
||||
|
@ -3156,7 +3156,7 @@ static int FillIndexSequential(arangodb::Transaction* trx,
|
|||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
return res;
|
||||
}
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
if (++counter == LoopSize) {
|
||||
counter = 0;
|
||||
++loops;
|
||||
|
|
|
@ -251,7 +251,7 @@ struct TRI_document_collection_t : public TRI_collection_t {
|
|||
arangodb::DatafileStatistics _datafileStatistics;
|
||||
|
||||
// We do some assertions with barriers and transactions in maintainer mode:
|
||||
#ifndef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifndef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
VocShaper* getShaper() const { return _shaper; }
|
||||
#else
|
||||
VocShaper* getShaper() const;
|
||||
|
@ -485,7 +485,7 @@ static inline char const* TRI_EXTRACT_MARKER_FROM_KEY(
|
|||
((arangodb::wal::edge_marker_t const*)marker)->_offsetFromKey;
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
// invalid marker type
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -518,7 +518,7 @@ static inline char const* TRI_EXTRACT_MARKER_TO_KEY(
|
|||
((arangodb::wal::edge_marker_t const*)marker)->_offsetToKey;
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
// invalid marker type
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -549,7 +549,7 @@ static inline TRI_voc_cid_t TRI_EXTRACT_MARKER_FROM_CID(
|
|||
return ((arangodb::wal::edge_marker_t const*)marker)->_fromCid;
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
// invalid marker type
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -580,7 +580,7 @@ static inline TRI_voc_cid_t TRI_EXTRACT_MARKER_TO_CID(
|
|||
return ((arangodb::wal::edge_marker_t const*)marker)->_toCid;
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
// invalid marker type
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -613,7 +613,7 @@ static inline TRI_voc_rid_t TRI_EXTRACT_MARKER_RID(
|
|||
return ((arangodb::wal::document_marker_t const*)marker)->_revisionId;
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
// invalid marker type
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -647,7 +647,7 @@ static inline char const* TRI_EXTRACT_MARKER_KEY(
|
|||
((arangodb::wal::document_marker_t const*)marker)->_offsetKey;
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
// invalid marker type
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
|
|
@ -50,7 +50,7 @@ static bool BytecodeShapeAccessor(VocShaper* shaper,
|
|||
|
||||
if (shape == nullptr) {
|
||||
LOG(ERR) << "unknown shape id " << accessor->_sid;
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
return false;
|
||||
|
@ -70,7 +70,7 @@ static bool BytecodeShapeAccessor(VocShaper* shaper,
|
|||
|
||||
if (path == nullptr) {
|
||||
LOG(ERR) << "unknown attribute path " << accessor->_pid;
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
return false;
|
||||
|
|
|
@ -2094,7 +2094,7 @@ TRI_shaped_json_t* TRI_ShapedJsonJson(VocShaper* shaper, TRI_json_t const* json,
|
|||
|
||||
TRI_json_t* TRI_JsonShapedJson(VocShaper* shaper,
|
||||
TRI_shaped_json_t const* shaped) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_ASSERT(shaped != nullptr);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#include "Wal/LogfileManager.h"
|
||||
#include "Utils/Transaction.h"
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
|
||||
#define LOG_TRX(trx, level) \
|
||||
LOG(TRACE) << "trx #" << trx->_id << "." << level << " (" << StatusTransaction(trx->_status) << "): "
|
||||
|
@ -142,7 +142,7 @@ void ClearQueryCache(TRI_transaction_t* trx) {
|
|||
/// @brief return the status of the transaction as a string
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
static char const* StatusTransaction(const TRI_transaction_status_e status) {
|
||||
switch (status) {
|
||||
case TRI_TRANSACTION_UNDEFINED:
|
||||
|
|
|
@ -2172,7 +2172,7 @@ void TRI_ReleaseVocBase(TRI_vocbase_t* vocbase) {
|
|||
// decrease the reference counter by 2.
|
||||
// this is because we use odd values to indicate that the database has been
|
||||
// marked as deleted
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
auto oldValue = vocbase->_refCount.fetch_sub(2, std::memory_order_release);
|
||||
TRI_ASSERT(oldValue >= 2);
|
||||
#else
|
||||
|
|
|
@ -151,7 +151,7 @@ extern bool IGNORE_DATAFILE_ERRORS;
|
|||
/// file sizes in maintainer mode)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
|
||||
#define TRI_JOURNAL_MINIMAL_SIZE (16 * 1024)
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ static inline uint64_t MinSyncInterval() { return 5; }
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static inline uint32_t MinFileSize() {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
// this allows testing with smaller logfile-sizes
|
||||
return 1 * 1024 * 1024;
|
||||
#else
|
||||
|
@ -762,7 +762,7 @@ SlotInfo LogfileManager::allocate(uint32_t size, TRI_voc_cid_t cid,
|
|||
void*& oldLegend) {
|
||||
if (!_allowWrites) {
|
||||
// no writes allowed
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
||||
|
@ -2178,7 +2178,7 @@ int LogfileManager::inspectLogfiles() {
|
|||
|
||||
WRITE_LOCKER(writeLocker, _logfilesLock);
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
// print an inventory
|
||||
for (auto it = _logfiles.begin(); it != _logfiles.end(); ++it) {
|
||||
Logfile* logfile = (*it).second;
|
||||
|
|
|
@ -556,7 +556,7 @@ bool RecoverState::ReplayMarker(TRI_df_marker_t const* marker, void* data,
|
|||
TRI_datafile_t* datafile) {
|
||||
RecoverState* state = reinterpret_cast<RecoverState*>(data);
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
LOG(TRACE) << "replaying marker of type " << TRI_NameMarkerDatafile(marker);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -285,7 +285,7 @@ class BenchmarkThread : public arangodb::Thread {
|
|||
_warningCount++;
|
||||
if (_warningCount < MaxWarnings) {
|
||||
LOG(WARN) << "batch operation failed with HTTP code " << result->getHttpReturnCode() << " - " << result->getHttpReturnMessage().c_str() << " ";
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(WARN) << "We tried to send this size:\n " << batchPayload.length();
|
||||
LOG(WARN) << "We tried to send this:\n " << batchPayload.c_str();
|
||||
#endif
|
||||
|
@ -306,7 +306,7 @@ class BenchmarkThread : public arangodb::Thread {
|
|||
LOG(WARN) << "Server side warning count: " << errorCount;
|
||||
if (_verbose) {
|
||||
LOG(WARN) << "Server reply: " << result->getBody().c_str();
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(WARN) << "We tried to send this size:\n " << batchPayload.length();
|
||||
LOG(WARN) << "We tried to send this:\n " << batchPayload.c_str();
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,511 @@
|
|||
option(USE_RELATIVE
|
||||
"Do you want to have all path are relative to the binary"
|
||||
OFF
|
||||
)
|
||||
|
||||
if (USE_RELATIVE)
|
||||
|
||||
# /etc -------------------------------
|
||||
set(ETCDIR_NATIVE "./etc/relative")
|
||||
set(ETCDIR_INSTALL "etc/relative")
|
||||
|
||||
# etcd -------------------------------
|
||||
file(TO_NATIVE_PATH "${ETCDIR_NATIVE}" ETCDIR_NATIVE)
|
||||
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ETCDIR_ESCAPED "${ETCDIR_NATIVE}")
|
||||
|
||||
# /var -------------------------------
|
||||
set(VARDIR ""
|
||||
CACHE path
|
||||
"System configuration directory (defaults to prefix/var/arangodb)"
|
||||
)
|
||||
|
||||
if (VARDIR STREQUAL "")
|
||||
set(VARDIR_NATIVE "${CMAKE_INSTALL_PREFIX}/var")
|
||||
set(VARDIR_INSTALL "var")
|
||||
else ()
|
||||
set(VARDIR_NATIVE "${VARDIR}")
|
||||
set(VARDIR_INSTALL "${VARDIR}")
|
||||
endif ()
|
||||
|
||||
file(TO_NATIVE_PATH "${VARDIR_NATIVE}" VARDIR_NATIVE)
|
||||
|
||||
# database
|
||||
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/lib/arangodb")
|
||||
|
||||
# apps
|
||||
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/lib/arangodb-apps")
|
||||
|
||||
# logs
|
||||
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/log/arangodb")
|
||||
|
||||
# tri_package
|
||||
set(TRI_PKGDATADIR "${CMAKE_INSTALL_PREFIX}/share/arangodb")
|
||||
|
||||
# resources
|
||||
set(TRI_RESOURCEDIR "resources")
|
||||
|
||||
# bin dir ----------------------------
|
||||
set(ARANGODB_INSTALL_BIN "bin")
|
||||
set(TRI_BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
|
||||
# MS stuff ---------------------------
|
||||
if (MSVC)
|
||||
set(ARANGODB_INSTALL_SBIN "bin")
|
||||
set(TRI_SBINDIR "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
else ()
|
||||
set(ARANGODB_INSTALL_SBIN "sbin")
|
||||
set(TRI_SBINDIR "${CMAKE_INSTALL_PREFIX}/sbin")
|
||||
endif ()
|
||||
|
||||
add_definitions("-D_SYSCONFDIR_=\"${ETCDIR_ESCAPED}\"")
|
||||
else ()
|
||||
# etcd -------------------------------
|
||||
set(ETCDIR "" CACHE path "System configuration directory (defaults to prefix/etc)")
|
||||
|
||||
# /etc -------------------------------
|
||||
if (ETCDIR STREQUAL "")
|
||||
set(ETCDIR_NATIVE "${CMAKE_INSTALL_PREFIX}/etc/arangodb")
|
||||
set(ETCDIR_INSTALL "etc/arangodb")
|
||||
else ()
|
||||
set(ETCDIR_NATIVE "${ETCDIR}/arangodb")
|
||||
set(ETCDIR_INSTALL "${ETCDIR}/arangodb")
|
||||
endif ()
|
||||
|
||||
# MS stuff ---------------------------
|
||||
if (MSVC)
|
||||
file(TO_NATIVE_PATH "${ETCDIR_INSTALL}" ETCDIR_INSTALL)
|
||||
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ETCDIR_ESCAPED "${ETCDIR_INSTALL}")
|
||||
else ()
|
||||
file(TO_NATIVE_PATH "${ETCDIR_NATIVE}" ETCDIR_NATIVE)
|
||||
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ETCDIR_ESCAPED "${ETCDIR_NATIVE}")
|
||||
endif ()
|
||||
|
||||
add_definitions("-D_SYSCONFDIR_=\"${ETCDIR_ESCAPED}\"")
|
||||
|
||||
# /var
|
||||
set(VARDIR ""
|
||||
CACHE path
|
||||
"System configuration directory (defaults to prefix/var/arangodb)"
|
||||
)
|
||||
|
||||
if (VARDIR STREQUAL "")
|
||||
set(VARDIR_NATIVE "${CMAKE_INSTALL_PREFIX}/var")
|
||||
set(VARDIR_INSTALL "var")
|
||||
else ()
|
||||
set(VARDIR_NATIVE "${VARDIR}")
|
||||
set(VARDIR_INSTALL "${VARDIR}")
|
||||
endif ()
|
||||
|
||||
file(TO_NATIVE_PATH "${VARDIR_NATIVE}" VARDIR_NATIVE)
|
||||
|
||||
# database directory
|
||||
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/lib/arangodb")
|
||||
|
||||
# apps
|
||||
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/lib/arangodb-apps")
|
||||
|
||||
# logs
|
||||
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/log/arangodb")
|
||||
|
||||
# package
|
||||
set(TRI_PKGDATADIR "${CMAKE_INSTALL_PREFIX}/share/arangodb")
|
||||
|
||||
# resources
|
||||
set(TRI_RESOURCEDIR "resources")
|
||||
|
||||
# binaries
|
||||
if (MSVC)
|
||||
set(ARANGODB_INSTALL_BIN "bin")
|
||||
set(TRI_BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
else ()
|
||||
set(ARANGODB_INSTALL_BIN "bin")
|
||||
set(TRI_BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
endif ()
|
||||
|
||||
# sbinaries
|
||||
if (MSVC)
|
||||
set(ARANGODB_INSTALL_SBIN "bin")
|
||||
set(TRI_SBINDIR "${CMAKE_INSTALL_PREFIX}/bin")
|
||||
else ()
|
||||
set(ARANGODB_INSTALL_SBIN "sbin")
|
||||
set(TRI_SBINDIR "${CMAKE_INSTALL_PREFIX}/sbin")
|
||||
endif ()
|
||||
endif (USE_RELATIVE)
|
||||
|
||||
# MS Windows -------------------------------------------------------------------
|
||||
if (MSVC)
|
||||
# icon paths
|
||||
file(TO_NATIVE_PATH
|
||||
"${TRI_RESOURCEDIR}/Icons/arangodb.ico"
|
||||
RELATIVE_ARANGO_ICON
|
||||
)
|
||||
|
||||
file(TO_NATIVE_PATH
|
||||
"${PROJECT_SOURCE_DIR}/Installation/Windows/Icons/arangodb.bmp"
|
||||
ARANGO_IMG
|
||||
)
|
||||
|
||||
file(TO_NATIVE_PATH
|
||||
"${PROJECT_SOURCE_DIR}/Installation/Windows/Icons/arangodb.ico"
|
||||
ARANGO_ICON
|
||||
)
|
||||
|
||||
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ARANGO_IMG "${ARANGO_IMG}")
|
||||
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ARANGO_ICON "${ARANGO_ICON}")
|
||||
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" RELATIVE_ARANGO_ICON "${RELATIVE_ARANGO_ICON}")
|
||||
|
||||
# versioning
|
||||
set(CMAKE_MODULE_PATH
|
||||
${CMAKE_MODULE_PATH}
|
||||
${PROJECT_SOURCE_DIR}/Installation/Windows/version
|
||||
)
|
||||
|
||||
include("${PROJECT_SOURCE_DIR}/Installation/Windows/version/generate_product_version.cmake")
|
||||
endif ()
|
||||
|
||||
################################################################################
|
||||
## INSTALL
|
||||
################################################################################
|
||||
|
||||
if (NOT WINDOWS)
|
||||
install(
|
||||
PROGRAMS ${PROJECT_SOURCE_DIR}/bin/etcd-arango
|
||||
DESTINATION ${ARANGODB_INSTALL_BIN}
|
||||
)
|
||||
endif ()
|
||||
|
||||
# Global macros ----------------------------------------------------------------
|
||||
macro (generate_root_config name)
|
||||
FILE(READ ${PROJECT_SOURCE_DIR}/etc/arangodb/${name}.conf.in FileContent)
|
||||
STRING(REPLACE "@PKGDATADIR@" "@ROOTDIR@/share/arangodb"
|
||||
FileContent "${FileContent}")
|
||||
STRING(REPLACE "@LOCALSTATEDIR@" "@ROOTDIR@/var"
|
||||
FileContent "${FileContent}")
|
||||
STRING(REPLACE "@SBINDIR@" "@ROOTDIR@/bin"
|
||||
FileContent "${FileContent}")
|
||||
STRING(REPLACE "@LIBEXECDIR@/arangodb" "@ROOTDIR@/bin"
|
||||
FileContent "${FileContent}")
|
||||
STRING(REPLACE "@SYSCONFDIR@" "@ROOTDIR@/etc/arangodb"
|
||||
FileContent "${FileContent}")
|
||||
if (MSVC)
|
||||
STRING(REPLACE "@PROGRAM_SUFFIX@" ".exe"
|
||||
FileContent "${FileContent}")
|
||||
STRING(REGEX REPLACE "[\r\n]file =" "\n# file ="
|
||||
FileContent "${FileContent}")
|
||||
endif ()
|
||||
FILE(WRITE ${PROJECT_BINARY_DIR}/etc/arangodb/${name}.conf "${FileContent}")
|
||||
endmacro ()
|
||||
|
||||
# generates config file using the configured paths ----------------------------
|
||||
macro (generate_path_config name)
|
||||
FILE(READ ${PROJECT_SOURCE_DIR}/etc/arangodb/${name}.conf.in FileContent)
|
||||
STRING(REPLACE "@PKGDATADIR@" "${TRI_PKGDATADIR}"
|
||||
FileContent "${FileContent}")
|
||||
STRING(REPLACE "@LOCALSTATEDIR@" "${VARDIR_NATIVE}"
|
||||
FileContent "${FileContent}")
|
||||
FILE(WRITE ${PROJECT_BINARY_DIR}/etc/arangodb/${name}.conf "${FileContent}")
|
||||
endmacro ()
|
||||
|
||||
# installs a config file -------------------------------------------------------
|
||||
macro (install_config name)
|
||||
if (MSVC OR DARWIN)
|
||||
generate_root_config(${name})
|
||||
else ()
|
||||
generate_path_config(${name})
|
||||
endif ()
|
||||
install(
|
||||
FILES ${PROJECT_BINARY_DIR}/etc/arangodb/${name}.conf
|
||||
DESTINATION ${ETCDIR_INSTALL})
|
||||
endmacro ()
|
||||
|
||||
# installs a readme file converting EOL ----------------------------------------
|
||||
macro (install_readme input where output)
|
||||
FILE(READ ${PROJECT_SOURCE_DIR}/${input} FileContent)
|
||||
STRING(REPLACE "\r" "" FileContent "${FileContent}")
|
||||
if (MSVC)
|
||||
STRING(REPLACE "\n" "\r\n" FileContent "${FileContent}")
|
||||
endif ()
|
||||
FILE(WRITE ${PROJECT_BINARY_DIR}/${output} "${FileContent}")
|
||||
install(
|
||||
FILES ${PROJECT_BINARY_DIR}/${output}
|
||||
DESTINATION ${where})
|
||||
endmacro ()
|
||||
|
||||
# installs a link to an executable ---------------------------------------------
|
||||
macro (install_command_alias name where alias)
|
||||
if (MSVC)
|
||||
add_custom_command(
|
||||
TARGET ${name}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${name}>
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${alias}.exe)
|
||||
install(
|
||||
PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${alias}.exe
|
||||
DESTINATION ${where})
|
||||
else ()
|
||||
add_custom_command(
|
||||
TARGET ${name}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink ${name}
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${alias})
|
||||
install(
|
||||
PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${alias}
|
||||
DESTINATION ${where})
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
# sub directories --------------------------------------------------------------
|
||||
|
||||
#if(BUILD_STATIC_EXECUTABLES)
|
||||
# set(CMAKE_EXE_LINKER_FLAGS -static)
|
||||
# set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
|
||||
# set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS) # remove -Wl,-Bdynamic
|
||||
# set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
|
||||
# set(CMAKE_SHARED_LIBRARY_C_FLAGS) # remove -fPIC
|
||||
# set(CMAKE_SHARED_LIBRARY_CXX_FLAGS)
|
||||
# set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) # remove -rdynamic
|
||||
# set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
|
||||
# # Maybe this works as well, haven't tried yet.
|
||||
# # set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
|
||||
#else(BUILD_STATIC_EXECUTABLES)
|
||||
# # Set RPATH to use for installed targets; append linker search path
|
||||
# set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LOFAR_LIBDIR}")
|
||||
# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
#endif(BUILD_STATIC_EXECUTABLES)
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#get_cmake_property(_variableNames VARIABLES)
|
||||
#foreach (_variableName ${_variableNames})
|
||||
# message(STATUS "${_variableName}=${${_variableName}}")
|
||||
#endforeach ()
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
# install ----------------------------------------------------------------------
|
||||
install(DIRECTORY ${PROJECT_SOURCE_DIR}/Documentation/man/
|
||||
DESTINATION share/man)
|
||||
|
||||
if (MSVC)
|
||||
install_readme(README . README.txt)
|
||||
install_readme(README.md . README.md)
|
||||
install_readme(README.windows . README.windows.txt)
|
||||
endif ()
|
||||
|
||||
if (MSVC)
|
||||
install_readme(LICENSE . LICENSE.txt)
|
||||
install_readme(LICENSES-OTHER-COMPONENTS.md . LICENSES-OTHER-COMPONENTS.md)
|
||||
else ()
|
||||
install_readme(README share/doc/arangodb README)
|
||||
install_readme(README.md share/doc/arangodb README.md)
|
||||
install_readme(LICENSE share/doc/arangodb LICENSE)
|
||||
install_readme(LICENSES-OTHER-COMPONENTS.md share/doc/arangodb LICENSES-OTHER-COMPONENTS.md)
|
||||
endif ()
|
||||
|
||||
# Build package ----------------------------------------------------------------
|
||||
# Posible options are:
|
||||
# - dmg-cli: Mac OS X shell client application
|
||||
# - debian: debian package
|
||||
set(BUILD_PACKAGE "unknown" CACHE path "Package type to build")
|
||||
|
||||
# OSX
|
||||
if (BUILD_PACKAGE STREQUAL "dmg-cli")
|
||||
option(DARWIN "Building for MacOS" ON)
|
||||
else ()
|
||||
option(DARWIN "Building for MacOS" OFF)
|
||||
endif ()
|
||||
|
||||
# Windows
|
||||
if (MSVC)
|
||||
else ()
|
||||
set(CPACK_SET_DESTDIR ON)
|
||||
endif ()
|
||||
|
||||
# General
|
||||
set(CPACK_PACKAGE_VENDOR "ArangoDB GmbH")
|
||||
set(CPACK_PACKAGE_CONTACT "info@arangodb.org")
|
||||
set(CPACK_PACKAGE_VERSION "${ARANGODB_VERSION}")
|
||||
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||
|
||||
set(CPACK_STRIP_FILES "ON")
|
||||
|
||||
if (DARWIN)
|
||||
set(CPACK_PACKAGE_NAME "ArangoDB-CLI")
|
||||
elseif (BUILD_PACKAGE STREQUAL "debian")
|
||||
set(CPACK_PACKAGE_NAME "arangodb")
|
||||
elseif (MSVC)
|
||||
set(CPACK_PACKAGE_NAME "ArangoDB")
|
||||
endif ()
|
||||
|
||||
# debian
|
||||
if (BUILD_PACKAGE STREQUAL "debian")
|
||||
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "database")
|
||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
|
||||
"${PROJECT_SOURCE_DIR}/Installation/Debian/postinst;${PROJECT_SOURCE_DIR}/Installation/Debian/preinst;${PROJECT_SOURCE_DIR}/Installation/Debian/postrm;${PROJECT_SOURCE_DIR}/Installation/Debian/prerm;")
|
||||
|
||||
install(
|
||||
FILES ${PROJECT_SOURCE_DIR}/Installation/Debian/rc.arangodb
|
||||
PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
DESTINATION /etc/init.d
|
||||
RENAME arangodb)
|
||||
|
||||
install(
|
||||
CODE
|
||||
"EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/share/arangodb/js/apps)")
|
||||
|
||||
install(
|
||||
CODE
|
||||
"EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink /var/lib/arangodb-apps \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/share/arangodb/js/apps/databases)")
|
||||
endif ()
|
||||
|
||||
# OSX bundle
|
||||
if (DARWIN)
|
||||
set(CPACK_BUNDLE_NAME "${CPACK_PACKAGE_NAME}")
|
||||
set(CPACK_BUNDLE_PLIST "${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/Info.plist")
|
||||
set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/icon.icns")
|
||||
set(CPACK_BUNDLE_STARTUP_COMMAND "${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/arangodb-cli.sh")
|
||||
endif ()
|
||||
|
||||
# MS installer
|
||||
if (MSVC)
|
||||
set(CPACK_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Installation/Windows/Templates")
|
||||
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL 1)
|
||||
set(BITS 64)
|
||||
|
||||
if (CMAKE_CL_64)
|
||||
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
|
||||
SET(BITS 64)
|
||||
else ()
|
||||
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
|
||||
SET(BITS 32)
|
||||
endif ()
|
||||
|
||||
message(STATUS "ARANGO_IMG: ${ARANGO_IMG}")
|
||||
message(STATUS "ARANGO_ICON: ${ARANGO_ICON}")
|
||||
message(STATUS "RELATIVE_ARANGO_ICON: ${RELATIVE_ARANGO_ICON}")
|
||||
|
||||
install(
|
||||
DIRECTORY "${PROJECT_SOURCE_DIR}/Installation/Windows/Icons"
|
||||
DESTINATION ${TRI_RESOURCEDIR})
|
||||
|
||||
set(CPACK_NSIS_DEFINES "
|
||||
!define BITS ${BITS}
|
||||
!define TRI_FRIENDLY_SVC_NAME '${ARANGODB_FRIENDLY_STRING}'
|
||||
!define TRI_AARDVARK_URL 'http://127.0.0.1:8529'
|
||||
")
|
||||
|
||||
set(CPACK_PACKAGE_ICON ${ARANGO_ICON})
|
||||
|
||||
set(CPACK_NSIS_MODIFY_PATH ON)
|
||||
set(CPACK_NSIS_MUI_ICON ${ARANGO_ICON})
|
||||
set(CPACK_NSIS_MUI_UNIICON ${ARANGO_ICON})
|
||||
set(CPACK_NSIS_INSTALLED_ICON_NAME ${RELATIVE_ARANGO_ICON})
|
||||
set(CPACK_NSIS_DISPLAY_NAME, ${ARANGODB_DISPLAY_NAME})
|
||||
set(CPACK_NSIS_HELP_LINK ${ARANGODB_HELP_LINK})
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT ${ARANGODB_URL_INFO_ABOUT})
|
||||
set(CPACK_NSIS_CONTACT ${ARANGODB_CONTACT})
|
||||
|
||||
# etcd
|
||||
if (CMAKE_CL_64)
|
||||
install(PROGRAMS WindowsLibraries/64/bin/etcd-arango.exe
|
||||
DESTINATION ${ARANGODB_INSTALL_SBIN})
|
||||
|
||||
install(FILES WindowsLibraries/64/icudtl.dat
|
||||
DESTINATION share/arangodb
|
||||
RENAME icudt54l.dat)
|
||||
else ()
|
||||
install(PROGRAMS WindowsLibraries/32/bin/etcd-arango.exe
|
||||
DESTINATION ${ARANGODB_INSTALL_SBIN})
|
||||
|
||||
install(FILES WindowsLibraries/32/icudtl.dat
|
||||
DESTINATION share/arangodb
|
||||
RENAME icudt54l.dat)
|
||||
endif ()
|
||||
|
||||
endif ()
|
||||
|
||||
|
||||
# Custom targets ----------------------------------------------------------------
|
||||
|
||||
# swagger
|
||||
add_custom_target (swagger
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
${PROJECT_SOURCE_DIR}/Documentation/Scripts/generateSwagger.py
|
||||
${PROJECT_SOURCE_DIR}
|
||||
${PROJECT_SOURCE_DIR}/js/apps/system/_admin/aardvark/APP/api-docs api-docs
|
||||
${PROJECT_SOURCE_DIR}/Documentation/DocuBlocks/Rest/
|
||||
> ${PROJECT_SOURCE_DIR}/js/apps/system/_admin/aardvark/APP/api-docs.json)
|
||||
|
||||
# love
|
||||
add_custom_target (love
|
||||
COMMENT "ArangoDB loves you."
|
||||
COMMAND ""
|
||||
)
|
||||
|
||||
|
||||
# Finally: user cpack
|
||||
include(CPack)
|
||||
|
||||
|
||||
################################################################################
|
||||
### @brief install client-side JavaScript files
|
||||
################################################################################
|
||||
|
||||
install(
|
||||
DIRECTORY ${PROJECT_SOURCE_DIR}/js/common ${PROJECT_SOURCE_DIR}/js/client
|
||||
DESTINATION share/arangodb/js
|
||||
FILES_MATCHING PATTERN "*.js"
|
||||
REGEX "^.*/common/test-data$" EXCLUDE
|
||||
REGEX "^.*/common/tests$" EXCLUDE
|
||||
REGEX "^.*/client/tests$" EXCLUDE)
|
||||
|
||||
## -----------------------------------------------------------------------------
|
||||
## --SECTION-- END-OF-FILE
|
||||
## -----------------------------------------------------------------------------
|
||||
|
||||
## Local Variables:
|
||||
## mode: outline-minor
|
||||
## outline-regexp: "^\\(### @brief\\|## --SECTION--\\|# -\\*- \\)"
|
||||
## End:
|
||||
|
||||
################################################################################
|
||||
### @brief install server-side JavaScript files
|
||||
################################################################################
|
||||
|
||||
install(
|
||||
DIRECTORY ${PROJECT_BINARY_DIR}/js
|
||||
DESTINATION share/arangodb)
|
||||
|
||||
################################################################################
|
||||
### @brief install log directory
|
||||
################################################################################
|
||||
|
||||
install(
|
||||
DIRECTORY ${PROJECT_BINARY_DIR}/var/log/arangodb
|
||||
DESTINATION ${VARDIR_INSTALL}/log)
|
||||
|
||||
################################################################################
|
||||
### @brief install database directory
|
||||
################################################################################
|
||||
|
||||
install(
|
||||
DIRECTORY ${PROJECT_BINARY_DIR}/var/lib/arangodb
|
||||
DESTINATION ${VARDIR_INSTALL}/lib)
|
||||
|
||||
################################################################################
|
||||
### @brief install apps directory
|
||||
################################################################################
|
||||
|
||||
install(
|
||||
DIRECTORY ${PROJECT_BINARY_DIR}/var/lib/arangodb-apps
|
||||
DESTINATION ${VARDIR_INSTALL}/lib)
|
||||
|
||||
## -----------------------------------------------------------------------------
|
||||
## --SECTION-- END-OF-FILE
|
||||
## -----------------------------------------------------------------------------
|
||||
|
||||
## Local Variables:
|
||||
## mode: outline-minor
|
||||
## outline-regexp: "### @brief\\|## --SECTION--\\|# -\\*- "
|
||||
## End:
|
|
@ -176,7 +176,7 @@ static inline uint32_t TRI_64to32(uint64_t x) {
|
|||
/// @brief asserts
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
|
||||
#ifndef TRI_ASSERT
|
||||
#define TRI_ASSERT(expr) \
|
||||
|
|
|
@ -229,11 +229,11 @@ class DeadlockDetector {
|
|||
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
// clean up
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
auto erased =
|
||||
#endif
|
||||
_blocked.erase(tid);
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_ASSERT(erased == 1);
|
||||
#endif
|
||||
}
|
||||
|
@ -241,11 +241,11 @@ class DeadlockDetector {
|
|||
return res;
|
||||
} catch (...) {
|
||||
// clean up
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
auto erased =
|
||||
#endif
|
||||
_blocked.erase(tid);
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_ASSERT(erased == 1);
|
||||
#endif
|
||||
throw;
|
||||
|
@ -265,11 +265,11 @@ class DeadlockDetector {
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
auto erased =
|
||||
#endif
|
||||
_blocked.erase(tid);
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_ASSERT(erased == 1);
|
||||
#endif
|
||||
}
|
||||
|
@ -316,11 +316,11 @@ class DeadlockDetector {
|
|||
|
||||
if (!wasLast) {
|
||||
// we're not the last thread, so we simply unregister ourselves from the list
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
auto erased =
|
||||
#endif
|
||||
(*it).second.first.erase(tid);
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_ASSERT(erased == 1);
|
||||
#endif
|
||||
// we shouldn't be in the list anymore
|
||||
|
@ -338,11 +338,11 @@ class DeadlockDetector {
|
|||
|
||||
if (wasLast) {
|
||||
// delete last reader/writer
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
auto erased =
|
||||
#endif
|
||||
_active.erase(value);
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_ASSERT(erased == 1);
|
||||
#endif
|
||||
}
|
||||
|
@ -375,11 +375,11 @@ class DeadlockDetector {
|
|||
// if someone else is already there, this must be a reader, as readers can
|
||||
// share a resource, but writers are exclusive
|
||||
TRI_ASSERT(!isWrite);
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
auto result =
|
||||
#endif
|
||||
(*it).second.first.emplace(tid);
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_ASSERT(result.second);
|
||||
#endif
|
||||
TRI_ASSERT(!(*it).second.second);
|
||||
|
@ -387,11 +387,11 @@ class DeadlockDetector {
|
|||
}
|
||||
|
||||
if (wasBlockedBefore) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
auto erased =
|
||||
#endif
|
||||
_blocked.erase(tid);
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_ASSERT(erased == 1);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -109,8 +109,8 @@ void Exception::appendLocation () {
|
|||
_errorMessage += std::string(" (location: ") + _file + ":" + std::to_string(_line) + "). Please report this error to arangodb.com";
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#if HAVE_BACKTRACE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#if ARANGODB_ENABLE_BACKTRACE
|
||||
if (WithBackTrace) {
|
||||
_errorMessage += std::string("\n\n");
|
||||
TRI_GetBacktrace(_errorMessage);
|
||||
|
@ -128,7 +128,7 @@ std::string Exception::FillExceptionString(int code, ...) {
|
|||
char const* format = TRI_errno_string(code);
|
||||
TRI_ASSERT(format != nullptr);
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
// Obviously the formatstring of the error code has to support parameters.
|
||||
TRI_ASSERT(strchr(format, '%') != nullptr);
|
||||
#endif
|
||||
|
@ -150,7 +150,7 @@ std::string Exception::FillExceptionString(int code, ...) {
|
|||
std::string Exception::FillFormatExceptionString(char const* format, ...) {
|
||||
TRI_ASSERT(format != nullptr);
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
// Format #1 should come from the macro...
|
||||
TRI_ASSERT(strchr(format, '%') != nullptr);
|
||||
// Obviously the user has to give us a format string.
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
#include "Basics/ReadWriteLock.h"
|
||||
#include "Basics/WriteLocker.h"
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#if HAVE_BACKTRACE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#if ARANGODB_ENABLE_BACKTRACE
|
||||
#include <sstream>
|
||||
#ifdef _WIN32
|
||||
#include <DbgHelp.h>
|
||||
|
@ -54,7 +54,7 @@ static char* FailurePoints = nullptr;
|
|||
|
||||
arangodb::basics::ReadWriteLock FailurePointsLock;
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief make a delimited value from a string, so we can unambigiously
|
||||
|
@ -287,8 +287,8 @@ void TRI_ShutdownDebugging() {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_GetBacktrace(std::string& btstr) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#if HAVE_BACKTRACE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#if ARANGODB_ENABLE_BACKTRACE
|
||||
#ifdef _WIN32
|
||||
void* stack[100];
|
||||
unsigned short frames;
|
||||
|
@ -383,8 +383,8 @@ void TRI_GetBacktrace(std::string& btstr) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_PrintBacktrace() {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#if HAVE_BACKTRACE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#if ARANGODB_ENABLE_BACKTRACE
|
||||
std::string out;
|
||||
TRI_GetBacktrace(out);
|
||||
fprintf(stderr, "%s", out.c_str());
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
/// triggered can be defined at runtime using TRI_AddFailurePointDebugging().
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
|
||||
#define TRI_IF_FAILURE(what) if (TRI_ShouldFailDebugging(what))
|
||||
|
||||
|
@ -51,7 +51,7 @@
|
|||
/// @brief cause a segmentation violation
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
void TRI_SegfaultDebugging(char const*);
|
||||
#else
|
||||
static inline void TRI_SegfaultDebugging(char const* unused) { (void)unused; }
|
||||
|
@ -61,7 +61,7 @@ static inline void TRI_SegfaultDebugging(char const* unused) { (void)unused; }
|
|||
/// @brief check whether we should fail at a failure point
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
bool TRI_ShouldFailDebugging(char const*);
|
||||
#else
|
||||
static inline bool TRI_ShouldFailDebugging(char const* unused) {
|
||||
|
@ -74,7 +74,7 @@ static inline bool TRI_ShouldFailDebugging(char const* unused) {
|
|||
/// @brief add a failure point
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
void TRI_AddFailurePointDebugging(char const*);
|
||||
#else
|
||||
static inline void TRI_AddFailurePointDebugging(char const* unused) {
|
||||
|
@ -86,7 +86,7 @@ static inline void TRI_AddFailurePointDebugging(char const* unused) {
|
|||
/// @brief remove a failure point
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
void TRI_RemoveFailurePointDebugging(char const*);
|
||||
#else
|
||||
static inline void TRI_RemoveFailurePointDebugging(char const* unused) {
|
||||
|
@ -98,7 +98,7 @@ static inline void TRI_RemoveFailurePointDebugging(char const* unused) {
|
|||
/// @brief clear all failure points
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
void TRI_ClearFailurePointsDebugging(void);
|
||||
#else
|
||||
static inline void TRI_ClearFailurePointsDebugging(void) {}
|
||||
|
@ -109,7 +109,7 @@ static inline void TRI_ClearFailurePointsDebugging(void) {}
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static inline bool TRI_CanUseFailurePointsDebugging(void) {
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
|
|
|
@ -174,7 +174,7 @@ again:
|
|||
LOG(ERR) << "rw-lock deadlock detected";
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(ERR) << "could not read-lock the read-write lock: " << strerror(rc);
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -194,7 +194,7 @@ void TRI_ReadUnlockReadWriteLock(TRI_read_write_lock_t* lock) {
|
|||
int rc = pthread_rwlock_unlock(lock);
|
||||
|
||||
if (rc != 0) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(ERR) << "could not read-unlock the read-write lock: " << strerror(rc);
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -245,7 +245,7 @@ void TRI_WriteLockReadWriteLock(TRI_read_write_lock_t* lock) {
|
|||
if (rc == EDEADLK) {
|
||||
LOG(ERR) << "rw-lock deadlock detected";
|
||||
}
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(ERR) << "could not write-lock the read-write lock: " << strerror(rc);
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -265,7 +265,7 @@ void TRI_WriteUnlockReadWriteLock(TRI_read_write_lock_t* lock) {
|
|||
int rc = pthread_rwlock_unlock(lock);
|
||||
|
||||
if (rc != 0) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(ERR) << "could not write-unlock the read-write lock: " << strerror(rc);
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -305,7 +305,7 @@ void TRI_SignalCondition(TRI_condition_t* cond) {
|
|||
int rc = pthread_cond_signal(&cond->_cond);
|
||||
|
||||
if (rc != 0) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(ERR) << "could not signal the condition: " << strerror(rc);
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -323,7 +323,7 @@ void TRI_BroadcastCondition(TRI_condition_t* cond) {
|
|||
int rc = pthread_cond_broadcast(&cond->_cond);
|
||||
|
||||
if (rc != 0) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(ERR) << "could not broadcast the condition: " << strerror(rc);
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -341,7 +341,7 @@ void TRI_WaitCondition(TRI_condition_t* cond) {
|
|||
int rc = pthread_cond_wait(&cond->_cond, &cond->_mutex);
|
||||
|
||||
if (rc != 0) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(ERR) << "could not wait for the condition: " << strerror(rc);
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -379,7 +379,7 @@ bool TRI_TimedWaitCondition(TRI_condition_t* cond, uint64_t delay) {
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(ERR) << "could not wait for the condition: " << strerror(rc);
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -397,7 +397,7 @@ void TRI_LockCondition(TRI_condition_t* cond) {
|
|||
int rc = pthread_mutex_lock(&cond->_mutex);
|
||||
|
||||
if (rc != 0) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(ERR) << "could not lock the condition: " << strerror(rc);
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
@ -413,7 +413,7 @@ void TRI_UnlockCondition(TRI_condition_t* cond) {
|
|||
int rc = pthread_mutex_unlock(&cond->_mutex);
|
||||
|
||||
if (rc != 0) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
LOG(ERR) << "could not unlock the condition: " << strerror(rc);
|
||||
TRI_ASSERT(false);
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "Basics/Common.h"
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
@ -36,7 +36,7 @@
|
|||
/// why so much memory is needed
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#define MALLOC_WARNING_THRESHOLD (1024 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
|||
/// mode, and will not include it if in non debug mode
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
|
||||
#define ZONE_DEBUG_LOCATION " in %s:%d"
|
||||
#define ZONE_DEBUG_PARAMS , file, line
|
||||
|
@ -66,7 +66,7 @@
|
|||
#define BuiltInMalloc(n) malloc(n)
|
||||
#define BuiltInRealloc(ptr, n) realloc(ptr, n)
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
#define MALLOC_WRAPPER(zone, n) FailMalloc(zone, n)
|
||||
#define REALLOC_WRAPPER(zone, ptr, n) FailRealloc(zone, ptr, n)
|
||||
#else
|
||||
|
@ -102,7 +102,7 @@ static int CoreInitialized = 0;
|
|||
/// @brief configuration parameters for memory error tests
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
static size_t FailMinSize = 0;
|
||||
static double FailProbability = 0.0;
|
||||
static double FailStartStamp = 0.0;
|
||||
|
@ -113,7 +113,7 @@ static double FailStartStamp = 0.0;
|
|||
/// prints a warning if size is above a threshold
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
static inline void CheckSize(uint64_t n, char const* file, int line) {
|
||||
// warn in the case of big malloc operations
|
||||
if (n >= MALLOC_WARNING_THRESHOLD) {
|
||||
|
@ -127,7 +127,7 @@ static inline void CheckSize(uint64_t n, char const* file, int line) {
|
|||
/// @brief timestamp for failing malloc
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
static inline double CurrentTimeStamp(void) {
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, 0);
|
||||
|
@ -140,7 +140,7 @@ static inline double CurrentTimeStamp(void) {
|
|||
/// @brief whether or not a malloc operation should intentionally fail
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
static bool ShouldFail(size_t n) {
|
||||
if (FailMinSize > 0 && FailMinSize > n) {
|
||||
return false;
|
||||
|
@ -166,7 +166,7 @@ static bool ShouldFail(size_t n) {
|
|||
/// @brief intentionally failing malloc - used for failure tests
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
static char* FailMalloc(TRI_memory_zone_t* zone, size_t n) {
|
||||
// we can fail, so let's check whether we should fail intentionally...
|
||||
if (zone->_failable && ShouldFail(n)) {
|
||||
|
@ -183,7 +183,7 @@ static char* FailMalloc(TRI_memory_zone_t* zone, size_t n) {
|
|||
/// @brief intentionally failing realloc - used for failure tests
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
static char* FailRealloc(TRI_memory_zone_t* zone, void* old, size_t n) {
|
||||
// we can fail, so let's check whether we should fail intentionally...
|
||||
if (zone->_failable && ShouldFail(n)) {
|
||||
|
@ -200,7 +200,7 @@ static char* FailRealloc(TRI_memory_zone_t* zone, void* old, size_t n) {
|
|||
/// @brief initialize failing malloc
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
static void InitFailMalloc(void) {
|
||||
// get failure probability
|
||||
char* value = getenv("ARANGODB_FAILMALLOC_PROBABILITY");
|
||||
|
@ -245,7 +245,7 @@ TRI_memory_zone_t* TRI_CORE_MEM_ZONE = &TriCoreMemZone;
|
|||
/// @brief unknown memory zone
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifndef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_memory_zone_t* TRI_UNKNOWN_MEM_ZONE = &TriUnknownMemZone;
|
||||
#endif
|
||||
|
||||
|
@ -253,7 +253,7 @@ TRI_memory_zone_t* TRI_UNKNOWN_MEM_ZONE = &TriUnknownMemZone;
|
|||
/// @brief returns the unknown memory zone
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_memory_zone_t* TRI_UnknownMemZoneZ(char const* file, int line) {
|
||||
return &TriUnknownMemZone;
|
||||
}
|
||||
|
@ -263,12 +263,12 @@ TRI_memory_zone_t* TRI_UnknownMemZoneZ(char const* file, int line) {
|
|||
/// @brief system memory allocation
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
void* TRI_SystemAllocateZ(uint64_t n, bool set, char const* file, int line) {
|
||||
#else
|
||||
void* TRI_SystemAllocate(uint64_t n, bool set) {
|
||||
#endif
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
CheckSize(n, file, line);
|
||||
#endif
|
||||
|
||||
|
@ -287,13 +287,13 @@ void* TRI_SystemAllocate(uint64_t n, bool set) {
|
|||
/// @brief basic memory management for allocate
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
void* TRI_AllocateZ(TRI_memory_zone_t* zone, uint64_t n, bool set,
|
||||
char const* file, int line) {
|
||||
#else
|
||||
void* TRI_Allocate(TRI_memory_zone_t* zone, uint64_t n, bool set) {
|
||||
#endif
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
CheckSize(n, file, line);
|
||||
#endif
|
||||
char* m = static_cast<char*>(MALLOC_WRAPPER(zone, (size_t)n));
|
||||
|
@ -321,7 +321,7 @@ void* TRI_Allocate(TRI_memory_zone_t* zone, uint64_t n, bool set) {
|
|||
", retrying!\n",
|
||||
(unsigned long long)n, (int)zone->_zid ZONE_DEBUG_PARAMS);
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
return TRI_AllocateZ(zone, n, set, file, line);
|
||||
#else
|
||||
return TRI_Allocate(zone, n, set);
|
||||
|
@ -331,7 +331,7 @@ void* TRI_Allocate(TRI_memory_zone_t* zone, uint64_t n, bool set) {
|
|||
if (set) {
|
||||
memset(m, 0, (size_t)n);
|
||||
}
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
else {
|
||||
// prefill with 0xA5 (magic value, same as Valgrind will use)
|
||||
memset(m, 0xA5, (size_t)n);
|
||||
|
@ -345,7 +345,7 @@ void* TRI_Allocate(TRI_memory_zone_t* zone, uint64_t n, bool set) {
|
|||
/// @brief basic memory management for reallocate
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
void* TRI_ReallocateZ(TRI_memory_zone_t* zone, void* m, uint64_t n,
|
||||
char const* file, int line) {
|
||||
#else
|
||||
|
@ -353,7 +353,7 @@ void* TRI_Reallocate(TRI_memory_zone_t* zone, void* m, uint64_t n) {
|
|||
#endif
|
||||
|
||||
if (m == nullptr) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
return TRI_AllocateZ(zone, n, false, file, line);
|
||||
#else
|
||||
return TRI_Allocate(zone, n, false);
|
||||
|
@ -362,7 +362,7 @@ void* TRI_Reallocate(TRI_memory_zone_t* zone, void* m, uint64_t n) {
|
|||
|
||||
char* p = (char*)m;
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
CheckSize(n, file, line);
|
||||
#endif
|
||||
|
||||
|
@ -390,7 +390,7 @@ void* TRI_Reallocate(TRI_memory_zone_t* zone, void* m, uint64_t n) {
|
|||
"%d" ZONE_DEBUG_LOCATION ", retrying!\n",
|
||||
(unsigned long long)n, (int)zone->_zid ZONE_DEBUG_PARAMS);
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
return TRI_ReallocateZ(zone, m, n, file, line);
|
||||
#else
|
||||
return TRI_Reallocate(zone, m, n);
|
||||
|
@ -404,7 +404,7 @@ void* TRI_Reallocate(TRI_memory_zone_t* zone, void* m, uint64_t n) {
|
|||
/// @brief basic memory management for deallocate
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
void TRI_FreeZ(TRI_memory_zone_t* zone, void* m, char const* file, int line) {
|
||||
#else
|
||||
void TRI_Free(TRI_memory_zone_t* zone, void* m) {
|
||||
|
@ -412,7 +412,7 @@ void TRI_Free(TRI_memory_zone_t* zone, void* m) {
|
|||
|
||||
char* p = (char*)m;
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
if (p == nullptr) {
|
||||
fprintf(stderr, "freeing nil ptr " ZONE_DEBUG_LOCATION ZONE_DEBUG_PARAMS);
|
||||
// crash intentionally
|
||||
|
@ -430,13 +430,13 @@ void TRI_Free(TRI_memory_zone_t* zone, void* m) {
|
|||
/// by malloc et al
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
void TRI_SystemFreeZ(void* p, char const* file, int line) {
|
||||
#else
|
||||
void TRI_SystemFree(void* p) {
|
||||
#endif
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
if (p == nullptr) {
|
||||
fprintf(stderr, "freeing nil ptr in %s:%d\n", file, line);
|
||||
}
|
||||
|
@ -477,7 +477,7 @@ void TRI_InitializeMemory() {
|
|||
TriUnknownMemZone._failed = false;
|
||||
TriUnknownMemZone._failable = true;
|
||||
|
||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
||||
#ifdef ARANGODB_ENABLE_FAILURE_TESTS
|
||||
InitFailMalloc();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ extern TRI_memory_zone_t* TRI_CORE_MEM_ZONE;
|
|||
/// @brief unknown memory zone
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#define TRI_UNKNOWN_MEM_ZONE TRI_UnknownMemZoneZ(__FILE__, __LINE__)
|
||||
TRI_memory_zone_t* TRI_UnknownMemZoneZ(char const* file, int line);
|
||||
#else
|
||||
|
@ -93,7 +93,7 @@ inline TRI_memory_zone_id_t TRI_MemoryZoneId(TRI_memory_zone_t const* zone) {
|
|||
/// allocations easier.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#define TRI_SystemAllocate(a, b) \
|
||||
TRI_SystemAllocateZ((a), (b), __FILE__, __LINE__)
|
||||
void* TRI_SystemAllocateZ(uint64_t, bool, char const*, int);
|
||||
|
@ -105,7 +105,7 @@ void* TRI_SystemAllocate(uint64_t, bool);
|
|||
/// @brief basic memory management for allocate
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#define TRI_Allocate(a, b, c) TRI_AllocateZ((a), (b), (c), __FILE__, __LINE__)
|
||||
void* TRI_AllocateZ(TRI_memory_zone_t*, uint64_t, bool, char const*, int);
|
||||
#else
|
||||
|
@ -116,7 +116,7 @@ void* TRI_Allocate(TRI_memory_zone_t*, uint64_t, bool);
|
|||
/// @brief basic memory management for reallocate
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#define TRI_Reallocate(a, b, c) \
|
||||
TRI_ReallocateZ((a), (b), (c), __FILE__, __LINE__)
|
||||
void* TRI_ReallocateZ(TRI_memory_zone_t*, void*, uint64_t, char const*, int);
|
||||
|
@ -128,7 +128,7 @@ void* TRI_Reallocate(TRI_memory_zone_t*, void*, uint64_t);
|
|||
/// @brief basic memory management for deallocate
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#define TRI_Free(a, b) TRI_FreeZ((a), (b), __FILE__, __LINE__)
|
||||
void TRI_FreeZ(TRI_memory_zone_t*, void*, char const*, int);
|
||||
#else
|
||||
|
@ -144,7 +144,7 @@ void TRI_Free(TRI_memory_zone_t*, void*);
|
|||
/// pointer if compiled with --enable-maintainer-mode.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#define TRI_SystemFree(a) TRI_SystemFreeZ((a), __FILE__, __LINE__)
|
||||
void TRI_SystemFreeZ(void*, char const*, int);
|
||||
#else
|
||||
|
|
|
@ -766,7 +766,7 @@ TRI_vector_string_t TRI_Split2String(char const* source, char const* delim) {
|
|||
/// @brief frees a string
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
|
||||
void TRI_FreeStringZ(TRI_memory_zone_t* zone, char* value, char const* file,
|
||||
int line) {
|
||||
|
|
|
@ -174,7 +174,7 @@ TRI_vector_string_t TRI_Split2String(char const* source, char const* delim);
|
|||
/// @brief frees a string
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
#define TRI_FreeString(a, b) TRI_FreeStringZ((a), (b), __FILE__, __LINE__)
|
||||
void TRI_FreeStringZ(TRI_memory_zone_t*, char*, char const* file, int line);
|
||||
#else
|
||||
|
|
|
@ -65,7 +65,7 @@ void Version::initialize() {
|
|||
Values["vpack-version"] = getVPackVersion();
|
||||
Values["zlib-version"] = getZLibVersion();
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
Values["maintainer-mode"] = "true";
|
||||
#else
|
||||
Values["maintainer-mode"] = "false";
|
||||
|
@ -238,7 +238,7 @@ std::string Version::getVerboseVersionString() {
|
|||
|
||||
version << "ArangoDB " << TRI_VERSION_FULL << " "
|
||||
<< (sizeof(void*) == 4 ? "32" : "64") << "bit"
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
<< " maintainer mode"
|
||||
#endif
|
||||
<< ", using "
|
||||
|
|
|
@ -261,7 +261,7 @@ static bool ContainsNonAscii(char const* src, size_t len) {
|
|||
return ContainsNonAsciiSlow(src, len);
|
||||
}
|
||||
|
||||
const unsigned bytes_per_word = TRI_BITS / (8 * sizeof(char));
|
||||
const unsigned bytes_per_word = ARANGODB_BITS / (8 * sizeof(char));
|
||||
const unsigned align_mask = bytes_per_word - 1;
|
||||
const unsigned unaligned = reinterpret_cast<uintptr_t>(src) & align_mask;
|
||||
|
||||
|
@ -276,7 +276,7 @@ static bool ContainsNonAscii(char const* src, size_t len) {
|
|||
len -= n;
|
||||
}
|
||||
|
||||
#if TRI_BITS == 64
|
||||
#if ARANGODB_BITS == 64
|
||||
typedef uint64_t word;
|
||||
uint64_t const mask = 0x8080808080808080ll;
|
||||
#else
|
||||
|
@ -323,7 +323,7 @@ static void ForceAscii(char const* src, char* dst, size_t len) {
|
|||
return;
|
||||
}
|
||||
|
||||
const unsigned bytes_per_word = TRI_BITS / (8 * sizeof(char));
|
||||
const unsigned bytes_per_word = ARANGODB_BITS / (8 * sizeof(char));
|
||||
const unsigned align_mask = bytes_per_word - 1;
|
||||
const unsigned src_unalign = reinterpret_cast<uintptr_t>(src) & align_mask;
|
||||
const unsigned dst_unalign = reinterpret_cast<uintptr_t>(dst) & align_mask;
|
||||
|
@ -341,7 +341,7 @@ static void ForceAscii(char const* src, char* dst, size_t len) {
|
|||
}
|
||||
}
|
||||
|
||||
#if TRI_BITS == 64
|
||||
#if ARANGODB_BITS == 64
|
||||
typedef uint64_t word;
|
||||
uint64_t const mask = ~0x8080808080808080ll;
|
||||
#else
|
||||
|
@ -565,7 +565,7 @@ RetainedBufferInfo::RetainedBufferInfo(V8Buffer* buffer) : _buffer(buffer) {}
|
|||
|
||||
v8::RetainedObjectInfo* WrapperInfo(uint16_t classId,
|
||||
v8::Handle<v8::Value> wrapper) {
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
ISOLATE;
|
||||
TRI_ASSERT(classId == TRI_V8_BUFFER_CID);
|
||||
TRI_ASSERT(V8Buffer::hasInstance(isolate, wrapper));
|
||||
|
@ -760,7 +760,7 @@ bool V8Buffer::hasInstance(v8::Isolate* isolate, v8::Handle<v8::Value> val) {
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifdef TRI_ENABLE_MAINTAINER_MODE
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
TRI_GET_GLOBAL(FastBufferConstructor, v8::Function);
|
||||
TRI_ASSERT(!FastBufferConstructor.IsEmpty());
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue