Skip to content

Commit b2a20cc

Browse files
committed
Fix hadrianEvalPackages
1 parent 5e20112 commit b2a20cc

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

ci.nix

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,9 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: pinnedNixpkgsSrc:
121121
# Native builds
122122
# TODO: can we merge this into the general case by picking an appropriate "cross system" to mean native?
123123
native = pkgs.recurseIntoAttrs ({
124-
roots = pkgs.haskell-nix.roots' compiler-nix-name ifdLevel;
125-
ghc = pkgs.buildPackages.haskell-nix.compiler.${compiler-nix-name}.override { hadrianEvalPackages = evalPackages; };
124+
roots = pkgs.haskell-nix.roots' compiler-nix-name ifdLevel // {
125+
ghc = pkgs.buildPackages.haskell-nix.compiler.${compiler-nix-name}.override { hadrianEvalPackages = evalPackages; };
126+
};
126127
} // pkgs.lib.optionalAttrs runTests {
127128
inherit (build) tests tools maintainer-scripts maintainer-script-cache;
128129
} // pkgs.lib.optionalAttrs (ifdLevel >= 3) rec {
@@ -142,8 +143,9 @@ dimension "Nixpkgs version" nixpkgsVersions (nixpkgsName: pinnedNixpkgsSrc:
142143
let pkgs = import pinnedNixpkgsSrc (nixpkgsArgs // { inherit system crossSystem; });
143144
build = import ./build.nix { inherit pkgs evalPackages ifdLevel compiler-nix-name haskellNix; };
144145
in pkgs.recurseIntoAttrs (pkgs.lib.optionalAttrs (ifdLevel >= 1) ({
145-
roots = pkgs.haskell-nix.roots' compiler-nix-name ifdLevel;
146-
ghc = pkgs.buildPackages.haskell-nix.compiler.${compiler-nix-name}.override { hadrianEvalPackages = evalPackages; };
146+
roots = pkgs.haskell-nix.roots' compiler-nix-name ifdLevel // {
147+
ghc = pkgs.buildPackages.haskell-nix.compiler.${compiler-nix-name}.override { hadrianEvalPackages = evalPackages; };
148+
};
147149
# TODO: look into cross compiling ghc itself
148150
# ghc = pkgs.haskell-nix.compiler.${compiler-nix-name};
149151
# TODO: look into making tools work when cross compiling

compiler/ghc/default.nix

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ let
284284
cabalProjectFreeze = null;
285285
src = haskell-nix.haskellLib.cleanSourceWith {
286286
src = {
287-
outPath = hadrianEvalPackages.srcOnly {
288-
stdenv = hadrianEvalPackages.stdenvNoCC;
287+
outPath = buildPackages.srcOnly {
288+
stdenv = buildPackages.stdenvNoCC;
289289
name = "hadrian";
290290
inherit src;
291291
};
@@ -757,7 +757,9 @@ haskell-nix.haskellLib.makeCompilerDeps (stdenv.mkDerivation (rec {
757757
smallAddressSpace = lib.makeOverridable self (args // {
758758
disableLargeAddressSpace = true;
759759
});
760-
} // extra-passthru;
760+
} // extra-passthru // {
761+
buildGHC = extra-passthru.buildGHC.override { inherit hadrianEvalPackages; };
762+
};
761763

762764
meta = {
763765
homepage = "https://haskell.org/ghc";

lib/call-cabal-project-to-nix.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
, ignorePackageYaml ? false # Ignore package.yaml files even if they exist
6464
, ...
6565
}@args:
66+
assert (evalPackages.system != "x86_64-darwin" || materialized != null);
6667
let
6768
inherit (evalPackages.haskell-nix) materialize dotCabal;
6869

modules/cabal-project.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ in {
2222
};
2323
compilerSelection = mkOption {
2424
type = unspecified;
25-
default = p: p.haskell-nix.compiler;
25+
default = p: builtins.mapAttrs (_: x: x.override { hadrianEvalPackages = config.evalPackages; }) p.haskell-nix.compiler;
2626
description = "Use GHC from pkgs.haskell instead of pkgs.haskell-nix";
2727
};
2828
index-state = mkOption {

0 commit comments

Comments
 (0)