Skip to content

Commit

Permalink
Bump rocksdb up to 6.15.4 (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Anyshchenko committed Jan 22, 2021
1 parent ff5640a commit 3d32011
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -27,7 +27,7 @@ bzip2 = ["librocksdb-sys/bzip2"]

[dependencies]
libc = "0.2"
librocksdb-sys = { path = "librocksdb-sys", version = "6.11.4" }
librocksdb-sys = { path = "librocksdb-sys", version = "6.15.4" }

[dev-dependencies]
trybuild = "1.0.21"
Expand Down
2 changes: 1 addition & 1 deletion librocksdb-sys/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "librocksdb-sys"
version = "6.11.4"
version = "6.15.4"
edition = "2018"
authors = ["Karl Hobley <karlhobley10@gmail.com>", "Arkadiy Paronyan <arkadiy@ethcore.io>"]
license = "MIT/Apache-2.0/BSD-3-Clause"
Expand Down
42 changes: 26 additions & 16 deletions librocksdb-sys/build.rs
Expand Up @@ -115,32 +115,36 @@ fn build_rocksdb() {
}

if target.contains("darwin") {
config.define("OS_MACOSX", Some("1"));
config.define("ROCKSDB_PLATFORM_POSIX", Some("1"));
config.define("ROCKSDB_LIB_IO_POSIX", Some("1"));
config.define("OS_MACOSX", None);
config.define("ROCKSDB_PLATFORM_POSIX", None);
config.define("ROCKSDB_LIB_IO_POSIX", None);
} else if target.contains("android") {
config.define("OS_ANDROID", Some("1"));
config.define("ROCKSDB_PLATFORM_POSIX", Some("1"));
config.define("ROCKSDB_LIB_IO_POSIX", Some("1"));
config.define("OS_ANDROID", None);
config.define("ROCKSDB_PLATFORM_POSIX", None);
config.define("ROCKSDB_LIB_IO_POSIX", None);
} else if target.contains("linux") {
config.define("OS_LINUX", Some("1"));
config.define("ROCKSDB_PLATFORM_POSIX", Some("1"));
config.define("ROCKSDB_LIB_IO_POSIX", Some("1"));
config.define("OS_LINUX", None);
config.define("ROCKSDB_PLATFORM_POSIX", None);
config.define("ROCKSDB_LIB_IO_POSIX", None);
} else if target.contains("freebsd") {
config.define("OS_FREEBSD", Some("1"));
config.define("ROCKSDB_PLATFORM_POSIX", Some("1"));
config.define("ROCKSDB_LIB_IO_POSIX", Some("1"));
config.define("OS_FREEBSD", None);
config.define("ROCKSDB_PLATFORM_POSIX", None);
config.define("ROCKSDB_LIB_IO_POSIX", None);
} else if target.contains("windows") {
link("rpcrt4", false);
link("shlwapi", false);
config.define("OS_WIN", Some("1"));
config.define("ROCKSDB_WINDOWS_UTF8_FILENAMES", Some("1"));
config.define("DWIN32", None);
config.define("OS_WIN", None);
config.define("_MBCS", None);
config.define("WIN64", None);
config.define("NOMINMAX", None);

if &target == "x86_64-pc-windows-gnu" {
// Tell MinGW to create localtime_r wrapper of localtime_s function.
config.define("_POSIX_C_SOURCE", None);
config.define("_POSIX_C_SOURCE", Some("1"));
// Tell MinGW to use at least Windows Vista headers instead of the ones of Windows XP.
// (This is minimum supported version of rocksdb)
config.define("_WIN32_WINNT", Some("0x0600"));
config.define("_WIN32_WINNT", Some("_WIN32_WINNT_VISTA"));
}

// Remove POSIX-specific sources
Expand Down Expand Up @@ -306,6 +310,12 @@ fn build_bzip2() {
}

fn try_to_find_and_link_lib(lib_name: &str) -> bool {
if let Ok(v) = env::var(&format!("{}_COMPILE", lib_name)) {
if v.to_lowercase() == "true" || v == "1" {
return false;
}
}

if let Ok(lib_dir) = env::var(&format!("{}_LIB_DIR", lib_name)) {
println!("cargo:rustc-link-search=native={}", lib_dir);
let mode = match env::var_os(&format!("{}_STATIC", lib_name)) {
Expand Down
4 changes: 2 additions & 2 deletions librocksdb-sys/build_version.cc
@@ -1,4 +1,4 @@
#include "build_version.h"
const char* rocksdb_build_git_sha = "rocksdb_build_git_sha:@48bfca38f6f175435052a59791922a1a453d9609@";
const char* rocksdb_build_git_date = "rocksdb_build_git_date:@2020/07/15 17:54:15@";
const char* rocksdb_build_git_sha = "rocksdb_build_git_sha:@fbed72f03c3d9e4fdca3e5993587ef2559ba6ab9@";
const char* rocksdb_build_git_date = "rocksdb_build_git_date:@2021/01/21 12:41:08@";
const char* rocksdb_build_compile_date = __DATE__;
2 changes: 1 addition & 1 deletion librocksdb-sys/rocksdb
Submodule rocksdb updated 572 files
15 changes: 13 additions & 2 deletions librocksdb-sys/rocksdb_lib_sources.txt
Expand Up @@ -4,10 +4,13 @@ cache/lru_cache.cc
cache/sharded_cache.cc
db/arena_wrapped_db_iter.cc
db/blob/blob_file_addition.cc
db/blob/blob_file_builder.cc
db/blob/blob_file_cache.cc
db/blob/blob_file_garbage.cc
db/blob/blob_file_meta.cc
db/blob/blob_file_reader.cc
db/blob/blob_log_format.cc
db/blob/blob_log_reader.cc
db/blob/blob_log_sequential_reader.cc
db/blob/blob_log_writer.cc
db/builder.cc
db/c.cc
Expand Down Expand Up @@ -53,6 +56,8 @@ db/memtable.cc
db/memtable_list.cc
db/merge_helper.cc
db/merge_operator.cc
db/output_validator.cc
db/periodic_work_scheduler.cc
db/range_del_aggregator.cc
db/range_tombstone_fragmenter.cc
db/repair.cc
Expand All @@ -65,6 +70,7 @@ db/version_builder.cc
db/version_edit.cc
db/version_edit_handler.cc
db/version_set.cc
db/wal_edit.cc
db/wal_manager.cc
db/write_batch.cc
db/write_batch_base.cc
Expand Down Expand Up @@ -118,6 +124,8 @@ monitoring/thread_status_updater_debug.cc
monitoring/thread_status_util.cc
monitoring/thread_status_util_debug.cc
options/cf_options.cc
options/configurable.cc
options/customizable.cc
options/db_options.cc
options/options.cc
options/options_helper.cc
Expand Down Expand Up @@ -169,6 +177,7 @@ table/plain/plain_table_reader.cc
table/sst_file_dumper.cc
table/sst_file_reader.cc
table/sst_file_writer.cc
table/table_factory.cc
table/table_properties.cc
table/two_level_iterator.cc
test_util/sync_point.cc
Expand Down Expand Up @@ -235,14 +244,16 @@ utilities/simulator_cache/cache_simulator.cc
utilities/simulator_cache/sim_cache.cc
utilities/table_properties_collectors/compact_on_deletion_collector.cc
utilities/trace/file_trace_reader_writer.cc
utilities/transactions/lock/lock_manager.cc
utilities/transactions/lock/point/point_lock_tracker.cc
utilities/transactions/lock/point/point_lock_manager.cc
utilities/transactions/optimistic_transaction.cc
utilities/transactions/optimistic_transaction_db_impl.cc
utilities/transactions/pessimistic_transaction.cc
utilities/transactions/pessimistic_transaction_db.cc
utilities/transactions/snapshot_checker.cc
utilities/transactions/transaction_base.cc
utilities/transactions/transaction_db_mutex_impl.cc
utilities/transactions/transaction_lock_mgr.cc
utilities/transactions/transaction_util.cc
utilities/transactions/write_prepared_txn.cc
utilities/transactions/write_prepared_txn_db.cc
Expand Down
5 changes: 1 addition & 4 deletions tests/test_column_family.rs
Expand Up @@ -48,10 +48,7 @@ fn test_column_family() {
specifying column
families"
),
Err(e) => assert!(e.to_string().starts_with(
"Invalid argument: You have to open all \
column families."
)),
Err(e) => assert!(e.to_string().starts_with("Invalid argument")),
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/test_iterator.rs
Expand Up @@ -300,7 +300,7 @@ fn test_full_iterator() {
}
}

fn custom_iter<'a>(db: &'a DB) -> impl Iterator<Item = usize> + 'a {
fn custom_iter(db: &'_ DB) -> impl Iterator<Item = usize> + '_ {
db.iterator(IteratorMode::Start)
.map(|(_, db_value)| db_value.len())
}
Expand Down

0 comments on commit 3d32011

Please sign in to comment.