diff options
| author | John Ericson <git@JohnEricson.me> | 2022-08-07 19:21:33 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-07 19:21:33 -0400 |
| commit | 022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf (patch) | |
| tree | 077c9c340ca76db75bac6549ad92f6e3e891a6f2 | |
| parent | Merge pull request #184824 from obsidiansystems/backport-21.05 (diff) | |
| parent | buildRustCrate: don't try to set CARGO_FEATURE_ variables for dep: features (diff) | |
| download | nixpkgs-origin/release-21.05.tar.gz | |
Merge pull request #185612 from obsidiansystems/buildRustCrate-21.05-no-choke-on-deporigin/release-21.05origin/nixpkgs-21.05-darwinorigin/nixos-21.05-smallorigin/nixos-21.05-aarch64origin/nixos-21.05
[Backport release 21.05] buildRustCrate: don't try to set CARGO_FEATURE_ variables for dep: fe…
| -rw-r--r-- | pkgs/build-support/rust/build-rust-crate/default.nix | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgs/build-support/rust/build-rust-crate/default.nix b/pkgs/build-support/rust/build-rust-crate/default.nix index ab6b867725f1..bc0aa36f17d5 100644 --- a/pkgs/build-support/rust/build-rust-crate/default.nix +++ b/pkgs/build-support/rust/build-rust-crate/default.nix @@ -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 ""; |
