Commit bfdd9539 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Remove PlanningFailed and add {Repl,Haddocks}Failed

The PlanningFailed case does not happen. The ReplFailed, HaddocksFailed
cases were previously covered by BuildFailed but they're worth
disinguishing.
parent 11ed1709
......@@ -609,12 +609,13 @@ instance Exception BuildFailure
-- | Detail on the reason that a package failed to build.
--
data BuildFailureReason = PlanningFailed
| DependentFailed PackageId
data BuildFailureReason = DependentFailed PackageId
| DownloadFailed SomeException
| UnpackFailed SomeException
| ConfigureFailed SomeException
| BuildFailed SomeException
| ReplFailed SomeException
| HaddocksFailed SomeException
| TestsFailed SomeException
| InstallFailed SomeException
deriving Show
......@@ -1240,12 +1241,12 @@ buildInplaceUnpackedPackage verbosity
-- Repl phase
--
whenRepl $
annotateFailure (BuildFailure Nothing . BuildFailed) $
annotateFailure (BuildFailure Nothing . ReplFailed) $
setup replCommand replFlags replArgs
-- Haddock phase
whenHaddock $
annotateFailure (BuildFailure Nothing . BuildFailed) $
annotateFailure (BuildFailure Nothing . HaddocksFailed) $
setup haddockCommand haddockFlags []
return BuildResult {
......
......@@ -554,6 +554,10 @@ reportBuildFailures plan buildOutcomes
++ showException e
BuildFailed e -> "failed to build " ++ pkgstr ++ "."
++ showException e
ReplFailed e -> "repl failed for " ++ pkgstr ++ "."
++ showException e
HaddocksFailed e -> "failed to build documentation for " ++ pkgstr ++ "."
++ showException e
TestsFailed e -> "tests failed for " ++ pkgstr ++ "."
++ showException e
InstallFailed e -> "failed to build " ++ pkgstr ++ ". The failure"
......@@ -563,7 +567,6 @@ reportBuildFailures plan buildOutcomes
-- This will never happen, but we include it for completeness
DependentFailed pkgid -> " depends on " ++ display pkgid
++ " which failed to install."
PlanningFailed -> " failed during the planning phase."
where
pkgstr = display (packageId pkg)
++ renderDependencyOf (installedUnitId pkg)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment