Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ckb-rocksdb"
description = "Rust wrapper for Facebook's RocksDB embeddable database"
version = "0.22.2"
version = "0.23.0"
edition = "2024"
authors = ["Tyler Neely <t@jujit.su>", "David Greenberg <dsg123456789@gmail.com>", "Nervos Core Dev <dev@nervos.org>"]
license = "Apache-2.0"
Expand Down Expand Up @@ -35,7 +35,7 @@ rtti = ["librocksdb-sys/rtti"]
[dependencies]
home = "0.5"
libc = "0.2"
librocksdb-sys = { package = "ckb-librocksdb-sys", path = "librocksdb-sys", version = "=9.10.2" }
librocksdb-sys = { package = "ckb-librocksdb-sys", path = "librocksdb-sys", version = "=10.7.5" }
tempfile = "3"
serde = { version = "1", features = ["derive"], optional = true }

Expand Down
4 changes: 2 additions & 2 deletions librocksdb-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ckb-librocksdb-sys"
version = "9.10.2"
version = "10.7.5"
edition = "2024"
authors = ["Karl Hobley <karlhobley10@gmail.com>", "Arkadiy Paronyan <arkadiy@ethcore.io>", "Nervos Core Dev <dev@nervos.org>"]
license = "MIT/Apache-2.0/BSD-3-Clause"
Expand Down Expand Up @@ -51,6 +51,6 @@ uuid = { version = "1.0", features = ["v4"] }
[build-dependencies]
cc = { version = "1.0", features = ["parallel"] }
bindgen = { version = "0.72.1" }
glob = "0.3.2"
glob = "0.3.3"
pkg-config = "0.3"
rust-ini = "0.21"
13 changes: 6 additions & 7 deletions librocksdb-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,11 @@ fn build_rocksdb() {
// Add Windows-specific sources
lib_sources.extend([
"port/win/env_default.cc",
"port/win/port_win.cc",
"port/win/xpress_win.cc",
"port/win/io_win.cc",
"port/win/win_thread.cc",
"port/win/env_win.cc",
"port/win/io_win.cc",
"port/win/port_win.cc",
"port/win/win_logger.cc",
"port/win/win_thread.cc",
]);

if cfg!(feature = "jemalloc") {
Expand All @@ -282,7 +281,7 @@ fn build_rocksdb() {

if target.contains("msvc") {
config.flag("-EHsc");
config.flag("-std:c++17");
config.flag("-std:c++20");
} else {
// matches the flags in CMakeLists.txt from rocksdb
config.flag("-Wsign-compare");
Expand Down Expand Up @@ -313,7 +312,7 @@ fn build_rocksdb() {
}
}

config.flag_if_supported("-std=c++17");
config.flag_if_supported("-std=c++20");
if !target.contains("windows") {
config.flag("-include").flag("cstdint");
}
Expand Down Expand Up @@ -485,7 +484,7 @@ fn try_to_find_and_link_lib(lib_name: &str) -> bool {
}

fn cxx_standard() -> String {
env::var("ROCKSDB_CXX_STD").map_or("-std=c++17".to_owned(), |cxx_std| {
env::var("ROCKSDB_CXX_STD").map_or("-std=c++20".to_owned(), |cxx_std| {
if !cxx_std.starts_with("-std=") {
format!("-std={}", cxx_std)
} else {
Expand Down
34 changes: 26 additions & 8 deletions librocksdb-sys/build_detect_platform
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,43 @@
# exit 1
# fi

# we depend on C++17, but should be compatible with newer standards
# we depend on C++20, but should be compatible with newer standards
if [ "$ROCKSDB_CXX_STANDARD" ]; then
PLATFORM_CXXFLAGS="-std=$ROCKSDB_CXX_STANDARD"
else
PLATFORM_CXXFLAGS="-std=c++17"
PLATFORM_CXXFLAGS="-std=c++20"
fi

# we currently depend on POSIX platform
COMMON_FLAGS="-DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX"

# Default to fbcode gcc on internal fb machines
if [ -z "$ROCKSDB_NO_FBCODE" -a -d /mnt/gvfs/third-party ]; then
# Default to fbcode gcc on Meta internal machines
IS_META_HOST="$(hostname | grep -E '(facebook|meta).com|fbinfra.net')"
if [ -z "$ROCKSDB_NO_FBCODE" -a "$IS_META_HOST" ]; then
if [ -d /mnt/gvfs/third-party ]; then
echo "NOTE: Using fbcode build" >&2
FBCODE_BUILD="true"
# If we're compiling with TSAN or shared lib, we need pic build
PIC_BUILD=$COMPILE_WITH_TSAN
if [ "$LIB_MODE" == "shared" ]; then
PIC_BUILD=1
fi
source "$PWD/build_tools/fbcode_config_platform010.sh"
else
echo "************************************************************************" >&2
echo "WARNING: -d /mnt/gvfs/third-party failed; no fbcode build" >&2
echo "************************************************************************" >&2
fi
fi

# Delete existing output, if it exists
# rm -f "$OUTPUT"
# touch "$OUTPUT"

if test -z "$CC"; then
if [ -x "$(command -v cc)" ]; then
if [ "$USE_CLANG" -a -x "$(command -v clang)" ]; then
CC=clang
elif [ -x "$(command -v cc)" ]; then
CC=cc
elif [ -x "$(command -v clang)" ]; then
CC=clang
Expand All @@ -81,7 +91,9 @@ if test -z "$CC"; then
fi

if test -z "$CXX"; then
if [ -x "$(command -v g++)" ]; then
if [ "$USE_CLANG" -a -x "$(command -v clang++)" ]; then
CXX=clang++
elif [ -x "$(command -v g++)" ]; then
CXX=g++
elif [ -x "$(command -v clang++)" ]; then
CXX=clang++
Expand All @@ -91,7 +103,9 @@ if test -z "$CXX"; then
fi

if test -z "$AR"; then
if [ -x "$(command -v gcc-ar)" ]; then
if [ "$USE_CLANG" -a -x "$(command -v llvm-ar)" ]; then
AR=llvm-ar
elif [ -x "$(command -v gcc-ar)" ]; then
AR=gcc-ar
elif [ -x "$(command -v llvm-ar)" ]; then
AR=llvm-ar
Expand Down Expand Up @@ -360,9 +374,13 @@ EOF
fi

if ! test $ROCKSDB_DISABLE_ZSTD; then
# Test whether zstd library is installed
# Test whether zstd library is installed with minimum version
# (Keep in sync with compression.h)
$CXX $PLATFORM_CXXFLAGS $COMMON_FLAGS -x c++ - -o /dev/null 2>/dev/null <<EOF
#include <zstd.h>
#if ZSTD_VERSION_NUMBER < 10400
#error "ZSTD support requires version >= 1.4.0 (libzstd-devel)"
#endif // ZSTD_VERSION_NUMBER
int main() {}
EOF
if [ "$?" = 0 ]; then
Expand Down
8 changes: 4 additions & 4 deletions librocksdb-sys/build_version.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@

// 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:ae8fb3e5000e46d8d4c9dbf3a36019c0aaceebff";
static const std::string rocksdb_build_git_tag = "rocksdb_build_git_tag:v9.10.0";
static const std::string rocksdb_build_git_sha = "rocksdb_build_git_sha:812b12bc7827eb0589927befc1514cff86eb46c6";
static const std::string rocksdb_build_git_tag = "rocksdb_build_git_tag:v10.7.5";
#define HAS_GIT_CHANGES 0
#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:2024-12-16 19:17:27";
static const std::string rocksdb_build_date = "rocksdb_build_date:2025-10-20 11:17:17";
#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:2024-12-16 19:17:27";
static const std::string rocksdb_build_date = "rocksdb_build_date:2025-12-10 03:21:06";
#endif

extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion librocksdb-sys/rocksdb
Submodule rocksdb updated 640 files
6 changes: 6 additions & 0 deletions librocksdb-sys/rocksdb_lib_sources.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ db/memtable.cc
db/memtable_list.cc
db/merge_helper.cc
db/merge_operator.cc
db/multi_scan.cc
db/output_validator.cc
db/periodic_task_scheduler.cc
db/range_del_aggregator.cc
Expand Down Expand Up @@ -203,6 +204,7 @@ table/block_fetcher.cc
table/cuckoo/cuckoo_table_builder.cc
table/cuckoo/cuckoo_table_factory.cc
table/cuckoo/cuckoo_table_reader.cc
table/external_table.cc
table/format.cc
table/get_context.cc
table/iterator.cc
Expand Down Expand Up @@ -234,6 +236,7 @@ trace_replay/trace_replay.cc
trace_replay/block_cache_tracer.cc
trace_replay/io_tracer.cc
util/async_file_reader.cc
util/auto_tune_compressor.cc
util/build_version.cc
util/cleanable.cc
util/coding.cc
Expand All @@ -253,6 +256,7 @@ util/rate_limiter.cc
util/ribbon_config.cc
util/slice.cc
util/file_checksum_helper.cc
util/simple_mixed_compressor.cc
util/status.cc
util/stderr_logger.cc
util/string_util.cc
Expand Down Expand Up @@ -302,6 +306,8 @@ utilities/persistent_cache/block_cache_tier_file.cc
utilities/persistent_cache/block_cache_tier_metadata.cc
utilities/persistent_cache/persistent_cache_tier.cc
utilities/persistent_cache/volatile_tier_impl.cc
utilities/secondary_index/secondary_index_iterator.cc
utilities/secondary_index/simple_secondary_index.cc
utilities/simulator_cache/cache_simulator.cc
utilities/simulator_cache/sim_cache.cc
utilities/table_properties_collectors/compact_for_tiering_collector.cc
Expand Down