Merge branch 'update-rocksdb' into 'next'

update rocksdb

See merge request famedly/conduit!577
This commit is contained in:
Charles Hall 2024-03-11 04:51:40 +00:00
commit 086c4daa38
3 changed files with 55 additions and 46 deletions

71
Cargo.lock generated
View file

@ -204,17 +204,16 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
[[package]] [[package]]
name = "bindgen" name = "bindgen"
version = "0.65.1" version = "0.69.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" checksum = "a4c69fae65a523209d34240b60abe0c42d33d1045d445c0839d8a4894a736e2d"
dependencies = [ dependencies = [
"bitflags 1.3.2", "bitflags 2.4.2",
"cexpr", "cexpr",
"clang-sys", "clang-sys",
"lazy_static", "lazy_static",
"lazycell", "lazycell",
"peeking_take_while", "peeking_take_while",
"prettyplease",
"proc-macro2", "proc-macro2",
"quote", "quote",
"regex", "regex",
@ -400,10 +399,10 @@ dependencies = [
"regex", "regex",
"reqwest", "reqwest",
"ring", "ring",
"rocksdb",
"ruma", "ruma",
"rusqlite", "rusqlite",
"rust-argon2", "rust-argon2",
"rust-rocksdb",
"sd-notify", "sd-notify",
"serde", "serde",
"serde_html_form", "serde_html_form",
@ -1278,22 +1277,6 @@ dependencies = [
"redox_syscall", "redox_syscall",
] ]
[[package]]
name = "librocksdb-sys"
version = "0.11.0+8.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e"
dependencies = [
"bindgen",
"bzip2-sys",
"cc",
"glob",
"libc",
"libz-sys",
"lz4-sys",
"zstd-sys",
]
[[package]] [[package]]
name = "libsqlite3-sys" name = "libsqlite3-sys"
version = "0.26.0" version = "0.26.0"
@ -1790,16 +1773,6 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
name = "prettyplease"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5"
dependencies = [
"proc-macro2",
"syn 2.0.48",
]
[[package]] [[package]]
name = "proc-macro-crate" name = "proc-macro-crate"
version = "2.0.0" version = "2.0.0"
@ -2005,16 +1978,6 @@ dependencies = [
"windows-sys 0.48.0", "windows-sys 0.48.0",
] ]
[[package]]
name = "rocksdb"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe"
dependencies = [
"libc",
"librocksdb-sys",
]
[[package]] [[package]]
name = "ruma" name = "ruma"
version = "0.9.4" version = "0.9.4"
@ -2230,6 +2193,32 @@ dependencies = [
"crossbeam-utils", "crossbeam-utils",
] ]
[[package]]
name = "rust-librocksdb-sys"
version = "0.18.1+8.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ef22f434855ceb8daf99073fcf909d957ad8705f5b530154e47978ae68e867c"
dependencies = [
"bindgen",
"bzip2-sys",
"cc",
"glob",
"libc",
"libz-sys",
"lz4-sys",
"zstd-sys",
]
[[package]]
name = "rust-rocksdb"
version = "0.22.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62223f035e676bb69da2ab9487e6f710da82be89473c658c51ed3b1a60c4b4a6"
dependencies = [
"libc",
"rust-librocksdb-sys",
]
[[package]] [[package]]
name = "rustc-demangle" name = "rustc-demangle"
version = "0.1.23" version = "0.1.23"

View file

@ -97,8 +97,6 @@ threadpool = "1.8.1"
# Used for ruma wrapper # Used for ruma wrapper
serde_html_form = "0.2.0" serde_html_form = "0.2.0"
rocksdb = { version = "0.21.0", default-features = true, features = ["multi-threaded-cf", "zstd"], optional = true }
thread_local = "1.1.7" thread_local = "1.1.7"
# used for TURN server authentication # used for TURN server authentication
hmac = "0.12.1" hmac = "0.12.1"
@ -116,6 +114,14 @@ async-trait = "0.1.68"
sd-notify = { version = "0.4.1", optional = true } sd-notify = { version = "0.4.1", optional = true }
[dependencies.rust-rocksdb]
version = "0.22.7"
optional = true
features = [
"multi-threaded-cf",
"zstd",
]
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]
nix = { version = "0.26.2", features = ["resource"] } nix = { version = "0.26.2", features = ["resource"] }
@ -125,7 +131,7 @@ default = ["conduit_bin", "backend_sqlite", "backend_rocksdb", "systemd"]
backend_persy = ["persy", "parking_lot"] backend_persy = ["persy", "parking_lot"]
backend_sqlite = ["sqlite"] backend_sqlite = ["sqlite"]
#backend_heed = ["heed", "crossbeam"] #backend_heed = ["heed", "crossbeam"]
backend_rocksdb = ["rocksdb"] backend_rocksdb = ["rust-rocksdb"]
jemalloc = ["tikv-jemalloc-ctl", "tikv-jemallocator"] jemalloc = ["tikv-jemalloc-ctl", "tikv-jemallocator"]
sqlite = ["rusqlite", "parking_lot", "tokio/signal"] sqlite = ["rusqlite", "parking_lot", "tokio/signal"]
conduit_bin = ["axum"] conduit_bin = ["axum"]

View file

@ -58,9 +58,23 @@
pkgs.pkgsBuildHost.rustPlatform.bindgenHook pkgs.pkgsBuildHost.rustPlatform.bindgenHook
]; ];
rocksdb' = pkgs:
let
version = "8.11.3";
in
pkgs.rocksdb.overrideAttrs (old: {
inherit version;
src = pkgs.fetchFromGitHub {
owner = "facebook";
repo = "rocksdb";
rev = "v${version}";
hash = "sha256-OpEiMwGxZuxb9o3RQuSrwZMQGLhe9xLT1aa3HpI4KPs=";
};
});
env = pkgs: { env = pkgs: {
ROCKSDB_INCLUDE_DIR = "${pkgs.rocksdb}/include"; ROCKSDB_INCLUDE_DIR = "${rocksdb' pkgs}/include";
ROCKSDB_LIB_DIR = "${pkgs.rocksdb}/lib"; ROCKSDB_LIB_DIR = "${rocksdb' pkgs}/lib";
} }
// pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isStatic { // pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isStatic {
ROCKSDB_STATIC = ""; ROCKSDB_STATIC = "";