mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 15:21:24 +01:00
move rust-jemalloc-sys to its own file
This commit is contained in:
parent
f07c8c2b6f
commit
2e6bf86a42
3 changed files with 18 additions and 12 deletions
|
|
@ -32,6 +32,10 @@
|
|||
default = prev.default.override args;
|
||||
});
|
||||
|
||||
rust-jemalloc-sys = self.callPackage ./nix/pkgs/rust-jemalloc-sys {
|
||||
inherit (pkgs) rust-jemalloc-sys;
|
||||
};
|
||||
|
||||
shell = self.callPackage ./nix/shell.nix {};
|
||||
|
||||
# The Rust toolchain to use
|
||||
|
|
|
|||
|
|
@ -34,20 +34,10 @@ let
|
|||
|
||||
featureEnabled = feature : builtins.elem feature features';
|
||||
|
||||
# This derivation will set the JEMALLOC_OVERRIDE variable, causing the
|
||||
# tikv-jemalloc-sys crate to use the nixpkgs jemalloc instead of building it's
|
||||
# own. In order for this to work, we need to set flags on the build that match
|
||||
# whatever flags tikv-jemalloc-sys was going to use. These are dependent on
|
||||
# which features we enable in tikv-jemalloc-sys.
|
||||
rust-jemalloc-sys' = (rust-jemalloc-sys.override {
|
||||
# tikv-jemalloc-sys/unprefixed_malloc_on_supported_platforms feature
|
||||
unprefixed = true;
|
||||
});
|
||||
|
||||
buildDepsOnlyEnv =
|
||||
let
|
||||
rocksdb' = rocksdb.override {
|
||||
jemalloc = rust-jemalloc-sys';
|
||||
jemalloc = rust-jemalloc-sys;
|
||||
enableJemalloc = featureEnabled "jemalloc";
|
||||
enableLiburing = false;
|
||||
};
|
||||
|
|
@ -92,7 +82,7 @@ let
|
|||
|
||||
dontStrip = profile == "dev";
|
||||
|
||||
buildInputs = lib.optional (featureEnabled "jemalloc") rust-jemalloc-sys';
|
||||
buildInputs = lib.optional (featureEnabled "jemalloc") rust-jemalloc-sys;
|
||||
|
||||
nativeBuildInputs = [
|
||||
# bindgen needs the build platform's libclang. Apparently due to "splicing
|
||||
|
|
|
|||
12
nix/pkgs/rust-jemalloc-sys/default.nix
Normal file
12
nix/pkgs/rust-jemalloc-sys/default.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# This derivation will set the JEMALLOC_OVERRIDE variable, causing the
|
||||
# tikv-jemalloc-sys crate to use the nixpkgs jemalloc instead of building it's
|
||||
# own. In order for this to work, we need to set flags on the build that match
|
||||
# whatever flags tikv-jemalloc-sys was going to use. These are dependent on
|
||||
# which features we enable in tikv-jemalloc-sys.
|
||||
|
||||
{ rust-jemalloc-sys }:
|
||||
|
||||
rust-jemalloc-sys.override {
|
||||
# tikv-jemalloc-sys/unprefixed_malloc_on_supported_platforms feature
|
||||
unprefixed = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue