Closed
Description
-- | Create a 'Graph' of 'Component', or report a cycle if there is a
-- problem.
--
mkComponentsGraph :: ComponentRequestedSpec
-> PackageDescription
-> Either [ComponentName] ComponentsGraph
mkComponentsGraph enabled pkg_descr =
let g = Graph.fromDistinctList
[ N c (componentName c) (componentDeps c)
| c <- pkgBuildableComponents pkg_descr
, componentEnabled enabled c ]
in case Graph.cycles g of
[] -> Right g
ccycles -> Left [ componentName c | N c _ _ <- concat ccycles ]
where
-- The dependencies for the given component
componentDeps component =
(CExeName <$> getAllInternalToolDependencies pkg_descr bi)
++ [ if pkgname == packageName pkg_descr
then CLibName LMainLibName
else CLibName (LSubLibName toolname)
| Dependency pkgname _ _ <- targetBuildDepends bi
-- ^ HERE, we ignore the library names all together
, let toolname = packageNameToUnqualComponentName pkgname
, toolname `elem` internalPkgDeps ]
where
I think that because of this issue the foo:bar
syntax is broken beyond repair in Cabal-3.0
and 3.2
.
Metadata
Metadata
Assignees
Labels
No labels