From 01250c0010591de394d1a6e9bebfaab096bdadcf Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Wed, 23 Apr 2025 12:41:37 +1200 Subject: [PATCH 1/2] Fix selection of crossPlaforms for cross compiltion --- overlays/haskell.nix | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/overlays/haskell.nix b/overlays/haskell.nix index 9e7bb7a8e3..ff6ea868cc 100644 --- a/overlays/haskell.nix +++ b/overlays/haskell.nix @@ -826,10 +826,10 @@ final: prev: { # ]; # } # - shellFor = shellArgs: + shellFor = extraArgs: shellFor' (rawProject.args.shell // extraArgs).crossPlatforms extraArgs; + shellFor' = crossPlatforms: extraArgs: let - # These are the args we will pass to the main shell. - args' = builtins.removeAttrs (rawProject.args.shell // shellArgs) [ "crossPlatforms" ]; + shellArgs = builtins.removeAttrs (rawProject.args.shell // extraArgs) [ "crossPlatforms" ]; # These are the args we will pass to the shells for the corss compiler argsCross = # These things should match main shell @@ -839,17 +839,12 @@ final: prev: { # The main shell's hoogle will probably be faster to build. withHoogle = false; }; - # These are the cross compilation versions of the project we will include. - selectedCrossProjects = - if shellArgs ? crossPlatforms - then shellArgs.crossPlatforms projectCross - else []; # Shells for cross compilation - crossShells = builtins.map (project: project.shellFor argsCross) - selectedCrossProjects; - in rawProject.hsPkgs.shellFor (args' // { + crossShells = builtins.map (project: project.shellFor' (p: []) argsCross) + (crossPlatforms projectCross); + in rawProject.hsPkgs.shellFor (shellArgs // { # Add inputs from the cross compilation shells - inputsFrom = args'.inputsFrom or [] ++ crossShells; + inputsFrom = shellArgs.inputsFrom or [] ++ crossShells; }); # Default shell From b0f057af889b2ce38527f656cb0995c627e5c478 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Wed, 23 Apr 2025 13:08:20 +1200 Subject: [PATCH 2/2] Update overlays/haskell.nix Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- overlays/haskell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overlays/haskell.nix b/overlays/haskell.nix index ff6ea868cc..112ce22690 100644 --- a/overlays/haskell.nix +++ b/overlays/haskell.nix @@ -840,7 +840,7 @@ final: prev: { withHoogle = false; }; # Shells for cross compilation - crossShells = builtins.map (project: project.shellFor' (p: []) argsCross) + crossShells = builtins.map (project: project.shellFor' (_p: []) argsCross) (crossPlatforms projectCross); in rawProject.hsPkgs.shellFor (shellArgs // { # Add inputs from the cross compilation shells