diff options
author | Faye Duxovni <duxovni@duxovni.org> | 2022-04-15 20:13:47 -0400 |
---|---|---|
committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2022-04-27 02:40:40 +0000 |
commit | a94a643de982df1a1e94fb09fb6bc974def243ef (patch) | |
tree | 77148a6b358eb8124888c115e9039cc24384f485 | |
parent | a3917caedfead19f853aa5769de4c3ea4e4db584 (diff) |
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 commit ede639a8d63f2c6da0944cab441955ca16e9cce5)
-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 afb938e511828..20b93b1921f84 100644 --- a/pkgs/build-support/rust/build-rust-crate/default.nix +++ b/pkgs/build-support/rust/build-rust-crate/default.nix @@ -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 ""; |