Skip to content

Commit

Permalink
Don't ignore goal order parameter when generating summarized solver log.
Browse files Browse the repository at this point in the history
After haskell#5012, the solver generated the summarized log by using a goal order that
preferred goals from the final conflict set.  It completely ignored the original
goal order parameter.  This caused a failure in one of the unit tests that set a
goal order and then checked the summarized log, when the solver's goal order
changed for other reasons (See haskell#5012).
  • Loading branch information
grayjay committed Feb 9, 2018
1 parent 2a37544 commit bbf7e37
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cabal-install/Distribution/Solver/Modular.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ module Distribution.Solver.Modular
-- and finally, we have to convert back the resulting install
-- plan.

import Prelude ()
import Distribution.Client.Compat.Prelude

import Data.Map (Map)
import qualified Data.Map as M
import Data.Set (Set)
Expand Down Expand Up @@ -143,9 +146,14 @@ solve' sc cinfo idx pkgConfigDB pprefs gcs pns =
rerunSolverForErrorMsg :: ConflictSet -> String -> String
rerunSolverForErrorMsg cs finalMsg =
let sc' = sc {
goalOrder = Just (preferGoalsFromConflictSet cs)
goalOrder = Just goalOrder'
, maxBackjumps = Just 0
}

-- Preferring goals from the conflict set takes precedence over the
-- original goal order.
goalOrder' = preferGoalsFromConflictSet cs <> fromMaybe mempty (goalOrder sc)

in unlines ("Could not resolve dependencies:" : messages (runSolver sc'))
++ finalMsg

Expand Down

0 comments on commit bbf7e37

Please sign in to comment.