mirror of https://gitee.com/bigwinds/arangodb
C++17 (#10178)
* Squashed commit of the following: commit dd4b85fcaa634ed829e79e266ee547c0522e71f6 Merge: 9fc1548e54fa7de56cf8
Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Thu Jan 10 10:21:26 2019 +0100 Merge branch 'devel' into feature/cpp17 * devel: upgrade to boost 1.69.0 (#7910) Doc - Add a paragraph that JS JS trxs are excluded from intermediate commits. (#7919) issue 511.7.3: restore single-document optimization, implement call to update data-store options, add IResearchView upgrade step (#7918) improve assertions (#7830) fix MSVC warning remove unused function fix #7900 - null bind values do not change to empty string anymore (#7917) commit 9fc1548e54f8cfd2990e7ae0b2b7ae3da55a2cd2 Merge: f2ecee8136e7810e1956
Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Wed Jan 9 09:36:19 2019 +0100 Merge remote-tracking branch 'origin/devel' into feature/cpp17 * origin/devel: Doc - Update remark about per-database replication (#7891) Doc - Known Issues - new links (#7908) support db._explain with all plans (#7895) JWT base64url encoding (#7899) cppcheck/Scheduler (#7909) multiplex REPLICATION-APPLIER-STATE files for RocksDB engine (#7898) fix compile warnings upgrade bundled curl library to version 7.63 (#7846) Feature/new server infra (#7733) Doc - check_function (#7885) simran (#7881) added AQL function CHECK_DOCUMENT (#7842) added arangorestore option `--cleanup-duplicate-attributes` (#7877) Doc - arangorestore improvements (#7878) added arangorestore options `--number-of-shards` and `--replication-f… (#7869) commit f2ecee81360f0f0c19901accdbc9902304814bb2 Merge: 44adf97fa05c53ebceb0
Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Thu Jan 3 10:51:20 2019 +0100 Merge remote-tracking branch 'origin/devel' into feature/cpp17 * origin/devel: (40 commits) Feature/jwt keyfile (#7863) prevent duplicate attributes being generated by AQL queries (#7837) fixed issue #7834 (#7843) Bug fix/issues 23122018 (#7847) Documents that arangorestore/arangodump threads option is from v3.4.0 on (#7701) Update ISSUE_TEMPLATE.md (#7103) Doc - Forwardports to devel - 2018-12-27 (#7858) Doc - Sync-external-repo-2018-12-25 (#7854) Doc - re-add switching storage engine section (#7781) Doc - Fix build (whitespaces, triple-backticks, comments) (#7857) Add http_server test for creating view with links (#7852) big reformat added new clang style and reformat script for clang-format 6.0 Doc - Improve MacOS Installation page (#7744) Fix issue with geo iterator reset. (#7839) Doc - Single Instance vs. Cluster (diff + migration) (#7739) Rdb index background (preliminary) (#7644) iResearch asan issue (#7832) Feature/improve edgeindex covered (#7718) issue 511.6: update iresearch to 6e870904eae5eaf891359ed06e7332666c02cb19 (#7819) ... commit 44adf97fa0bc9cc7dc649c98916a91dba456b956 Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Tue Dec 18 13:39:03 2018 +0100 Add COMPILER_* variables to VERSIONS file. The variables will be used to select a fitting compiler in the CI. Developers need to ensure themselves that their development environment supports the c++ standard. commit 8124eb3b44fb2302cdd7250d1573b25135719e41 Merge: 127bb7d1cb4423125a7f
Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Tue Dec 18 11:09:42 2018 +0100 Merge branch 'devel' of https://github.com/arangodb/arangodb into feature/cpp17 * 'devel' of https://github.com/arangodb/arangodb: (381 commits) tools are now looking into the build to find the file (#7128) issue 511.3: remove IResearchViewDBServer and use the IResearchView directly on db-server (#7748) Fix S2 for aarch64. (#7770) equalising devel and 3.4 in agency/cluster (#7755) wording startLocalCluster in rr debugging mode cannot be started with --console on agents / db servers (#7776) fix cmake parameters coincidence (#7774) Fix a rare deadlock situation in Replication sync phase (#7759) add virtual dtor wait for procdump to exit too. (#7731) fix invalid handling of `_lastValue` in case of multiple coordinators (#7734) fixed item 3 of issue #7009 (#7747) updated 3rdparty licenses remove inclusion of valgrind.h remove now-unused file Bug fix/fix thread shutdown (#7728) Doc - fix build by adding missing SUMMARY entries (#7741) issue 511.2.1: use references instead of raw pointers for Index operations to avoid null pointer access (#7725) port 3.4 change to stopBackgroundThreads. Move ClusterCommThread routines to same place in source file. (#7721) Ignore invaild geo coordinates when indexing. (#7724) ... commit 127bb7d1cb56fb71b06613971c896aedc1817a98 Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Mon Oct 15 22:06:27 2018 +0200 fix invoke for c++17 commit 65a514c34472a611167cd01e14efd5dccc9ae2d1 Author: Frank Celler <frank@arangodb.com> Date: Mon Oct 15 18:58:31 2018 +0200 trying to use 17 commit 8344d96e43522757813bb37e10b95ae83ff35abf Merge: 2822dae6e1c7933bcb31
Author: Frank Celler <frank@arangodb.com> Date: Mon Oct 15 18:08:52 2018 +0200 Merge branch 'devel' of ssh://github.com/arangodb/ArangoDB into feature/cpp17 commit 2822dae6e175e866106c49ed8e1f5248dcef0b62 Merge: 4001d11afd af2f18fcbf Author: Frank Celler <frank@arangodb.com> Date: Fri Oct 12 17:44:04 2018 +0200 Merge branch 'feature/boost-168' of ssh://github.com/arangodb/ArangoDB into feature/cpp17 commit 4001d11afd6ed691ce9dcce34b1ee7b75a08be4b Author: Frank Celler <frank@arangodb.com> Date: Fri Oct 12 17:43:46 2018 +0200 fixed merge conflict commit 94cb4b7d4c43c7c12db7ccc3c7cb1c1885e9fafa Merge: cbc2f34bb4d3c446156c
Author: Frank Celler <frank@arangodb.com> Date: Fri Oct 12 14:35:42 2018 +0200 Merge branch 'devel' of https://github.com/arangodb/arangodb into feature/cpp17 commit af2f18fcbf709a86e76feb5165ea848f3d4eba67 Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Fri Sep 28 14:44:16 2018 +0200 add bcrypt.lib to make uuid work commit 11efd1299a40a38ef92d717a8ee9e882fc77c82b Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Wed Sep 19 12:31:25 2018 +0200 fix boost path for iresearch that is not able to use the provided information commit 57ed116b6c7c5fda1180929c4f1d63895c25ea1f Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Wed Sep 19 10:24:10 2018 +0200 add missing boost core includes commit 5d52b322a0fa8fccb4c0d50f5677f7c4b0505284 Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Wed Sep 19 09:22:43 2018 +0200 upgrade boost to version 1.68.0 commit cbc2f34bb475f988fc407b2fd332d9984fc682db Merge: 3de8d481e6 1b1142647a Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Wed Sep 19 12:08:13 2018 +0200 Merge branch 'feature/cpp17' of https://github.com/arangodb/arangodb into feature/cpp17 * 'feature/cpp17' of https://github.com/arangodb/arangodb: allow MSVC to user autopointer with c++17 nightly frontend build Remove unused variable check from arangodump. (#6529) fixed JavaScript error added a reserve call Bug fix/simplify things (#6516) catch 501 (not implemented) in the query editor (ui) (#6523) return error codes in case a babies remove operation fails (#6527) Use physical collection directly (#6526) Feature/aql item block compression (#6514) move tests to the right location take over selectivity estimates (#6505) Properly check syncer erros, catch more exceptions (#6520) prevent out-of-bounds array access Fix deduplication in IndexBlock (#6508) commit 3de8d481e6c40ab1b160ca931b23882fe36048c2 Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Wed Sep 19 12:05:56 2018 +0200 add autopointer and tr1 commit 1b1142647ac79764c55c0688c1b22a0227c7fad6 Merge: 4b38f0a7a00dd277d325
Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Wed Sep 19 10:06:01 2018 +0200 Merge branch 'devel' of https://github.com/arangodb/arangodb into feature/cpp17 * 'devel' of https://github.com/arangodb/arangodb: nightly frontend build Remove unused variable check from arangodump. (#6529) fixed JavaScript error added a reserve call Bug fix/simplify things (#6516) catch 501 (not implemented) in the query editor (ui) (#6523) return error codes in case a babies remove operation fails (#6527) Use physical collection directly (#6526) Feature/aql item block compression (#6514) move tests to the right location take over selectivity estimates (#6505) Properly check syncer erros, catch more exceptions (#6520) prevent out-of-bounds array access Fix deduplication in IndexBlock (#6508) commit 4b38f0a7a003a2da813a363b91dc289419e0210c Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Wed Sep 19 10:04:46 2018 +0200 allow MSVC to user autopointer with c++17 commit 9c9102341245f2bc4373d11cd69c8e4c3d9fb129 Merge: 1b9e580f14e51359b68e
Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Mon Sep 17 12:53:03 2018 +0200 Merge branch 'devel' of https://github.com/arangodb/arangodb into feature/cpp17 * 'devel' of https://github.com/arangodb/arangodb: port startup fix Bugfix/early out invalid links in view creation (#6502) commit 1b9e580f14db737f005b7eed9926c222fa047754 Merge: b08bc2e9ba8bd834bcf7
Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Mon Sep 17 06:38:24 2018 +0200 Merge remote-tracking branch 'origin/devel' into feature/cpp17 * origin/devel: (38 commits) Maintenance delayed by incomplete hashing maintenance actions (#6448) Do not hide indexes (#6507) Fix WebUI Login with read-only (#6500) Improve use of single shard restriction (#6182) make cid values in /_api/replication/logger-follow strings as advertised (#6499) less dynamic memory allocations on index operations (#6497) Fix several TSan warnings (#6473) Copy installation files on startup (#6491) nightly frontend build fix cluster selectivity estimates (#6488) this moves aql::Query* out of the call parameter to any aql::Function (#6485) Add advertised endpoints. (#6104) nightly frontend build fix leak in regex cache (#6480) Removing ClusterComm ClientTransactionID (#6294) pass variables by const reference remove unused variable remove unused variable fix init-order fiasco with static strings (#6475) minor issues (#6471) ... commit b08bc2e9ba1553d608ae1bd5dc4a42290fa2cabd Merge: 03fabcc5092eb3c2dee4
Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Tue Sep 11 12:46:51 2018 +0200 Merge branch 'devel' of https://github.com/arangodb/arangodb into feature/cpp17 * 'devel' of https://github.com/arangodb/arangodb: temporarily increase log verbosity for replication log topic Fix skipSome PR (#6455) bump version number to 3.5 (#6454) Feature/new devel versioning scheme (#6312) Bug fix/aql modify cleanup (#6380) Trace skipSome() calls (#6449) nightly frontend build Fix ArangoSearch authentication update task test (#6453) Forward port changelog changes and typo fixes from #6303 (#6409) fix some issues with sorted variant of COLLECT (#6433) added tests, updated docu (#6407) now that we are on c++14 and std::make_unique is available everywhere, we can safely remove our shim for std::make_unique (#6429) Fixed memory leak due to cyclic references of shared pointer. (#6442) do not create empty useless transaction data objects (#6430) add some debugging for unstable replication_sync test (#6436) Address leak sanitizer warnings (#6275) Fix Pregel Graph Loading Logic (#6419) remove unused variables fix profile output for nodes without calls to getSome (#6397) commit 03fabcc5098f4e097d31546835fbadd373e854c1 Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Tue Sep 11 07:19:21 2018 +0200 switch more libs to c++17 commit 335942038f5d0d817554f59a5943e041d928ec40 Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Mon Sep 10 07:31:49 2018 +0200 fix static asserts in iresearch commit 90eab952765c26d165e57dc8e01ee42bc1d2d8e6 Author: Jan Christoph Uhde <Jan@UhdeJC.com> Date: Mon Sep 10 07:10:48 2018 +0200 move from c++14 to c++17 * specify required clang and gcc versions * fix openssl 1.3 usage * change random_shuffle to shuffle as the former has been removed from the c++ standard https://meetingcpp.com/blog/items/stdrandom_shuffle-is-deprecated.html * disable uncaught_exceptions in catch2 for darwin In file included from /Users/jenkins/Git/cpp17/tests/main.cpp:2: /Users/jenkins/Git/cpp17/3rdParty/catch/catch.hpp:10877:21: error: 'uncaught_exceptions' is unavailable: introduced in macOS 10.12 return std::uncaught_exceptions() > 0; ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/exception:130:63: note: 'uncaught_exceptions' has been explicitly marked unavailable here _LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS int uncaught_exceptions() _NOEXCEPT; ^ * boost locale now depends on boost thread * add fix for VS2019 * try to fix build for windows * add some change required by older macos * add miserable hack to circumvent std::stack implementation problem on older Xcode * try to fix windows build * remove unary function as in v8 upstream * clean up CMakeLists.txt * Remove emplace hack that was introduced for OSX * Revert "Remove emplace hack that was introduced for OSX" This reverts commit 2b0a4cdd7881baa9ea8fbd34f2e89ef6fa9b9b63. * Remove emplace hack that was introduced on OSX to support C++17 (#10184) * Revert "Revert "Remove emplace hack that was introduced for OSX"" This reverts commit 7df9edde4097a951e95fcb204113d9c5289bf4bf. * fixed MACOSX_DEPLOYMENT_TARGET * Fix quotes usage in conditions * Added MACOS_MIN * Adjust variables * Fix compilation * remove iresearch patches * Update CMakeLists.txt Co-Authored-By: Jan <jsteemann@users.noreply.github.com>
This commit is contained in:
parent
532e4d382d
commit
b16a5e6393
|
@ -53,7 +53,7 @@ cluster/**
|
|||
cluster-init*/**
|
||||
p/
|
||||
|
||||
core
|
||||
/core
|
||||
!3rdParty/iresearch/core
|
||||
!core.h
|
||||
TAGS
|
||||
|
|
|
@ -137,18 +137,17 @@ V8_INLINE size_t hash_value(std::pair<T1, T2> const& v) {
|
|||
return hash_combine(v.first, v.second);
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
struct hash : public std::unary_function<T, size_t> {
|
||||
struct hash {
|
||||
V8_INLINE size_t operator()(T const& v) const { return hash_value(v); }
|
||||
};
|
||||
|
||||
#define V8_BASE_HASH_SPECIALIZE(type) \
|
||||
template <> \
|
||||
struct hash<type> : public std::unary_function<type, size_t> { \
|
||||
V8_INLINE size_t operator()(type const v) const { \
|
||||
return ::v8::base::hash_value(v); \
|
||||
} \
|
||||
#define V8_BASE_HASH_SPECIALIZE(type) \
|
||||
template <> \
|
||||
struct hash<type> { \
|
||||
V8_INLINE size_t operator()(type const v) const { \
|
||||
return ::v8::base::hash_value(v); \
|
||||
} \
|
||||
};
|
||||
V8_BASE_HASH_SPECIALIZE(bool)
|
||||
V8_BASE_HASH_SPECIALIZE(signed char)
|
||||
|
@ -166,7 +165,7 @@ V8_BASE_HASH_SPECIALIZE(double)
|
|||
#undef V8_BASE_HASH_SPECIALIZE
|
||||
|
||||
template <typename T>
|
||||
struct hash<T*> : public std::unary_function<T*, size_t> {
|
||||
struct hash<T*> {
|
||||
V8_INLINE size_t operator()(T* const v) const {
|
||||
return ::v8::base::hash_value(v);
|
||||
}
|
||||
|
@ -181,10 +180,10 @@ struct hash<T*> : public std::unary_function<T*, size_t> {
|
|||
// hash data structure based on the bitwise representation of types.
|
||||
|
||||
template <typename T>
|
||||
struct bit_equal_to : public std::binary_function<T, T, bool> {};
|
||||
struct bit_equal_to {};
|
||||
|
||||
template <typename T>
|
||||
struct bit_hash : public std::unary_function<T, size_t> {};
|
||||
struct bit_hash {};
|
||||
|
||||
#define V8_BASE_BIT_SPECIALIZE_TRIVIAL(type) \
|
||||
template <> \
|
||||
|
@ -203,19 +202,19 @@ V8_BASE_BIT_SPECIALIZE_TRIVIAL(long long) // NOLINT(runtime/int)
|
|||
V8_BASE_BIT_SPECIALIZE_TRIVIAL(unsigned long long) // NOLINT(runtime/int)
|
||||
#undef V8_BASE_BIT_SPECIALIZE_TRIVIAL
|
||||
|
||||
#define V8_BASE_BIT_SPECIALIZE_BIT_CAST(type, btype) \
|
||||
template <> \
|
||||
struct bit_equal_to<type> : public std::binary_function<type, type, bool> { \
|
||||
V8_INLINE bool operator()(type lhs, type rhs) const { \
|
||||
return bit_cast<btype>(lhs) == bit_cast<btype>(rhs); \
|
||||
} \
|
||||
}; \
|
||||
template <> \
|
||||
struct bit_hash<type> : public std::unary_function<type, size_t> { \
|
||||
V8_INLINE size_t operator()(type v) const { \
|
||||
hash<btype> h; \
|
||||
return h(bit_cast<btype>(v)); \
|
||||
} \
|
||||
#define V8_BASE_BIT_SPECIALIZE_BIT_CAST(type, btype) \
|
||||
template <> \
|
||||
struct bit_equal_to<type> { \
|
||||
V8_INLINE bool operator()(type lhs, type rhs) const { \
|
||||
return bit_cast<btype>(lhs) == bit_cast<btype>(rhs); \
|
||||
} \
|
||||
}; \
|
||||
template <> \
|
||||
struct bit_hash<type> { \
|
||||
V8_INLINE size_t operator()(type v) const { \
|
||||
hash<btype> h; \
|
||||
return h(bit_cast<btype>(v)); \
|
||||
} \
|
||||
};
|
||||
V8_BASE_BIT_SPECIALIZE_BIT_CAST(float, uint32_t)
|
||||
V8_BASE_BIT_SPECIALIZE_BIT_CAST(double, uint64_t)
|
||||
|
|
|
@ -133,14 +133,14 @@ class Handle final : public HandleBase {
|
|||
bool equals(Handle<T> other) const { return address() == other.address(); }
|
||||
|
||||
// Provide function object for location equality comparison.
|
||||
struct equal_to : public std::binary_function<Handle<T>, Handle<T>, bool> {
|
||||
struct equal_to {
|
||||
V8_INLINE bool operator()(Handle<T> lhs, Handle<T> rhs) const {
|
||||
return lhs.equals(rhs);
|
||||
}
|
||||
};
|
||||
|
||||
// Provide function object for location hashing.
|
||||
struct hash : public std::unary_function<Handle<T>, size_t> {
|
||||
struct hash {
|
||||
V8_INLINE size_t operator()(Handle<T> const& handle) const {
|
||||
return base::hash<Address>()(handle.address());
|
||||
}
|
||||
|
|
|
@ -351,7 +351,7 @@ namespace boost
|
|||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class T>
|
||||
typename decay<T>::type
|
||||
::std::decay_t<T>
|
||||
decay_copy(T&& t)
|
||||
{
|
||||
return boost::forward<T>(t);
|
||||
|
|
|
@ -146,5 +146,6 @@ add_library(boost_thread STATIC
|
|||
${BOOST_THREAD_PLATFORM_SRC}
|
||||
)
|
||||
target_link_libraries(boost_thread PUBLIC boost_boost) #this will add required includes
|
||||
target_link_libraries(boost_locale PUBLIC boost_thread)
|
||||
target_compile_definitions(boost_thread PRIVATE "BOOST_SYSTEM_STATIC_LINK=1")
|
||||
target_compile_definitions(boost_thread PUBLIC "BOOST_ALL_NO_LIB=1")
|
||||
|
|
|
@ -138,7 +138,7 @@ function( add_fail_tests TEST_GLOB TEST_PREFIX )
|
|||
#target_compile_definitions( ${BIN_NAME} PRIVATE ${TST_NAME} )
|
||||
set( TEST_BIN_NAME ${CMAKE_BINARY_DIR}/${BIN_NAME} )
|
||||
add_custom_target( ${BIN_NAME}
|
||||
COMMAND ${PROJECT_SOURCE_DIR}/compile_fail.sh ${TEST_BIN_NAME} ${CMAKE_CXX_COMPILER} -std=c++14 -L${CMAKE_BINARY_DIR}/ -ltz -I${PROJECT_SOURCE_DIR}/${HEADER_FOLDER}/date -o ${BIN_NAME} ${TEST_FILE}
|
||||
COMMAND ${PROJECT_SOURCE_DIR}/compile_fail.sh ${TEST_BIN_NAME} ${CMAKE_CXX_COMPILER} -std=c++17 -L${CMAKE_BINARY_DIR}/ -ltz -I${PROJECT_SOURCE_DIR}/${HEADER_FOLDER}/date -o ${BIN_NAME} ${TEST_FILE}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMENT ${TST_NAME}
|
||||
)
|
||||
|
|
|
@ -22,7 +22,7 @@ set(LINENOISE_FRIENDLY_STRING "Linenoise NG - Linenoise Next Generation")
|
|||
# compiler options
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
message(STATUS "Compiler type GNU: ${CMAKE_CXX_COMPILER}")
|
||||
set(BASE_COMPILER_OPTIONS "-std=c++14 -Wall -Wextra")
|
||||
set(BASE_COMPILER_OPTIONS "-std=c++17 -Wall -Wextra")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BASE_COMPILER_OPTIONS}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${BASE_COMPILER_OPTIONS} -O0 -g")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${BASE_COMPILER_OPTIONS} -Os")
|
||||
|
@ -32,7 +32,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
|||
elseif(CMAKE_COMPILER_IS_CLANGCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# using regular Clang or AppleClang
|
||||
message(STATUS "Compiler type CLANG: ${CMAKE_CXX_COMPILER}")
|
||||
set(BASE_COMPILER_OPTIONS "-std=c++14 -Wall -Wextra")
|
||||
set(BASE_COMPILER_OPTIONS "-std=c++17 -Wall -Wextra")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BASE_COMPILER_OPTIONS}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${BASE_COMPILER_OPTIONS} -O0 -g")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${BASE_COMPILER_OPTIONS} -Os")
|
||||
|
@ -63,7 +63,7 @@ elseif(MSVC)
|
|||
else()
|
||||
# unknown compiler
|
||||
message(STATUS "Compiler type UNKNOWN: ${CMAKE_CXX_COMPILER}")
|
||||
set(BASE_COMPILER_OPTIONS "-std=c++14 -Wall -Wextra")
|
||||
set(BASE_COMPILER_OPTIONS "-std=c++17 -Wall -Wextra")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BASE_COMPILER_OPTIONS}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${BASE_COMPILER_OPTIONS} -O0 -g")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${BASE_COMPILER_OPTIONS} -Os")
|
||||
|
|
|
@ -179,7 +179,7 @@ else()
|
|||
if(MINGW)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
|
||||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer")
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
|
|
@ -44,7 +44,7 @@ if test -z "$OUTPUT"; then
|
|||
fi
|
||||
|
||||
# we depend on C++11
|
||||
PLATFORM_CXXFLAGS="-std=c++11"
|
||||
PLATFORM_CXXFLAGS="-std=c++17"
|
||||
# we currently depend on POSIX platform
|
||||
COMMON_FLAGS="-DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX"
|
||||
|
||||
|
|
|
@ -292,6 +292,9 @@ class TransactionBaseImpl : public Transaction {
|
|||
uint64_t num_deletes_ = 0;
|
||||
uint64_t num_merges_ = 0;
|
||||
|
||||
#if defined(__APPLE__) && _LIBCPP_STD_VER > 14
|
||||
public:
|
||||
#endif
|
||||
struct SavePoint {
|
||||
std::shared_ptr<const Snapshot> snapshot_;
|
||||
bool snapshot_needed_;
|
||||
|
@ -313,7 +316,9 @@ class TransactionBaseImpl : public Transaction {
|
|||
num_deletes_(num_deletes),
|
||||
num_merges_(num_merges) {}
|
||||
};
|
||||
|
||||
#if defined(__APPLE__) && _LIBCPP_STD_VER > 14
|
||||
protected:
|
||||
#endif
|
||||
// Records writes pending in this transaction
|
||||
WriteBatchWithIndex write_batch_;
|
||||
|
||||
|
|
|
@ -25,8 +25,16 @@ endif ()
|
|||
|
||||
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER)
|
||||
|
||||
if (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "deployment target for MacOSX; adjust to your system")
|
||||
if (APPLE)
|
||||
if (NOT CMAKE_OSX_DEPLOYMENT_TARGET OR "${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "")
|
||||
if (NOT DEFINED ENV{MACOSX_DEPLOYMENT_TARGET} OR "ENV{MACOSX_DEPLOYMENT_TARGET}" STREQUAL "")
|
||||
message(FATAL_ERROR "environment variable MACOSX_DEPLOYMENT_TARGET is missing")
|
||||
else ()
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING "deployment target for MacOSX; adjust to your system")
|
||||
endif ()
|
||||
else ()
|
||||
set($ENV{MACOSX_DEPLOYMENT_TARGET} ${CMAKE_OSX_DEPLOYMENT_TARGET})
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# where to find CMAKE modules
|
||||
|
@ -404,7 +412,13 @@ option(HOMEBREW
|
|||
if (WIN32)
|
||||
set(WINDOWS TRUE)
|
||||
set(MSBUILD TRUE)
|
||||
add_definitions(-D_USE_MATH_DEFINES -DNOMINMAX -D_WIN32_WINNT=0x600 -DINCL_EXTRA_HTON_FUNCTIONS -DPSAPI_VERSION=1)
|
||||
|
||||
add_definitions(-D_USE_MATH_DEFINES)
|
||||
add_definitions(-DNOMINMAX)
|
||||
add_definitions(-D_WIN32_WINNT=0x600)
|
||||
add_definitions(-DINCL_EXTRA_HTON_FUNCTIONS)
|
||||
add_definitions(-DPSAPI_VERSION=1)
|
||||
|
||||
elseif (UNIX AND NOT APPLE)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES ".*Linux")
|
||||
set(LINUX TRUE)
|
||||
|
@ -552,11 +566,7 @@ if (CMAKE_COMPILER_IS_GNUCC)
|
|||
endif ()
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC OR APPLE)
|
||||
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6)
|
||||
set(BASE_CXX_FLAGS "${BASE_CXX_FLAGS} -std=c++11")
|
||||
else()
|
||||
set(BASE_CXX_FLAGS "${BASE_CXX_FLAGS} -std=c++14")
|
||||
endif()
|
||||
set(BASE_CXX_FLAGS "${BASE_CXX_FLAGS} -std=c++17")
|
||||
endif ()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
|
@ -587,9 +597,9 @@ if (CMAKE_COMPILER_IS_CLANG)
|
|||
endif ()
|
||||
endif ()
|
||||
|
||||
# need c++14
|
||||
# need c++17
|
||||
# XXX this should really be set on a per target level using cmake compile_features capabilties
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
# need threads
|
||||
find_package(Threads REQUIRED)
|
||||
|
@ -599,6 +609,8 @@ if (MSVC)
|
|||
add_definitions("-D_CRT_SECURE_NO_WARNINGS=1")
|
||||
add_definitions("-DFD_SETSIZE=8192")
|
||||
add_definitions("-DU_STATIC_IMPLEMENTATION=1")
|
||||
add_definitions("-D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS=1") # try to remove this when
|
||||
# boost is upgraded to 1.70 or later
|
||||
|
||||
# https://blogs.msdn.microsoft.com/vcblog/2016/04/14/stl-fixes-in-vs-2015-update-2/
|
||||
# https://connect.microsoft.com/VisualStudio/feedback/details/1892487
|
||||
|
|
2
VERSIONS
2
VERSIONS
|
@ -1,7 +1,9 @@
|
|||
CXX_STANDARD "17"
|
||||
STARTER_REV "0.14.12"
|
||||
SYNCER_REV "0.6.5"
|
||||
GCC_LINUX "8.3.0"
|
||||
MSVC_WINDOWS "2017"
|
||||
MACOS_MIN "10.14"
|
||||
OPENSSL_LINUX "1.1.1"
|
||||
OPENSSL_MACOS "1.1.1"
|
||||
OPENSSL_WINDOWS "1.1.1"
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#define ARANGOD_AQL_PLAN_CACHE_H 1
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
|
||||
#include "Basics/Common.h"
|
||||
#include "Basics/ReadWriteLock.h"
|
||||
|
|
|
@ -905,6 +905,10 @@ target_link_libraries(arangoserver
|
|||
${MSVC_LIBS}
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
target_link_libraries(arangoserver Bcrypt.lib)
|
||||
endif()
|
||||
|
||||
if (USE_ENTERPRISE)
|
||||
add_library(arango_rclone STATIC
|
||||
${LIB_RCLONE_SOURCES}
|
||||
|
|
|
@ -79,6 +79,7 @@
|
|||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <vector>
|
||||
#include <random>
|
||||
|
||||
using namespace arangodb;
|
||||
using namespace arangodb::basics;
|
||||
|
@ -636,7 +637,7 @@ int distributeBabyOnShards(CreateOperationCtx& opCtx,
|
|||
/// @brief compute a shard distribution for a new collection, the list
|
||||
/// dbServers must be a list of DBserver ids to distribute across.
|
||||
/// If this list is empty, the complete current list of DBservers is
|
||||
/// fetched from ClusterInfo and with random_shuffle to mix it up.
|
||||
/// fetched from ClusterInfo and with shuffle to mix it up.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static std::shared_ptr<std::unordered_map<std::string, std::vector<std::string>>> DistributeShardsEvenly(
|
||||
|
@ -651,7 +652,10 @@ static std::shared_ptr<std::unordered_map<std::string, std::vector<std::string>>
|
|||
if (dbServers.empty()) {
|
||||
return shards;
|
||||
}
|
||||
random_shuffle(dbServers.begin(), dbServers.end());
|
||||
|
||||
std::random_device rd;
|
||||
std::mt19937 g(rd());
|
||||
std::shuffle(dbServers.begin(), dbServers.end(), g);
|
||||
}
|
||||
|
||||
// mop: distribute satellite collections on all servers
|
||||
|
@ -2440,9 +2444,11 @@ std::vector<std::shared_ptr<LogicalCollection>> ClusterMethods::persistCollectio
|
|||
}),
|
||||
dbServers.end());
|
||||
}
|
||||
std::random_shuffle(dbServers.begin(), dbServers.end());
|
||||
std::random_device rd;
|
||||
std::mt19937 g(rd());
|
||||
std::shuffle(dbServers.begin(), dbServers.end(), g);
|
||||
shards = DistributeShardsEvenly(ci, numberOfShards, replicationFactor,
|
||||
dbServers, !col->system());
|
||||
dbServers, !col->system());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
#include <velocypack/Iterator.h>
|
||||
#include <velocypack/velocypack-aliases.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <random>
|
||||
|
||||
using namespace arangodb;
|
||||
using namespace arangodb::pregel;
|
||||
|
||||
|
@ -125,7 +128,10 @@ void ArrayInCache<M>::mergeCache(WorkerConfig const& config, InCache<M> const* o
|
|||
// ranomize access to buckets, don't wait for the lock
|
||||
std::set<PregelShard> const& shardIDs = config.localPregelShardIDs();
|
||||
std::vector<PregelShard> randomized(shardIDs.begin(), shardIDs.end());
|
||||
std::random_shuffle(randomized.begin(), randomized.end());
|
||||
|
||||
std::random_device rd;
|
||||
std::mt19937 g(rd());
|
||||
std::shuffle(randomized.begin(), randomized.end(), g);
|
||||
|
||||
size_t i = 0;
|
||||
do {
|
||||
|
@ -240,7 +246,9 @@ void CombiningInCache<M>::mergeCache(WorkerConfig const& config, InCache<M> cons
|
|||
// ranomize access to buckets, don't wait for the lock
|
||||
std::set<PregelShard> const& shardIDs = config.localPregelShardIDs();
|
||||
std::vector<PregelShard> randomized(shardIDs.begin(), shardIDs.end());
|
||||
std::random_shuffle(randomized.begin(), randomized.end());
|
||||
std::random_device rd;
|
||||
std::mt19937 g(rd());
|
||||
std::shuffle(randomized.begin(), randomized.end(), g);
|
||||
|
||||
size_t i = 0;
|
||||
do {
|
||||
|
|
|
@ -72,8 +72,6 @@ std::string currentUser() {
|
|||
namespace arangodb {
|
||||
namespace transaction {
|
||||
|
||||
const size_t Manager::maxTransactionSize; // 128 MiB
|
||||
|
||||
namespace {
|
||||
struct MGMethods final : arangodb::transaction::Methods {
|
||||
MGMethods(std::shared_ptr<arangodb::transaction::Context> const& ctx,
|
||||
|
@ -484,7 +482,7 @@ std::shared_ptr<transaction::Context> Manager::leaseManagedTrx(TRI_voc_tid_t tid
|
|||
if (_disallowInserts.load(std::memory_order_acquire)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
size_t const bucket = getBucket(tid);
|
||||
int i = 0;
|
||||
TransactionState* state = nullptr;
|
||||
|
@ -602,7 +600,7 @@ transaction::Status Manager::getManagedTrxStatus(TRI_voc_tid_t tid) const {
|
|||
return transaction::Status::ABORTED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Result Manager::statusChangeWithTimeout(TRI_voc_tid_t tid, transaction::Status status) {
|
||||
double startTime = 0.0;
|
||||
|
@ -775,7 +773,7 @@ bool Manager::garbageCollect(bool abortAll) {
|
|||
auto it = _transactions[bucket]._managed.begin();
|
||||
while (it != _transactions[bucket]._managed.end()) {
|
||||
ManagedTrx& mtrx = it->second;
|
||||
|
||||
|
||||
if (mtrx.type == MetaType::Managed) {
|
||||
TRI_ASSERT(mtrx.state != nullptr);
|
||||
if (abortAll || mtrx.expired()) {
|
||||
|
@ -813,7 +811,7 @@ bool Manager::garbageCollect(bool abortAll) {
|
|||
// we can also get the TRI_ERROR_LOCKED error in case we cannot
|
||||
// immediately acquire the lock on the transaction. this _can_ happen
|
||||
// infrequently, but is not an error
|
||||
if (res.fail() &&
|
||||
if (res.fail() &&
|
||||
!res.is(TRI_ERROR_TRANSACTION_ABORTED) &&
|
||||
!res.is(TRI_ERROR_LOCKED)) {
|
||||
LOG_TOPIC("0a07f", INFO, Logger::TRANSACTIONS) << "error while aborting "
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
#ifndef ARANGODB_BASICS_MUTEX_H
|
||||
#define ARANGODB_BASICS_MUTEX_H 1
|
||||
|
||||
#if __has_include(<pthread.h>)
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
#include "Basics/operating-system.h"
|
||||
|
||||
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
|
||||
|
|
|
@ -23,6 +23,11 @@
|
|||
#ifndef ARANGOD_FUTURES_BACKPORTS_H
|
||||
#define ARANGOD_FUTURES_BACKPORTS_H 1
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#endif
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace arangodb {
|
||||
|
@ -65,13 +70,15 @@ constexpr auto invoke(M(C::*d), Args&&... args)
|
|||
}
|
||||
|
||||
#else
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
using std::invoke;
|
||||
using in_place_t = std::in_place_t;
|
||||
using in_place = std::in_place;
|
||||
using is_invocable = std::is_invocable;
|
||||
using is_invocable_r = std::is_invocable_r;
|
||||
using invoke = std::invoke;
|
||||
inline constexpr in_place_t in_place{};
|
||||
|
||||
template <class R, class FN, class... ArgTypes>
|
||||
using is_invocable_r = std::is_invocable_r<R, FN, ArgTypes...>;
|
||||
|
||||
template <class FN, class... ArgTypes>
|
||||
using is_invocable = std::is_invocable<FN, ArgTypes...>;
|
||||
#endif
|
||||
|
||||
} // namespace futures
|
||||
|
|
|
@ -283,6 +283,11 @@ target_include_directories(arangodbtests SYSTEM PRIVATE
|
|||
${CMAKE_SOURCE_DIR}/3rdParty/rocksdb/${ARANGO_ROCKSDB_VERSION}/third-party/gtest-1.8.1/fused-src
|
||||
)
|
||||
|
||||
# older macos has no uncaught exceptions
|
||||
if (DARWIN)
|
||||
target_compile_definitions(arangodbtests PUBLIC CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS)
|
||||
endif()
|
||||
|
||||
find_package(OpenSSL REQUIRED)
|
||||
list(APPEND IRESEARCH_LIB_RESOURCES
|
||||
"${LIB_EAY_DEBUG_DLL}"
|
||||
|
|
Loading…
Reference in New Issue