Skip to content

Commit

Permalink
Add "oldcpu" feature to switch to rocksdb v0.12
Browse files Browse the repository at this point in the history
The v0.13 release does not work well with some old CPU models, see:

romanz/electrs#193
rust-rocksdb/rust-rocksdb#327
rust-rocksdb/rust-rocksdb#363
  • Loading branch information
shesek committed Mar 18, 2020
1 parent 3a9d20d commit c251a38
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ readme = "README.md"
edition = "2018"

[features]
default = []
default = [ "rocksdb" ]
liquid = ["elements", "lazy_static"]
oldcpu = [ "rocksdb-oldcpu" ]

[dependencies]
arraydeque = "0.4"
Expand All @@ -39,7 +40,8 @@ num_cpus = "1.12.0"
page_size = "0.4.2"
prometheus = "0.7"
rayon = "1.3.0"
rocksdb = "0.13.0"
rocksdb = { version = "0.13.0", optional = true }
rocksdb-oldcpu = { version = "0.12.4", optional = true, package = "rocksdb" }
rust-crypto = "0.2"
serde = "1.0.104"
serde_derive = "1.0.104"
Expand Down
7 changes: 6 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@ extern crate num_cpus;
extern crate page_size;
extern crate prometheus;
extern crate rayon;
extern crate rocksdb;
extern crate serde;
extern crate stderrlog;
extern crate sysconf;
extern crate time;
extern crate tiny_http;
extern crate url;

// See https://github.com/romanz/electrs/issues/193 & https://github.com/rust-rocksdb/rust-rocksdb/issues/327
#[cfg(not(feature = "oldcpu"))]
extern crate rocksdb;
#[cfg(feature = "oldcpu")]
extern crate rocksdb_oldcpu as rocksdb;

#[macro_use]
extern crate chan;
#[macro_use]
Expand Down

0 comments on commit c251a38

Please sign in to comment.