on iko/ghcjs-patch-master help sign in
Apply fix from #611 to nix-tools (#612)
commitd345d4f1d042927d9c35697e3f225527c790c6ed authorHamish Mackenzie <Hamish.Mackenzie@iohk.io> dateSun 17 May 2020, 16:33 (6 years ago) parent3f06d5d
1 file changed+23−18
overlays/haskell.nix+23−18
overlays/haskell.nix+23−18
@@ -2,7 +2,26 @@
22#
33# for hygenic reasons we'll use haskell-nix as a prefix.
44# Using haskell.nix in nix is awkward as I needs to be quoted.
5−final: prev: {
5+final: prev:
6+let
7+ # Why `final.buildPackages.buildPackages.git`?
8+ #
9+ # It turns out `git` depends on `gdb` in a round about way:
10+ # git -> openssh -> libfido2 -> systemd -> python libxml -> Cython -> gdb
11+ # Somewhere in that chain there should perhaps be a `buildPackages` so
12+ # that the `gdb` that is used is not the one for debugging code in
13+ # the `final` (but instead the one for debugging code in
14+ # `final.buildPackages`).
15+ #
16+ # Using `final.buildPackages.git` causes two problems:
17+ #
18+ # * Multiple versions of `git` (and that dependency chain
19+ # to `gdb` are needed when cross compiling).
20+ # * When `gdb` does not exist for `js`, so when cross
21+ # compiling with ghcjs `final.buildPackages.git` fails
22+ # to build at all.
23+ inherit (final.buildPackages.buildPackages) git nix-prefetch-git;
24+in {
625 haskell-nix = with final.haskell-nix; {
726
827 # Default modules, these will always be included.
@@ -60,21 +79,7 @@ final: prev: {
6079 # Utility functions for working with the component builder.
6180 haskellLib = let hl = import ../lib {
6281 inherit (final) stdenv lib runCommand recurseIntoAttrs srcOnly;
63− # It turns out `git` depends on `gdb` in a round about way:
64− # git -> openssh -> libfido2 -> systemd -> python libxml -> Cython -> gdb
65− # Somewhere in that chain there should perhaps be a `buildPackages` so
66− # that the `gdb` that is used is not the one for debugging code in
67− # the `final` (but instead the one for debugging code in
68− # `final.buildPackages`).
69− #
70− # Using `final.buildPackages.git` causes two problems:
71− #
72− # * Multiple versions of `git` (and that dependency chain
73− # to `gdb` are needed when cross compiling).
74− # * When `gdb` does not exist for `js`, so when cross
75− # compiling with ghcjs `final.buildPackages.git` fails
76− # to build at all.
77− inherit (final.buildPackages.buildPackages) git;
82+ inherit git;
7883 haskellLib = hl;
7984 }; in hl;
8085
@@ -180,8 +185,8 @@ final: prev: {
180185 # We probably never want to actually cross compile nix-tools on
181186 # it's own.
182187 nix-tools-cross-compiled = final.lib.makeOverridable (import ../nix-tools) {
183− inherit (final) pkgs lib symlinkJoin makeWrapper
184− git nix nix-prefetch-git;
188+ inherit (final) pkgs lib symlinkJoin makeWrapper nix;
189+ inherit git nix-prefetch-git;
185190 inherit (final.haskell-nix) fetchExternal cleanSourceHaskell mkCabalProjectPkgSet;
186191 hpack = null; # nix-tools does not use hpack project files
187192 };