Commit 3965d507 authored by Franz Thoma's avatar Franz Thoma
Browse files

Better error message

Output the last error message in addition to the final conflict
set, and give a less technical description of the conflict set for the
user message.

An example for the expected output is:

> cabal install --dry-run DPM CurryDB DAV DSH Digit HList MagicHaskeller bamboo
cabal: Could not resolve dependencies:
trying: CurryDB-0.1.1.0 (user goal)
trying: base-4.8.0.0/installed-1b6... (dependency of CurryDB-0.1.1.0)
trying: unix-2.7.1.0/installed-e59... (dependency of process-1.2.3.0/installed-3b1...)
trying: directory-1.2.2.0/installed-b49... (dependency of process-1.2.3.0/installed-3b1...)
Dependency tree exhaustively searched.
I've had most trouble fulfilling the following goals: haskell98 (36850), base
(26359), directory (9599), HTF (5092), bamboo (3788), DPM (3452), unix (3208),
CurryDB (107)
parent 1df47e71
......@@ -79,12 +79,14 @@ logToProgress mbj l = let
go ms (Step _ ns) (Step x xs) = Step x (go ms ns xs)
go ms r (Step x xs) = Step x (go ms r xs)
go ms _ (Fail (exh, cs, cm)) = Fail $
"Could not resolve dependencies:\n" ++ case exh of
"Could not resolve dependencies:\n" ++
unlines (messages $ showMessages (L.foldr (\ v _ -> v `CS.member` cs) True) False ms) ++
case exh of
Exhaustive ->
"Dependency tree exhaustively searched.\n" ++
"Final conflict set is: " ++ CS.showCSWithFrequency cm cs
"I've had most trouble fulfilling the following goals: "
++ CS.showCSWithFrequency cm cs
NotExhaustive ->
unlines (messages $ showMessages (L.foldr (\ v _ -> v `CS.member` cs) True) False ms) ++
"Backjump limit reached (" ++ currlimit mbj ++
"change with --max-backjumps or try to run with --reorder-goals).\n"
where currlimit (Just n) = "currently " ++ show n ++ ", "
......
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