Skip to content

Commit

Permalink
cabal-solver: fix parseCabalOutput on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
borsboom committed May 20, 2016
1 parent cebe10e commit c6dac65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Stack/Solver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c6dac65

Please sign in to comment.