-
Notifications
You must be signed in to change notification settings - Fork 86
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
Update haskell.nix and fix windows cross #2655
Conversation
Currently the use of nonReinstallablePkgs to make the Win32 reinstallable breaks cross compilation of any package using a custom-setup. This is because nonReinstallablePkgs is applied unconditionally and therefor applies to the "build" packages that are used for compiling the setup executables. The work around has been to add `buildType - lib.mkForce "Simple"` to any packages that use a custom setup executable. Maintaining this list is annoying and difficult (in part because the error message given when a package needs to be added a long way from clear). It turns out the correct fix is to make the override for nonReinstallablePkgs conditional and the correct way to do that is to use `pkgs` from the module arguments to detect when the `hostPlatform.isWindows`. We also need to use `mkIf` to avoid infinite recursion. So the windows specific module is now wrapped in: ``` ({ pkgs, ... }: lib.mkIf pkgs.stdenv.hostPlatform.isWindows {...}) ``` This change also updates to a more recent `haskell.nix` commit and removes the references to the `.all` components (they have been removed from haskell.nix).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat!
Much appreciated! I'll try it out in #2540. |
Hmm, if I cherry-pick this commit in #2540, I get evaluation errors: https://hydra.iohk.io/jobset/Cardano/ouroboros-network-pr-2540#tabs-errors
|
This kinda sounds like a corrupted nix derivation? |
I should have merged this in #2540 instead of cherry-picking. Closing. |
Currently the use of nonReinstallablePkgs to make the Win32
reinstallable breaks cross compilation of any package using a
custom-setup. This is because nonReinstallablePkgs is applied
unconditionally and therefor applies to the "build" packages
that are used for compiling the setup executables.
The work around has been to add
buildType - lib.mkForce "Simple"
to any packages that use a custom setup executable. Maintaining this
list is annoying and difficult (in part because the error message
given when a package needs to be added a long way from clear).
It turns out the correct fix is to make the override for
nonReinstallablePkgs conditional and the correct way to do that
is to use
pkgs
from the module arguments to detect when thehostPlatform.isWindows
. We also need to usemkIf
to avoidinfinite recursion. So the windows specific module is now wrapped
in:
This change also updates to a more recent
haskell.nix
commit andremoves the references to the
.all
components (they have beenremoved from haskell.nix).