@@ -705,7 +705,7 @@ final: prev: {
705
705
inherit ( callProjectResults ) index-state-max ;
706
706
tool = final . buildPackages . haskell-nix . tool' evalPackages pkg-set . config . compiler . nix-name ;
707
707
tools = final . buildPackages . haskell-nix . tools' evalPackages pkg-set . config . compiler . nix-name ;
708
- roots = final . haskell-nix . roots pkg-set . config . compiler . nix-name ;
708
+ roots = final . haskell-nix . roots { inherit ( pkg-set . config ) compiler . nix-name ; inherit evalPackages ; }
709
709
projectFunction = haskell-nix : haskell-nix . cabalProject' ;
710
710
inherit projectModule buildProject ;
711
711
} ;
@@ -966,7 +966,7 @@ final: prev: {
966
966
stack-nix = callProjectResults . projectNix ;
967
967
tool = final . buildPackages . haskell-nix . tool' evalPackages pkg-set . config . compiler . nix-name ;
968
968
tools = final . buildPackages . haskell-nix . tools' evalPackages pkg-set . config . compiler . nix-name ;
969
- roots = final . haskell-nix . roots pkg-set . config . compiler . nix-name ;
969
+ roots = final . haskell-nix . roots { inherit ( pkg-set . config ) compiler . nix-name ; inherit evalPackages ; }
970
970
projectFunction = haskell-nix : haskell-nix . stackProject' ;
971
971
inherit projectModule buildProject ;
972
972
} ;
@@ -1082,28 +1082,31 @@ final: prev: {
1082
1082
# are tested and cached. Consider using `p.roots` where `p` is a
1083
1083
# project as it will automatically match the `compiler-nix-name`
1084
1084
# of the project.
1085
- roots = compiler-nix-name : final . linkFarm "haskell-nix-roots-${ compiler-nix-name } "
1085
+ roots = { compiler-nix-name , evalPackages ? final . pkgsBuildBuild } : final . linkFarm "haskell-nix-roots-${ compiler-nix-name } "
1086
1086
( final . lib . filter ( x : x . name != "recurseForDerivations" )
1087
1087
( final . lib . mapAttrsToList ( name : path : { inherit name path ; } )
1088
1088
( roots' compiler-nix-name 2 ) ) ) ;
1089
1089
1090
- roots' = compiler-nix-name : ifdLevel :
1090
+ roots' = { compiler-nix-name , evalPackages ? final . pkgsBuildBuild } : ifdLevel : evalPackages :
1091
+ let
1092
+ ghc = final . buildPackages . haskell-nix . compiler . ${ compiler-nix-name } . override { hadrianEvalPackages = evalPackages ; } ;
1093
+ in
1091
1094
final . recurseIntoAttrs ( {
1092
1095
# Things that require no IFD to build
1093
1096
source-pin-hackage = hackageSrc ;
1094
1097
source-pin-stackage = stackageSrc ;
1095
1098
source-pin-haskell-nix = final . path ;
1096
- # Double buildPackages is intentional,
1097
- # see comment in lib/default.nix for details.
1098
- # Using buildPackages rather than evalPackages so both darwin and linux
1099
- # versions will get pinned (evalPackages on darwin systems will be for darwin).
1100
- inherit ( final . buildPackages . buildPackages ) gitMinimal nix-prefetch-git ;
1101
- inherit ( final . buildPackages ) nix ;
1099
+ inherit ( evalPackages ) nix gitMinimal nix-prefetch-git ;
1102
1100
} // final . lib . optionalAttrs ( final . stdenv . hostPlatform . libc == "glibc" ) {
1103
1101
inherit ( final ) glibcLocales ;
1102
+ } // pkgs . lib . optionalAttrs ( builtins . compareVersions ghc . version "9.4" >= 0 ) {
1103
+ # Make sure the plan for hadrian is cached (we need it to instanciate ghc).
1104
+ hadrian-plan = final . buildPackages . haskell-nix . compiler . ${ compiler-nix-name } . hadrianProject . plan-nix ;
1105
+ # Also include the same plan evaluated on the eval system.
1106
+ hadrian-plan-eval = ghc . hadrianProject . plan-nix ;
1104
1107
} // final . lib . optionalAttrs ( ifdLevel > 0 ) {
1105
1108
# Things that require one IFD to build (the inputs should be in level 0)
1106
- ghc = final . buildPackages . haskell-nix . compiler . ${ compiler-nix-name } ;
1109
+ inherit ghc ;
1107
1110
ghc-boot-packages-nix = final . recurseIntoAttrs
1108
1111
final . ghc-boot-packages-nix . ${ compiler-nix-name } ;
1109
1112
} // final . lib . optionalAttrs ( ifdLevel > 1 ) {
0 commit comments