From db72710500a80bdf4589b6807d2491a4a0dae3ad Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Tue, 21 Feb 2023 18:12:24 +0300 Subject: [PATCH] fix(rust): filter out more attributes from devshells, fixes devshell build --- src/subsystems/rust/builders/devshell.nix | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/subsystems/rust/builders/devshell.nix b/src/subsystems/rust/builders/devshell.nix index fd658de9..e1e890c9 100644 --- a/src/subsystems/rust/builders/devshell.nix +++ b/src/subsystems/rust/builders/devshell.nix @@ -13,15 +13,17 @@ # illegal env names to be removed and not be added to the devshell illegalEnvNames = [ + "src" "name" "pname" "version" - "all" "args" - "drvPath" - "drvAttrs" - "outPath" "stdenv" + "builder" + "outputs" + "phases" + # cargo artifact and vendoring derivations + # we don't need these in the devshell "cargoArtifacts" "dream2nixVendorDir" "cargoVendorDir" @@ -54,12 +56,16 @@ combineEnvs = envs: l.foldl' ( - all: env: + all: env: let + mergeInputs = name: (all.${name} or []) ++ (env.${name} or []); + in all // env // { - buildInputs = (all.buildInputs or []) ++ (env.buildInputs or []); - nativeBuildInputs = (all.nativeBuildInputs or []) ++ (env.nativeBuildInputs or []); + buildInputs = mergeInputs "buildInputs"; + nativeBuildInputs = mergeInputs "nativeBuildInputs"; + propagatedBuildInputs = mergeInputs "propagatedBuildInputs"; + propagatedNativeBuildInputs = mergeInputs "propagatedNativeBuildInputs"; } ) {}