Skip to content

Conversation

@Blaisorblade
Copy link
Collaborator

@Blaisorblade Blaisorblade commented Aug 17, 2016

As shown in #2502, cabal init --solver can fail with Could not parse cabal-install errors on Windows. The problem boils down to the fact that
we test isSuffixOf "suffix" "stuff suffix\r", which is false, so we
should better strip \r before calling isSuffixOf.

I've verified that \r is actually there only indirectly; I inferred it
from the presence of stripCR and the parse failure, and I've recently
seen the behavior of lines on strings with Windows line ends.

Testing confirms this PR fixes the bug—the original procedure fails with
the parent commit and works with this one.

Fixes #2502.

As shown in #2502, `cabal init --solver` can fail with `Could not parse
cabal-install errors` on Windows.  The problem boils down to the fact that
we test `isSuffixOf "suffix" "stuff suffix\r"`, which is false, so we
should better strip `\r` before calling `isSuffixOf`.

I've verified that `\r` is actually there only indirectly; I inferred it
from the presence of `stripCR` and the parse failure, and I've recently
seen the behavior of lines on strings with Windows line ends.

Testing confirms this PR fixes the bug—the original procedure fails with
the parent commit and works with this one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stack shouldn't try and use a 8.0.1 resolver when the base bound is for an older version.

3 participants