Skip to content

Fix selection of crossPlaforms for cross compiltion #2348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions overlays/haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading