From 37afd3b7d590b34427066b76b2ef5c3cf4281bf9 Mon Sep 17 00:00:00 2001 From: Kristen Kozak Date: Sun, 15 Nov 2015 12:44:00 -0800 Subject: [PATCH] Update error message and comments --- .../Distribution/PackageDescription/Configuration.hs | 12 +++++++----- Cabal/Distribution/Simple/Configure.hs | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Cabal/Distribution/PackageDescription/Configuration.hs b/Cabal/Distribution/PackageDescription/Configuration.hs index 77fe30e7c48..27518ff989d 100644 --- a/Cabal/Distribution/PackageDescription/Configuration.hs +++ b/Cabal/Distribution/PackageDescription/Configuration.hs @@ -199,8 +199,9 @@ data BT a = BT a [BT a] -- very simple binary tree -- resulting data, the associated dependencies, and the chosen flag -- assignments. -- --- In case of failure, the _smallest_ number of of missing dependencies is --- returned. [TODO: Could also be specified with a function argument.] +-- In case of failure, the union of the dependencies that led to backtracking +-- on all branches is returned. +-- [TODO: Could also be specified with a function argument.] -- -- TODO: The current algorithm is rather naive. A better approach would be to: -- @@ -472,9 +473,10 @@ instance Monoid PDTagged where -- -- This function will fail if it cannot find a flag assignment that leads to -- satisfiable dependencies. (It will not try alternative assignments for --- explicitly specified flags.) In case of failure it will return a /minimum/ --- number of dependencies that could not be satisfied. On success, it will --- return the package description and the full flag assignment chosen. +-- explicitly specified flags.) In case of failure it will return the missing +-- dependencies that it encountered when trying different flag assignments. +-- On success, it will return the package description and the full flag +-- assignment chosen. -- finalizePackageDescription :: FlagAssignment -- ^ Explicitly specified flag assignments diff --git a/Cabal/Distribution/Simple/Configure.hs b/Cabal/Distribution/Simple/Configure.hs index d26f8c8b3aa..962d238e0eb 100644 --- a/Cabal/Distribution/Simple/Configure.hs +++ b/Cabal/Distribution/Simple/Configure.hs @@ -470,7 +470,7 @@ configure (pkg_descr0, pbi) cfg pkg_descr0'' of Right r -> return r Left missing -> - die $ "At least one of the following dependencies is missing:\n" + die $ "Encountered missing dependencies:\n" ++ (render . nest 4 . sep . punctuate comma . map (disp . simplifyDependency) $ missing)