Skip to content

Commit ac4d743

Browse files
Fix selection of crossPlaforms for cross compiltion (#2348)
* Fix selection of crossPlaforms for cross compiltion * Update overlays/haskell.nix Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent a3b1ef0 commit ac4d743

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

overlays/haskell.nix

+7-12
Original file line numberDiff line numberDiff line change
@@ -826,10 +826,10 @@ final: prev: {
826826
# ];
827827
# }
828828
#
829-
shellFor = shellArgs:
829+
shellFor = extraArgs: shellFor' (rawProject.args.shell // extraArgs).crossPlatforms extraArgs;
830+
shellFor' = crossPlatforms: extraArgs:
830831
let
831-
# These are the args we will pass to the main shell.
832-
args' = builtins.removeAttrs (rawProject.args.shell // shellArgs) [ "crossPlatforms" ];
832+
shellArgs = builtins.removeAttrs (rawProject.args.shell // extraArgs) [ "crossPlatforms" ];
833833
# These are the args we will pass to the shells for the corss compiler
834834
argsCross =
835835
# These things should match main shell
@@ -839,17 +839,12 @@ final: prev: {
839839
# The main shell's hoogle will probably be faster to build.
840840
withHoogle = false;
841841
};
842-
# These are the cross compilation versions of the project we will include.
843-
selectedCrossProjects =
844-
if shellArgs ? crossPlatforms
845-
then shellArgs.crossPlatforms projectCross
846-
else [];
847842
# Shells for cross compilation
848-
crossShells = builtins.map (project: project.shellFor argsCross)
849-
selectedCrossProjects;
850-
in rawProject.hsPkgs.shellFor (args' // {
843+
crossShells = builtins.map (project: project.shellFor' (_p: []) argsCross)
844+
(crossPlatforms projectCross);
845+
in rawProject.hsPkgs.shellFor (shellArgs // {
851846
# Add inputs from the cross compilation shells
852-
inputsFrom = args'.inputsFrom or [] ++ crossShells;
847+
inputsFrom = shellArgs.inputsFrom or [] ++ crossShells;
853848
});
854849

855850
# Default shell

0 commit comments

Comments
 (0)