Skip to content

./Setup configure --flags= ... fails with ghc-8.2.2-rc1 #4808

New issue

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

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

Already on GitHub? # to your account

Closed
duog opened this issue Oct 3, 2017 · 3 comments
Closed

./Setup configure --flags= ... fails with ghc-8.2.2-rc1 #4808

duog opened this issue Oct 3, 2017 · 3 comments

Comments

@duog
Copy link
Contributor

duog commented Oct 3, 2017

The cabal packaged with ghc-8.2.2-rc1 (Cabal commit: c84a3c7) fails when passed Setup configure is passed "--flags=".

See a log here:
https://gist.github.com/duog/260589ccbf63200addbea00f25436a48

@23Skidoo
Copy link
Member

23Skidoo commented Oct 3, 2017

@hvr just confirmed that this is a regression relative to 2.0.0.2.

@hvr
Copy link
Member

hvr commented Oct 16, 2017

@bgamari @23Skidoo @phadej

I've noticed this occurs on HEAD too; one way to workaround this is the following change to the parser:

diff --git a/Cabal/Distribution/Types/GenericPackageDescription.hs b/Cabal/Distribution/Types/GenericPackageDescription.hs
index 1547ade..a278370 100644
--- a/Cabal/Distribution/Types/GenericPackageDescription.hs
+++ b/Cabal/Distribution/Types/GenericPackageDescription.hs
@@ -159,7 +159,7 @@ dispFlagAssignment = Disp.hsep . map (Disp.text . showFlagValue)
 
 -- | Parses a flag assignment.
 parsecFlagAssignment :: ParsecParser FlagAssignment
-parsecFlagAssignment = P.sepBy1 (onFlag <|> offFlag) P.skipSpaces1
+parsecFlagAssignment = P.sepBy (onFlag <|> offFlag) P.skipSpaces1
   where
     onFlag = do
         P.optional (P.char '+')
@@ -172,7 +172,7 @@ parsecFlagAssignment = P.sepBy1 (onFlag <|> offFlag) P.skipSpaces1
 
 -- | Parses a flag assignment.
 parseFlagAssignment :: Parse.ReadP r FlagAssignment
-parseFlagAssignment = Parse.sepBy1 parseFlagValue Parse.skipSpaces1
+parseFlagAssignment = Parse.sepBy parseFlagValue Parse.skipSpaces1
   where
     parseFlagValue =
           (do Parse.optional (Parse.char '+')

Fwiw, dispFlagAssignment [] results in an empty output; so this would be consistent.

hvr added a commit to hvr/cabal that referenced this issue Oct 18, 2017
@hvr hvr mentioned this issue Oct 18, 2017
4 tasks
phadej added a commit that referenced this issue Oct 26, 2017
phadej pushed a commit that referenced this issue Oct 26, 2017
@23Skidoo
Copy link
Member

This was fixed by #4830.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants