mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
assert that rocksdb versions match during eval
This commit is contained in:
parent
9f4a1578aa
commit
a550d8db1f
1 changed files with 31 additions and 6 deletions
|
|
@ -1,14 +1,39 @@
|
||||||
# Dependencies (keep sorted)
|
# Dependencies (keep sorted)
|
||||||
{ rocksdb
|
{ lib
|
||||||
|
, rocksdb
|
||||||
, rust-jemalloc-sys
|
, rust-jemalloc-sys
|
||||||
|
|
||||||
# Options (keep sorted)
|
# Options (keep sorted)
|
||||||
, enableJemalloc ? false
|
, enableJemalloc ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
rocksdb.override {
|
let
|
||||||
|
rocksdb' = rocksdb.override {
|
||||||
jemalloc = rust-jemalloc-sys;
|
jemalloc = rust-jemalloc-sys;
|
||||||
|
|
||||||
enableLiburing = false;
|
enableLiburing = false;
|
||||||
inherit enableJemalloc;
|
inherit enableJemalloc;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
cVersion = rocksdb'.version;
|
||||||
|
|
||||||
|
rustVersion = builtins.elemAt
|
||||||
|
(lib.splitString
|
||||||
|
"+"
|
||||||
|
(lib.findSingle
|
||||||
|
(x: x.name == "rust-librocksdb-sys")
|
||||||
|
(builtins.throw "Multiple rust-librocksdb-sys versions in Cargo.lock")
|
||||||
|
(builtins.throw "No rust-librocksdb-sys versions in Cargo.lock")
|
||||||
|
(builtins.fromTOML (builtins.readFile ../../../Cargo.lock)).package
|
||||||
|
).version
|
||||||
|
)
|
||||||
|
1;
|
||||||
|
in
|
||||||
|
|
||||||
|
if cVersion == rustVersion
|
||||||
|
then rocksdb'
|
||||||
|
else builtins.throw
|
||||||
|
(builtins.concatStringsSep " " [
|
||||||
|
"C version (${cVersion}) and Rust version (${rustVersion}) of RocksDB do"
|
||||||
|
"not match"
|
||||||
|
])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue