Skip to content

Commit 4dfb76f

Browse files
committed
Allocate different ComponentId for lib and exe.
In the old code, we assumed that only libraries could get installed, but with executable dependencies this is no longer true. Handle it correctly. This bug caused cycles in the elaborated install plan which could cause dependency closure to fail, resulting in weird errors. Fixes haskell#3996. Signed-off-by: Edward Z. Yang <[email protected]>
1 parent 211776b commit 4dfb76f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cabal-install/Distribution/Client/ProjectPlanning.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2824,7 +2824,10 @@ packageHashInputs
28242824
}) =
28252825
PackageHashInputs {
28262826
pkgHashPkgId = packageId elab,
2827-
pkgHashComponent = Nothing,
2827+
pkgHashComponent =
2828+
case elabPkgOrComp elab of
2829+
ElabPackage _ -> Nothing
2830+
ElabComponent comp -> Just (compSolverName comp),
28282831
pkgHashSourceHash = srchash,
28292832
pkgHashPkgConfigDeps = Set.fromList (elabPkgConfigDependencies elab),
28302833
pkgHashDirectDeps =

0 commit comments

Comments
 (0)