Skip to content

Commit

Permalink
Try #1265:
Browse files Browse the repository at this point in the history
  • Loading branch information
iohk-bors[bot] committed Oct 11, 2021
2 parents 9abb33b + 04a4628 commit 3679a0d
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions overlays/haskell.nix
Expand Up @@ -488,6 +488,9 @@ final: prev: {
plan-pkgs = importAndFilterProject {
inherit (callProjectResults) projectNix sourceRepos src;
};
buildProject = if final.stdenv.hostPlatform != final.stdenv.buildPlatform
then final.buildPackages.haskell-nix.cabalProject' projectModule
else project;
pkg-set = if plan-pkgs ? configurationError
then {
inherit (plan-pkgs) configurationError;
Expand All @@ -499,8 +502,8 @@ final: prev: {
else mkCabalProjectPkgSet
{ inherit compiler-nix-name plan-pkgs;
pkg-def-extras = args.pkg-def-extras or [];
modules = [ { _module.args.buildModules = final.lib.mkForce (if final.stdenv.hostPlatform != final.stdenv.buildPlatform
then (final.buildPackages.haskell-nix.cabalProject' projectModule).pkg-set
modules = [ { _module.args.buildModules = final.lib.mkForce buildProject.pkg-set; }
then buildProject.pkg-set
else pkg-set); } ]
++ (args.modules or [])
++ final.lib.optional (args.ghcOverride != null || args.ghc != null)
Expand All @@ -518,7 +521,7 @@ final: prev: {
tools = final.buildPackages.haskell-nix.tools pkg-set.config.compiler.nix-name;
roots = final.haskell-nix.roots pkg-set.config.compiler.nix-name;
projectFunction = haskell-nix: haskell-nix.cabalProject';
inherit projectModule args;
inherit projectModule buildProject args;
};
in project);

Expand Down Expand Up @@ -771,11 +774,15 @@ final: prev: {
// final.lib.optionalAttrs (args.cache == null) { inherit cache; });
generatedCache = genStackCache args;
cache = if args.cache != null then args.cache else generatedCache;
in let pkg-set = mkStackPkgSet
in let
buildProject = if final.stdenv.hostPlatform != final.stdenv.buildPlatform
then final.buildPackages.haskell-nix.stackProject' projectModule
else project;
pkg-set = mkStackPkgSet
{ stack-pkgs = importAndFilterProject callProjectResults;
pkg-def-extras = (args.pkg-def-extras or []);
modules = [ { _module.args.buildModules = final.lib.mkForce (if final.stdenv.hostPlatform != final.stdenv.buildPlatform
then (final.buildPackages.haskell-nix.stackProject' projectModule).pkg-set
modules = [ { _module.args.buildModules = final.lib.mkForce buildProject.pkg-set; }
then buildProject.pkg-set
else pkg-set); }
(mkCacheModule cache) ]
++ (args.modules or [])
Expand All @@ -792,7 +799,7 @@ final: prev: {
tools = final.buildPackages.haskell-nix.tools pkg-set.config.compiler.nix-name;
roots = final.haskell-nix.roots pkg-set.config.compiler.nix-name;
projectFunction = haskell-nix: haskell-nix.stackProject';
inherit projectModule args;
inherit projectModule buildProject args;
};
in project);

Expand Down

0 comments on commit 3679a0d

Please sign in to comment.