Skip to content

Commit 780dec6

Browse files
committed
Fix hadrianEvalPackages
1 parent 8cfb070 commit 780dec6

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

build.nix

+2-4
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ in rec {
2828
});
2929
} // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.4" >= 0) {
3030
# Make sure the plan for hadrian is cached (we need it to instanciate ghc).
31-
hadrian-plan = (pkgs.haskell-nix.compiler.${compiler-nix-name}.hadrian.project.appendModule [{
32-
compilerSelection = p: builtins.mapAttrs.override { hadiranEvalPackages = evalPackages; } p.haskell-nix.compiler;
33-
}]).plan-nix;
31+
hadrian-plan = pkgs.haskell-nix.compiler.${compiler-nix-name}.hadrianProject.plan-nix;
3432
# Also include the same plan evaluated on the eval system (probably x86_64-linux).
35-
hadrian-plan-eval = (pkgs.haskell-nix.compiler.${compiler-nix-name}.override { hadrianEvalPackages = evalPackages; }).hadrian.project.plan-nix;
33+
hadrian-plan-eval = (pkgs.haskell-nix.compiler.${compiler-nix-name}.override { hadrianEvalPackages = evalPackages; }).hadrianProject.plan-nix;
3634
} // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.8" < 0) {
3735
hlint-latest = tool compiler-nix-name "hlint" {
3836
inherit evalPackages;

compiler/ghc/default.nix

+8-3
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ let
254254
# value for us.
255255
installStage1 = useHadrian && (with haskell-nix.haskellLib; isCrossTarget || isNativeMusl);
256256

257-
hadrian =
257+
hadrianProject =
258+
assert (hadrianEvalPackages.system == "x86_64-linux");
258259
let
259260
compiler-nix-name =
260261
if builtins.compareVersions ghc-version "9.4.7" < 0
@@ -263,7 +264,9 @@ let
263264
then "ghc964"
264265
else "ghc962";
265266
in
266-
buildPackages.haskell-nix.tool compiler-nix-name "hadrian" {
267+
buildPackages.haskell-nix.cabalProject' {
268+
inherit compiler-nix-name;
269+
name = "hadrian";
267270
compilerSelection = p: p.haskell.compiler;
268271
index-state = buildPackages.haskell-nix.internalHackageIndexState;
269272
evalPackages = hadrianEvalPackages;
@@ -296,6 +299,8 @@ let
296299
};
297300
};
298301

302+
hadrian = hadrianProject.hsPkgs.hadrian.components.exes.hadrian;
303+
299304
# For a discription of hadrian command line args
300305
# see https://gitlab.haskell.org/ghc/ghc/blob/master/hadrian/README.md
301306
# For build flavours and flavour transformers
@@ -663,7 +668,7 @@ haskell-nix.haskellLib.makeCompilerDeps (stdenv.mkDerivation (rec {
663668
'';
664669

665670
passthru = {
666-
inherit bootPkgs targetPrefix libDir llvmPackages enableShared useLLVM hadrian;
671+
inherit bootPkgs targetPrefix libDir llvmPackages enableShared useLLVM hadrian hadrianProject;
667672

668673
# Our Cabal compiler name
669674
haskellCompilerName = "ghc-${version}";

0 commit comments

Comments
 (0)