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

It's impossible to build cassava with GHCHEAD post-#161 #171

Closed
RyanGlScott opened this issue Jul 22, 2018 · 5 comments
Closed

It's impossible to build cassava with GHCHEAD post-#161 #171

RyanGlScott opened this issue Jul 22, 2018 · 5 comments

Comments

@RyanGlScott
Copy link
Contributor

After #161, one cannot build the cassava library using a GHCHEAD configuration. Here is an example of a build failure from lens's GHC 8.6.1 Travis build matrix entry:

Failed to build cassava-0.5.1.0.
Build log (
/home/travis/.cabal/logs/ghc-8.6.0.20180714/cassava-0.5.1.0-7e18f6cd87ea4b7167810387f8520b18f7b969c5a859e28b2a3cf23ef7b6a170.log
):
Configuring library for cassava-0.5.1.0..
Preprocessing library for cassava-0.5.1.0..
Building library for cassava-0.5.1.0..

Data/Csv/Conversion.hs:26:3: error:
     error: #error **INVARIANT BROKEN** Detected invalid combination of `text-short` and `bytestring` versions. Please verify the `pre-bytestring-0.10-4` flag-logic in the .cabal file wasn't elided.
     # error **INVARIANT BROKEN** Detected invalid combination of `text-short` and `bytestring` versions. Please verify the `pre-bytestring-0.10-4` flag-logic in the .cabal file wasn't elided.
       ^
   |
26 | # error **INVARIANT BROKEN** Detected invalid combination of `text-short` and `bytestring` versions. Please verify the `pre-bytestring-0.10-4` flag-logic in the .cabal file wasn't elided.
   |   ^

Data/Csv/Conversion.hs:99:0: error:
     warning: "MIN_VERSION_text_short" is not defined [-Wundef]
     #if MIN_VERSION_text_short(0,1,0)
     ^
   |
99 | #if MIN_VERSION_text_short(0,1,0)
   | ^

Data/Csv/Conversion.hs:99:0: error:
     error: missing binary operator before token "("
   |
99 | #if MIN_VERSION_text_short(0,1,0)
   | ^

Data/Csv/Conversion.hs:1010:0: error:
     warning: "MIN_VERSION_text_short" is not defined [-Wundef]
     #if MIN_VERSION_text_short(0,1,0)
     ^
     |
1010 | #if MIN_VERSION_text_short(0,1,0)
     | ^

Data/Csv/Conversion.hs:1010:0: error:
     error: missing binary operator before token "("
     |
1010 | #if MIN_VERSION_text_short(0,1,0)
     | ^
`gcc' failed in phase `C pre-processor'. (Exit code: 1)
cabal: Failed to build cassava-0.5.1.0 (which is required by
criterion-1.5.0.0). See the build log above for details.

@phadej suspects this is because we are passing --allow-newer=bytestring.

@hvr
Copy link
Member

hvr commented Jul 22, 2018

It's a known issue with the heuristic of --allow-newer for the < and <= operators (which necessitates the use of --constraints on cabal flags to workaround); I was worried about such scenarios, hence why I added those CPP safeguards so we'd notice when this happens.

Anyway, a pragmatic short-term workaround is to add a tweaked .cabal file to head.hackage

@RyanGlScott
Copy link
Contributor Author

Anyway, a pragmatic short-term workaround is to add a tweaked .cabal file to head.hackage

Sounds reasonable to me. Do you mind preparing such a patch? I'll admit that I don't feel confident enough to perform surgery on cassava.cabal myself, given the complexities involved here.

@hvr
Copy link
Member

hvr commented Jul 22, 2018

@RyanGlScott I've added something to the head.hackage index right now (not yet pushed to the head.hackage git repo); can you give it a try and let me know if it helps?

@RyanGlScott
Copy link
Contributor Author

Thanks @hvr. With that patch, I am able to build cassava with a GHCHEAD configuration again (as demonstrated here).

hvr added a commit to hvr/head.hackage that referenced this issue Jul 23, 2018
@hvr
Copy link
Member

hvr commented Jul 25, 2018

I think we can close this one for now

@hvr hvr closed this as completed Jul 25, 2018
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

No branches or pull requests

2 participants