@@ -713,21 +713,26 @@ reportTargetSelectorProblems verbosity problems = do
713
713
case [ (t, m, ms) | MatchingInternalError t m ms <- problems ] of
714
714
[] -> return ()
715
715
((target, originalMatch, renderingsAndMatches): _) ->
716
- die' verbosity $ " Internal error in target matching. It should always "
717
- ++ " be possible to find a syntax that's sufficiently qualified to "
718
- ++ " give an unambiguous match. However when matching '"
719
- ++ showTargetString target ++ " ' we found "
720
- ++ showTargetSelector originalMatch
721
- ++ " (" ++ showTargetSelectorKind originalMatch ++ " ) which does "
722
- ++ " not have an unambiguous syntax. The possible syntax and the "
723
- ++ " targets they match are as follows:\n "
716
+ die' verbosity $ " Internal error in target matching: could not make an "
717
+ ++ " unambiguous fully qualified target selector for '"
718
+ ++ showTargetString target ++ " '.\n "
719
+ ++ " We made the target '" ++ showTargetSelector originalMatch ++ " ' ("
720
+ ++ showTargetSelectorKind originalMatch ++ " ) that was expected to "
721
+ ++ " be unambiguous but matches the following targets:\n "
724
722
++ unlines
725
- [ " '" ++ showTargetString rendering ++ " ' which matches "
726
- ++ intercalate " , "
723
+ [ " '" ++ showTargetString rendering ++ " ', matching: "
724
+ ++ concatMap ( " \n - " ++ )
727
725
[ showTargetSelector match ++
728
726
" (" ++ showTargetSelectorKind match ++ " )"
729
727
| match <- matches ]
730
728
| (rendering, matches) <- renderingsAndMatches ]
729
+ ++ " \n Note: Cabal expects to be able to make a single fully "
730
+ ++ " qualified name for a target or provide a more specific error. "
731
+ ++ " Our failure to do so is a bug in cabal. "
732
+ ++ " Tracking issue: https://github.com/haskell/cabal/issues/8684"
733
+ ++ " \n\n Hint: this may be caused by trying to build a package that "
734
+ ++ " exists in the project directory but is missing from "
735
+ ++ " the 'packages' stanza in your cabal project file."
731
736
732
737
case [ (t, e, g) | TargetSelectorExpected t e g <- problems ] of
733
738
[] -> return ()
0 commit comments