mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 23:31:24 +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)
|
||||
{ rocksdb
|
||||
{ lib
|
||||
, rocksdb
|
||||
, rust-jemalloc-sys
|
||||
|
||||
# Options (keep sorted)
|
||||
, enableJemalloc ? false
|
||||
}:
|
||||
|
||||
rocksdb.override {
|
||||
jemalloc = rust-jemalloc-sys;
|
||||
let
|
||||
rocksdb' = rocksdb.override {
|
||||
jemalloc = rust-jemalloc-sys;
|
||||
|
||||
enableLiburing = false;
|
||||
inherit enableJemalloc;
|
||||
}
|
||||
enableLiburing = false;
|
||||
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