From 9a2384467ade392286b244b315c74979429137ab Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Thu, 17 Sep 2020 17:51:18 +0100 Subject: [PATCH] Provide slightly more information when there are multiple packages Partially addresses https://github.com/haskell/cabal/issues/6197 --- .../src/Distribution/Client/ProjectOrchestration.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cabal-install/src/Distribution/Client/ProjectOrchestration.hs b/cabal-install/src/Distribution/Client/ProjectOrchestration.hs index e5110b36fb8..76514322413 100644 --- a/cabal-install/src/Distribution/Client/ProjectOrchestration.hs +++ b/cabal-install/src/Distribution/Client/ProjectOrchestration.hs @@ -551,8 +551,9 @@ resolveTargets selectPackageTargets selectComponentTarget | otherwise = Left (TargetProblemNoSuchPackage pkgid) - checkTarget (TargetPackage _ _ _) - = error "TODO: add support for multiple packages in a directory" + checkTarget (TargetPackage _ pkgids _) + = error ("TODO: add support for multiple packages in a directory. Got\n" + ++ unlines (map prettyShow pkgids)) -- For the moment this error cannot happen here, because it gets -- detected when the package config is being constructed. This case -- will need handling properly when we do add support.