@@ -705,7 +705,7 @@ final: prev: {
705705 inherit ( callProjectResults ) index-state-max ;
706706 tool = final . buildPackages . haskell-nix . tool' evalPackages pkg-set . config . compiler . nix-name ;
707707 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 ; }
709709 projectFunction = haskell-nix : haskell-nix . cabalProject' ;
710710 inherit projectModule buildProject ;
711711 } ;
@@ -966,7 +966,7 @@ final: prev: {
966966 stack-nix = callProjectResults . projectNix ;
967967 tool = final . buildPackages . haskell-nix . tool' evalPackages pkg-set . config . compiler . nix-name ;
968968 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 ; }
970970 projectFunction = haskell-nix : haskell-nix . stackProject' ;
971971 inherit projectModule buildProject ;
972972 } ;
@@ -1082,28 +1082,31 @@ final: prev: {
10821082 # are tested and cached. Consider using `p.roots` where `p` is a
10831083 # project as it will automatically match the `compiler-nix-name`
10841084 # 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 } "
10861086 ( final . lib . filter ( x : x . name != "recurseForDerivations" )
10871087 ( final . lib . mapAttrsToList ( name : path : { inherit name path ; } )
10881088 ( roots' compiler-nix-name 2 ) ) ) ;
10891089
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
10911094 final . recurseIntoAttrs ( {
10921095 # Things that require no IFD to build
10931096 source-pin-hackage = hackageSrc ;
10941097 source-pin-stackage = stackageSrc ;
10951098 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 ;
11021100 } // final . lib . optionalAttrs ( final . stdenv . hostPlatform . libc == "glibc" ) {
11031101 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 ;
11041107 } // final . lib . optionalAttrs ( ifdLevel > 0 ) {
11051108 # 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 ;
11071110 ghc-boot-packages-nix = final . recurseIntoAttrs
11081111 final . ghc-boot-packages-nix . ${ compiler-nix-name } ;
11091112 } // final . lib . optionalAttrs ( ifdLevel > 1 ) {
0 commit comments