Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Cabal/src/Distribution/Backpack/LinkedComponent.hs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,17 @@ toLinkedComponent
hang
(text "Non-library component has unfilled requirements:")
4
(vcat [pretty req | req <- Set.toList reqs])
( vcat
[ case Map.lookup req (modScopeRequires linked_shape0) of
Just srcs@(_ : _) ->
hang
(pretty req)
4
(vcat [text "brought into scope by" <+> dispModuleSource (getSource src) | src <- srcs])
_ -> pretty req
| req <- Set.toList reqs
]
)

-- NB: do NOT include hidden modules here: GHC 7.10's ghc-pkg
-- won't allow it (since someone could directly synthesize
Expand Down
3 changes: 2 additions & 1 deletion cabal-testsuite/PackageTests/Backpack/Fail3/setup.cabal.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Setup configure
Configuring Fail1-0.1.0.0...
Error:
Non-library component has unfilled requirements: UnfilledSig
Non-library component has unfilled requirements:
UnfilledSig brought into scope by build-depends: Fail1
In the stanza executable foo
3 changes: 2 additions & 1 deletion cabal-testsuite/PackageTests/Backpack/Fail3/setup.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Setup configure
Configuring Fail1-0.1.0.0...
Error:
Non-library component has unfilled requirements: UnfilledSig
Non-library component has unfilled requirements:
UnfilledSig brought into scope by build-depends: Fail1
In the stanza executable foo
1 change: 1 addition & 0 deletions cabal-testsuite/PackageTests/Backpack/Fail3/setup.test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ main = setupAndCabalTest $ do
skipUnlessGhcVersion ">= 8.1"
r <- fails $ setup' "configure" []
assertOutputContains "UnfilledSig" r
assertOutputContains "brought into scope by" r
return ()
24 changes: 24 additions & 0 deletions cabal-testsuite/PackageTests/Backpack/Fail4/Fail4.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cabal-version: 3.0
name: Fail4
version: 0.1.0.0
license: BSD-3-Clause
author: Edward Z. Yang
maintainer: ezyang@cs.stanford.edu
build-type: Simple

library sig-lib-a
signatures: UnfilledSig
build-depends: base
hs-source-dirs: lib-a
default-language: Haskell2010

library sig-lib-b
signatures: UnfilledSig
build-depends: base
hs-source-dirs: lib-b
default-language: Haskell2010

executable foo
build-depends: Fail4:sig-lib-a, Fail4:sig-lib-b
main-is: Main.hs
default-language: Haskell2010
1 change: 1 addition & 0 deletions cabal-testsuite/PackageTests/Backpack/Fail4/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main = return ()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
signature UnfilledSig where
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
signature UnfilledSig where
8 changes: 8 additions & 0 deletions cabal-testsuite/PackageTests/Backpack/Fail4/setup.cabal.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Setup configure
Configuring Fail4-0.1.0.0...
Error:
Non-library component has unfilled requirements:
UnfilledSig
brought into scope by build-depends: Fail4:sig-lib-a
brought into scope by build-depends: Fail4:sig-lib-b
In the stanza executable foo
8 changes: 8 additions & 0 deletions cabal-testsuite/PackageTests/Backpack/Fail4/setup.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Setup configure
Configuring Fail4-0.1.0.0...
Error:
Non-library component has unfilled requirements:
UnfilledSig
brought into scope by build-depends: Fail4:sig-lib-a
brought into scope by build-depends: Fail4:sig-lib-b
In the stanza executable foo
9 changes: 9 additions & 0 deletions cabal-testsuite/PackageTests/Backpack/Fail4/setup.test.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Test.Cabal.Prelude

main = setupAndCabalTest $ do
skipUnlessGhcVersion ">= 8.1"
r <- fails $ setup' "configure" []
assertOutputContains "UnfilledSig" r
assertOutputContains "brought into scope by build-depends: Fail4:sig-lib-a" r
assertOutputContains "brought into scope by build-depends: Fail4:sig-lib-b" r
return ()
Loading