Skip to content

Commit 0ec25e0

Browse files
committed
Add comment and only include library if there is one.
1 parent 72dcba6 commit 0ec25e0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/load-cabal-plan.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,15 @@ let
4747
name = pkgs.lib.removePrefix "${prefix}:" n;
4848
value = (if cabal2nixComponents == null then {} else cabal2nixComponents.${collectionName}.${name}) // {
4949
buildable = true;
50-
} // lookupDependencies hsPkgs (c.depends ++ pkgs.lib.optional (p ? components) p.id) c.exe-depends;
50+
} // lookupDependencies hsPkgs (
51+
c.depends
52+
# If plan.json uses a single unit for this package (build-type: Custom),
53+
# then it will leave the package itself out of `c.depends` for the
54+
# components of the package.
55+
# Haskell.nix builds the components separately so we need
56+
# to add the `library` component as a dependency.
57+
++ pkgs.lib.optional (p ? components && p.components ? lib) p.id
58+
) c.exe-depends;
5159
in { inherit name value; }
5260
)) components));
5361
in

0 commit comments

Comments
 (0)