From c6dac65e3174dea79df54ce6d56f3e98bc060ecc Mon Sep 17 00:00:00 2001 From: Emanuel Borsboom Date: Fri, 20 May 2016 10:59:20 -0700 Subject: [PATCH] cabal-solver: fix parseCabalOutput on Windows --- src/Stack/Solver.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Stack/Solver.hs b/src/Stack/Solver.hs index 7aef692cb5..19bebf2a7b 100644 --- a/src/Stack/Solver.hs +++ b/src/Stack/Solver.hs @@ -40,7 +40,7 @@ import Data.List ( (\\), isSuffixOf, intercalate import Data.List.Extra (groupSortOn) import Data.Map (Map) import qualified Data.Map as Map -import Data.Maybe (catMaybes, isNothing, mapMaybe) +import Data.Maybe (catMaybes, isNothing, mapMaybe, fromMaybe) import Data.Monoid import Data.Set (Set) import qualified Data.Set as Set @@ -170,6 +170,7 @@ cabalSolver menv cabalfps constraintType parseCabalOutput bs = do let ls = drop 1 $ dropWhile (not . T.isPrefixOf "In order, ") + $ map stripCR $ T.lines $ decodeUtf8 bs (errs, pairs) = partitionEithers $ map parseCabalOutputLine ls @@ -179,6 +180,7 @@ cabalSolver menv cabalfps constraintType \not be parsed: \n" ++ (T.unpack (T.intercalate "\n" errs)) + stripCR t = fromMaybe t (T.stripSuffix "\r" t) toConstraintArgs userFlagMap = [formatFlagConstraint package flag enabled