mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 15:21:24 +01:00
do default-feature unification in nix
Some of the features affect nix dependencies, so we need to have a full feature list available when constructing the nix derivation. This incidentally fixes the bug where we weren't enabling jemalloc on rocksdb in CI/devshells, because jemalloc is now a default feature. It does not fix the more general class of that issue, where CI is performing an `--all-features` build in a nix devshell built for default-features. I am now passing `--no-default-features` to cargo, and having it use our unified feature list rather than duplicating the unification inside cargo.
This commit is contained in:
parent
ee43c2ff4c
commit
8f24ac1f27
1 changed files with 11 additions and 7 deletions
|
|
@ -16,7 +16,14 @@
|
|||
}:
|
||||
|
||||
let
|
||||
featureEnabled = feature : builtins.elem feature features;
|
||||
# We perform default-feature unification in nix, because some of the dependencies
|
||||
# on the nix side depend on feature values.
|
||||
allDefaultFeatures =
|
||||
(lib.importTOML "${inputs.self}/Cargo.toml").features.default;
|
||||
features' = lib.unique
|
||||
(features ++ lib.optionals default-features allDefaultFeatures);
|
||||
|
||||
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
|
||||
|
|
@ -96,13 +103,10 @@ craneLib.buildPackage ( commonAttrs // {
|
|||
env = buildDepsOnlyEnv;
|
||||
});
|
||||
|
||||
cargoExtraArgs = "--locked "
|
||||
cargoExtraArgs = "--locked --no-default-features "
|
||||
+ lib.optionalString
|
||||
(!default-features)
|
||||
"--no-default-features "
|
||||
+ lib.optionalString
|
||||
(features != [])
|
||||
"--features " + (builtins.concatStringsSep "," features);
|
||||
(features' != [])
|
||||
"--features " + (builtins.concatStringsSep "," features');
|
||||
|
||||
# This is redundant with CI
|
||||
doCheck = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue