Skip to content

Commit 0426fa1

Browse files
committed
shellFor: provide build tools for all packages when exactDeps = false
When not using `exactDeps` cabal may try to build arbitrary dependencies so in this case we need to provide the build tools for all of hsPkgs.
1 parent 7629276 commit 0426fa1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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 = {

0 commit comments

Comments
 (0)