Skip to content

Commit d345d4f

Browse files
authored
Apply fix from #611 to nix-tools (#612)
1 parent 3f06d5d commit d345d4f

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

overlays/haskell.nix

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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
};

0 commit comments

Comments
 (0)