Skip to content

Commit 8f9a9ac

Browse files
committed
flake: 🪨 link against rocksdb
see penumbra-zone/penumbra#4496. this is a replication of the seame change; adding rocksdb as a build input, and setting an environment variable to point the penumbra repository's `librocksdb-sys` dependency's build script at that package's static library. this spares our builds the task of compiling the rocksdb database from source.
1 parent 6b6eb40 commit 8f9a9ac

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎flake.nix

+6-4
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,27 @@
3030
# Important environment variables so that the build can find the necessary libraries
3131
PKG_CONFIG_PATH="${pkgs.openssl.dev}/lib/pkgconfig";
3232
LIBCLANG_PATH="${pkgs.libclang.lib}/lib";
33+
ROCKSDB_LIB_DIR="${pkgs.rocksdb.out}/lib";
3334
in with pkgs; with pkgs.lib; let
3435
galileo = (craneLib.buildPackage {
35-
inherit src system PKG_CONFIG_PATH LIBCLANG_PATH;
36+
inherit src system PKG_CONFIG_PATH LIBCLANG_PATH ROCKSDB_LIB_DIR;
3637
pname = "galileo";
3738
version = "0.1.0";
3839
nativeBuildInputs = [ pkg-config ];
39-
buildInputs = [ clang openssl ];
40+
buildInputs = [ clang openssl rocksdb ];
4041
# A lockfile is not used in this repository.
4142
cargoVendorDir = null;
4243
}).overrideAttrs (_: { doCheck = false; }); # Disable tests to improve build times
4344
in {
4445
inherit galileo;
4546
devShells.default = craneLib.devShell {
46-
inherit LIBCLANG_PATH;
47+
inherit LIBCLANG_PATH ROCKSDB_LIB_DIR;
4748
inputsFrom = [ galileo ];
48-
packages = [ cargo-watch cargo-nextest ];
49+
packages = [ cargo-watch cargo-nextest rocksdb ];
4950
shellHook = ''
5051
export LIBCLANG_PATH=${LIBCLANG_PATH}
5152
export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc} # Required for rust-analyzer
53+
export ROCKSDB_LIB_DIR=${ROCKSDB_LIB_DIR}
5254
'';
5355
};
5456
}

0 commit comments

Comments
 (0)