Skip to content

Commit 9b369a2

Browse files
committed
Merge remote-tracking branch 'upstream/master' into support-revisions-and-more
2 parents ecdbd72 + 6c86f52 commit 9b369a2

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

builder/comp-builder.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,10 @@ let
239239
(lib.concatMap (c: if c.isHaskell or false
240240
then builtins.attrValues (c.components.exes or {})
241241
else [c])
242-
(builtins.filter (x: !(isNull x))
242+
(builtins.filter (x: !(isNull x)
243+
# We always exclude hsc2hs from build-tools because it is unecessary as it is provided by ghc
244+
# and hsc2hs from ghc is first in PATH so the one from build-tools is never used.
245+
&& x.identifier.name or "" != "hsc2hs")
243246
(map
244247
(p: if builtins.isFunction p
245248
then p { inherit (package.identifier) version; }

builder/shell-for.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ let
6767
selectedComponents =
6868
lib.filter isSelectedComponent (lib.attrValues transitiveDependenciesComponents);
6969

70+
allHsPkgsComponents = lib.concatMap haskellLib.getAllComponents (builtins.attrValues hsPkgs);
71+
7072
# Given a list of `depends`, removes those which are selected components
7173
removeSelectedInputs =
7274
lib.filter (input: !(isSelectedComponent input));
@@ -105,7 +107,10 @@ let
105107
systemInputs = removeSelectedInputs (uniqueWithName allSystemInputs);
106108

107109
nativeBuildInputs = removeSelectedInputs
108-
(lib.concatMap (c: c.executableToolDepends) selectedComponents);
110+
(uniqueWithName (lib.concatMap (c: c.executableToolDepends)
111+
# When not using `exactDeps` cabal may try to build arbitrary dependencies
112+
# so in this case we need to provide the build tools for all of hsPkgs:
113+
(if exactDeps then selectedComponents else allHsPkgsComponents)));
109114

110115
# Set up a "dummy" component to use with ghcForComponent.
111116
component = {

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)