File tree 11 files changed +48
-6
lines changed
Cabal/Distribution/Backpack
cabal-testsuite/PackageTests/MultipleLibraries/T6894 11 files changed +48
-6
lines changed Original file line number Diff line number Diff line change @@ -89,9 +89,10 @@ componentsGraphToList =
89
89
map (\ (N c _ cs) -> (c, cs)) . Graph. revTopSort
90
90
91
91
-- | Error message when there is a cycle; takes the SCC of components.
92
- componentCycleMsg :: [ComponentName ] -> Doc
93
- componentCycleMsg cnames =
94
- text $ " Components in the package depend on each other in a cyclic way:\n "
95
- ++ intercalate " depends on "
92
+ componentCycleMsg :: PackageIdentifier -> [ComponentName ] -> Doc
93
+ componentCycleMsg pn cnames =
94
+ text " Components in the package" <+> pretty pn <+> text " depend on each other in a cyclic way:"
95
+ $$
96
+ text (intercalate " depends on "
96
97
[ " '" ++ showComponentName cname ++ " '"
97
- | cname <- cnames ++ maybeToList (safeHead cnames) ]
98
+ | cname <- cnames ++ maybeToList (safeHead cnames) ])
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ configureComponentLocalBuildInfos
78
78
-- NB: In single component mode, this returns a *single* component.
79
79
-- In this graph, the graph is NOT closed.
80
80
graph0 <- case mkComponentsGraph enabled pkg_descr of
81
- Left ccycle -> dieProgress (componentCycleMsg ccycle)
81
+ Left ccycle -> dieProgress (componentCycleMsg (package pkg_descr) ccycle)
82
82
Right g -> return (componentsGraphToList g)
83
83
infoProgress $ hang (text " Source component graph:" ) 4
84
84
(dispComponentsWithDeps graph0)
Original file line number Diff line number Diff line change
1
+ module Bar where
Original file line number Diff line number Diff line change
1
+ module Foo where
Original file line number Diff line number Diff line change
1
+ # cabal v2-build
2
+ Resolving dependencies...
3
+ Error:
4
+ Dependency cycle between the following components: library
5
+ In the inplace package 'issue-6894'
Original file line number Diff line number Diff line change
1
+ packages : .
Original file line number Diff line number Diff line change
1
+ import Test.Cabal.Prelude
2
+ main = cabalTest $
3
+ fails $ cabal " v2-build" [" issue" ]
Original file line number Diff line number Diff line change
1
+ cabal-version : 3.0
2
+ name : issue
3
+ version : 6894
4
+
5
+ library
6
+ default-language : Haskell2010
7
+ build-depends : base, issue :sublib
8
+ exposed-modules : Foo
9
+
10
+ library sublib
11
+ default-language : Haskell2010
12
+ build-depends : base
13
+ exposed-modules : Bar
Original file line number Diff line number Diff line change
1
+ # Setup configure
2
+ Warning: issue.cabal:7:30: colon specifier is experimental feature (issue #5660)
3
+ Configuring issue-6894...
4
+ Error:
5
+ Components in the package issue-6894 depend on each other in a cyclic way:
6
+ 'library' depends on 'library'
7
+ # Setup build
Original file line number Diff line number Diff line change
1
+ # Setup configure
2
+ Warning: issue.cabal:7:30: colon specifier is experimental feature (issue #5660)
3
+ Configuring issue-6894...
4
+ Error:
5
+ Components in the package issue-6894 depend on each other in a cyclic way:
6
+ 'library' depends on 'library'
7
+ # Setup build
Original file line number Diff line number Diff line change
1
+ import Test.Cabal.Prelude
2
+ main = setupAndCabalTest $ do
3
+ fails $ setup_build []
You can’t perform that action at this time.
0 commit comments