mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-06 05:13:37 +00:00
buildRustCrate: don't try to set CARGO_FEATURE_ variables for dep: features
These features are internal-only, have special characters that bash doesn't support in variable names, and aren't normally given environment variables by cargo as far as I can tell. (cherry picked from commitede639a8d6) (cherry picked from commita94a643de9)
This commit is contained in:
committed by
John Ericson
parent
7ca652795e
commit
d5baefeb34
@@ -257,9 +257,14 @@ stdenv.mkDerivation (rec {
|
||||
|
||||
# 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 "";
|
||||
|
||||
Reference in New Issue
Block a user