mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +00:00
Update RocksDB to version 6.27.3
This commit is contained in:
@@ -8,7 +8,7 @@ set_target_properties (rocksdb_lib
|
|||||||
|
|
||||||
option (local_rocksdb "use local build of rocksdb." OFF)
|
option (local_rocksdb "use local build of rocksdb." OFF)
|
||||||
if (NOT local_rocksdb)
|
if (NOT local_rocksdb)
|
||||||
find_package (RocksDB 6.7 QUIET CONFIG)
|
find_package (RocksDB 6.27 QUIET CONFIG)
|
||||||
if (TARGET RocksDB::rocksdb)
|
if (TARGET RocksDB::rocksdb)
|
||||||
message (STATUS "Found RocksDB using config.")
|
message (STATUS "Found RocksDB using config.")
|
||||||
get_target_property (_rockslib_l RocksDB::rocksdb IMPORTED_LOCATION_DEBUG)
|
get_target_property (_rockslib_l RocksDB::rocksdb IMPORTED_LOCATION_DEBUG)
|
||||||
@@ -40,7 +40,7 @@ if (NOT local_rocksdb)
|
|||||||
# TBD if there is some way to extract transitive deps..then:
|
# TBD if there is some way to extract transitive deps..then:
|
||||||
#set (RocksDB_USE_STATIC ON)
|
#set (RocksDB_USE_STATIC ON)
|
||||||
else ()
|
else ()
|
||||||
find_package (RocksDB 6.7 MODULE)
|
find_package (RocksDB 6.27 MODULE)
|
||||||
if (ROCKSDB_FOUND)
|
if (ROCKSDB_FOUND)
|
||||||
if (RocksDB_LIBRARY_DEBUG)
|
if (RocksDB_LIBRARY_DEBUG)
|
||||||
set_target_properties (rocksdb_lib PROPERTIES IMPORTED_LOCATION_DEBUG ${RocksDB_LIBRARY_DEBUG})
|
set_target_properties (rocksdb_lib PROPERTIES IMPORTED_LOCATION_DEBUG ${RocksDB_LIBRARY_DEBUG})
|
||||||
@@ -60,7 +60,7 @@ if (local_rocksdb)
|
|||||||
ExternalProject_Add (rocksdb
|
ExternalProject_Add (rocksdb
|
||||||
PREFIX ${nih_cache_path}
|
PREFIX ${nih_cache_path}
|
||||||
GIT_REPOSITORY https://github.com/facebook/rocksdb.git
|
GIT_REPOSITORY https://github.com/facebook/rocksdb.git
|
||||||
GIT_TAG v6.7.3
|
GIT_TAG v6.27.3
|
||||||
PATCH_COMMAND
|
PATCH_COMMAND
|
||||||
# only used by windows build
|
# only used by windows build
|
||||||
${CMAKE_COMMAND} -E copy_if_different
|
${CMAKE_COMMAND} -E copy_if_different
|
||||||
@@ -96,9 +96,13 @@ if (local_rocksdb)
|
|||||||
-Dlz4_FOUND=ON
|
-Dlz4_FOUND=ON
|
||||||
-USNAPPY_*
|
-USNAPPY_*
|
||||||
-Usnappy_*
|
-Usnappy_*
|
||||||
|
-USnappy_*
|
||||||
-Dsnappy_INCLUDE_DIRS=$<JOIN:$<TARGET_PROPERTY:snappy_lib,INTERFACE_INCLUDE_DIRECTORIES>,::>
|
-Dsnappy_INCLUDE_DIRS=$<JOIN:$<TARGET_PROPERTY:snappy_lib,INTERFACE_INCLUDE_DIRECTORIES>,::>
|
||||||
-Dsnappy_LIBRARIES=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_RELEASE>>
|
-Dsnappy_LIBRARIES=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_RELEASE>>
|
||||||
-Dsnappy_FOUND=ON
|
-Dsnappy_FOUND=ON
|
||||||
|
-DSnappy_INCLUDE_DIRS=$<JOIN:$<TARGET_PROPERTY:snappy_lib,INTERFACE_INCLUDE_DIRECTORIES>,::>
|
||||||
|
-DSnappy_LIBRARIES=$<IF:$<CONFIG:Debug>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_DEBUG>,$<TARGET_PROPERTY:snappy_lib,IMPORTED_LOCATION_RELEASE>>
|
||||||
|
-DSnappy_FOUND=ON
|
||||||
-DWITH_MD_LIBRARY=OFF
|
-DWITH_MD_LIBRARY=OFF
|
||||||
-DWITH_RUNTIME_DEBUG=$<IF:$<CONFIG:Debug>,ON,OFF>
|
-DWITH_RUNTIME_DEBUG=$<IF:$<CONFIG:Debug>,ON,OFF>
|
||||||
-DFAIL_ON_WARNINGS=OFF
|
-DFAIL_ON_WARNINGS=OFF
|
||||||
|
|||||||
@@ -1,4 +1,71 @@
|
|||||||
#include "build_version.h"
|
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||||
const char* rocksdb_build_git_sha = "rocksdb_build_git_sha: N/A";
|
|
||||||
const char* rocksdb_build_git_date = "rocksdb_build_git_date: N/A";
|
#include <memory>
|
||||||
const char* rocksdb_build_compile_date = "N/A";
|
|
||||||
|
#include "rocksdb/version.h"
|
||||||
|
#include "util/string_util.h"
|
||||||
|
|
||||||
|
// The build script may replace these values with real values based
|
||||||
|
// on whether or not GIT is available and the platform settings
|
||||||
|
static const std::string rocksdb_build_git_sha = "rocksdb_build_git_sha:@GIT_SHA@";
|
||||||
|
static const std::string rocksdb_build_git_tag = "rocksdb_build_git_tag:@GIT_TAG@";
|
||||||
|
#define HAS_GIT_CHANGES @GIT_MOD@
|
||||||
|
#if HAS_GIT_CHANGES == 0
|
||||||
|
// If HAS_GIT_CHANGES is 0, the GIT date is used.
|
||||||
|
// Use the time the branch/tag was last modified
|
||||||
|
static const std::string rocksdb_build_date = "rocksdb_build_date:@GIT_DATE@";
|
||||||
|
#else
|
||||||
|
// If HAS_GIT_CHANGES is > 0, the branch/tag has modifications.
|
||||||
|
// Use the time the build was created.
|
||||||
|
static const std::string rocksdb_build_date = "rocksdb_build_date:@BUILD_DATE@";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace ROCKSDB_NAMESPACE {
|
||||||
|
static void AddProperty(std::unordered_map<std::string, std::string> *props, const std::string& name) {
|
||||||
|
size_t colon = name.find(":");
|
||||||
|
if (colon != std::string::npos && colon > 0 && colon < name.length() - 1) {
|
||||||
|
// If we found a "@:", then this property was a build-time substitution that failed. Skip it
|
||||||
|
size_t at = name.find("@", colon);
|
||||||
|
if (at != colon + 1) {
|
||||||
|
// Everything before the colon is the name, after is the value
|
||||||
|
(*props)[name.substr(0, colon)] = name.substr(colon + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::unordered_map<std::string, std::string>* LoadPropertiesSet() {
|
||||||
|
auto * properties = new std::unordered_map<std::string, std::string>();
|
||||||
|
AddProperty(properties, rocksdb_build_git_sha);
|
||||||
|
AddProperty(properties, rocksdb_build_git_tag);
|
||||||
|
AddProperty(properties, rocksdb_build_date);
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::unordered_map<std::string, std::string>& GetRocksBuildProperties() {
|
||||||
|
static std::unique_ptr<std::unordered_map<std::string, std::string>> props(LoadPropertiesSet());
|
||||||
|
return *props;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string GetRocksVersionAsString(bool with_patch) {
|
||||||
|
std::string version = ToString(ROCKSDB_MAJOR) + "." + ToString(ROCKSDB_MINOR);
|
||||||
|
if (with_patch) {
|
||||||
|
return version + "." + ToString(ROCKSDB_PATCH);
|
||||||
|
} else {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string GetRocksBuildInfoAsString(const std::string& program, bool verbose) {
|
||||||
|
std::string info = program + " (RocksDB) " + GetRocksVersionAsString(true);
|
||||||
|
if (verbose) {
|
||||||
|
for (const auto& it : GetRocksBuildProperties()) {
|
||||||
|
info.append("\n ");
|
||||||
|
info.append(it.first);
|
||||||
|
info.append(": ");
|
||||||
|
info.append(it.second);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
} // namespace ROCKSDB_NAMESPACE
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user