on iko/ghcjs-patch-master help sign in
Fix cleanGit uncached git when cross compiling (#611)
3f06d5dHamish Mackenzie
overlays/haskell.nix+15−1
@@ -60,7 +60,21 @@ final: prev: {
60 # Utility functions for working with the component builder.
60 # Utility functions for working with the component builder.
61 haskellLib = let hl = import ../lib {
61 haskellLib = let hl = import ../lib {
62 inherit (final) stdenv lib runCommand recurseIntoAttrs srcOnly;
62 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.
63− inherit (final.buildPackages) git;
77+ inherit (final.buildPackages.buildPackages) git;
64 haskellLib = hl;
78 haskellLib = hl;
65 }; in hl;
79 }; in hl;
66
80