File tree 2 files changed +13
-5
lines changed
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 239
239
executableToolDepends =
240
240
( lib . concatMap ( c : if c . isHaskell or false
241
241
then builtins . attrValues ( c . components . exes or { } )
242
- else [ c ] )
243
- ( builtins . filter ( x : ! ( isNull x ) )
244
- ( map
242
+ else [ c ] )
243
+ ( builtins . filter ( x : ! ( isNull x )
244
+ # We always exclude hsc2hs from build-tools because it is unecessary as it is provided by ghc
245
+ # and hsc2hs from ghc is first in PATH so the one from build-tools is never used.
246
+ && x . identifier . name or "" != "hsc2hs" )
247
+ ( map
245
248
( p : if builtins . isFunction p
246
249
then p { inherit ( package . identifier ) version ; inherit revision ; }
247
250
else p ) build-tools ) ) ) ++
328
331
outputHashMode = "recursive" ;
329
332
outputHashAlgo = "sha256" ;
330
333
} ;
331
-
334
+
332
335
drv = stdenv . mkDerivation ( commonAttrs // contentAddressedAttrs // {
333
336
pname = nameOnly ;
334
337
inherit ( package . identifier ) version ;
Original file line number Diff line number Diff line change 67
67
selectedComponents =
68
68
lib . filter isSelectedComponent ( lib . attrValues transitiveDependenciesComponents ) ;
69
69
70
+ allHsPkgsComponents = lib . concatMap haskellLib . getAllComponents ( builtins . attrValues hsPkgs ) ;
71
+
70
72
# Given a list of `depends`, removes those which are selected components
71
73
removeSelectedInputs =
72
74
lib . filter ( input : ! ( isSelectedComponent input ) ) ;
105
107
systemInputs = removeSelectedInputs ( uniqueWithName allSystemInputs ) ;
106
108
107
109
nativeBuildInputs = removeSelectedInputs
108
- ( lib . concatMap ( c : c . executableToolDepends ) selectedComponents ) ;
110
+ ( uniqueWithName ( lib . concatMap ( c : c . executableToolDepends )
111
+ # When not using `exactDeps` cabal may try to build arbitrary dependencies
112
+ # so in this case we need to provide the build tools for all of hsPkgs:
113
+ ( if exactDeps then selectedComponents else allHsPkgsComponents ) ) ) ;
109
114
110
115
# Set up a "dummy" component to use with ghcForComponent.
111
116
component = {
You can’t perform that action at this time.
0 commit comments