File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 92
92
# We need to remove any inputs which are selected components (see above).
93
93
# `buildInputs`, `propagatedBuildInputs`, and `executableToolDepends` contain component
94
94
# derivations, not packages, so we use `removeSelectedInputs`).
95
- systemInputs = removeSelectedInputs ( lib . concatMap
96
- ( c : c . buildInputs ++ c . propagatedBuildInputs ) selectedComponents ) ;
95
+ #
96
+ # Also, we take care to keep duplicates out of the list, otherwise we may see
97
+ # "Argument list too long" errors from bash when entering a shell.
98
+ #
99
+ # Version of `lib.unique` that should be fast if the name attributes are unique
100
+ uniqueWithName = list :
101
+ lib . concatMap lib . unique (
102
+ builtins . attrValues (
103
+ builtins . groupBy ( x : if __typeOf x == "set" then x . name or "noname" else "notset" ) list ) ) ;
104
+ allSystemInputs = lib . concatMap ( c : c . buildInputs ++ c . propagatedBuildInputs ) selectedComponents ;
105
+ systemInputs = removeSelectedInputs ( uniqueWithName allSystemInputs ) ;
106
+
97
107
nativeBuildInputs = removeSelectedInputs
98
108
( lib . concatMap ( c : c . executableToolDepends ) selectedComponents ) ;
99
109
You can’t perform that action at this time.
0 commit comments