Merge pull request #170555 from NixOS/backport-168865-to-release-21.11

[Backport release-21.11] buildRustCrate: don't try to set CARGO_FEATURE_ variables for `dep:` features
This commit is contained in:
Artturi
2022-05-04 05:36:45 +03:00
committed by GitHub

View File

@@ -277,9 +277,14 @@ crate_: lib.makeOverridable
# Create a list of features that are enabled by the crate itself and
# through the features argument of buildRustCrate. Exclude features
# with a forward slash, since they are passed through to dependencies.
# with a forward slash, since they are passed through to dependencies,
# and dep: features, since they're internal-only and do nothing except
# enable optional dependencies.
crateFeatures = lib.optionals (crate ? features)
(builtins.filter (f: !lib.hasInfix "/" f) (crate.features ++ features));
(builtins.filter
(f: !(lib.hasInfix "/" f || lib.hasPrefix "dep:" f))
(crate.features ++ features)
);
libName = if crate ? libName then crate.libName else crate.crateName;
libPath = if crate ? libPath then crate.libPath else "";