Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solver: parse cabal errors also on Windows #2508

Merged
merged 1 commit into from
Aug 18, 2016

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.
2 participants