haskell-hvr / cassava

A CSV parsing and encoding library optimized for ease of use and high performance
http://hackage.haskell.org/package/cassava
BSD 3-Clause "New" or "Revised" License
222 stars 105 forks source link

Cannot build with GHC 8.10 release candidate #179

Closed andrewthad closed 4 years ago

andrewthad commented 4 years ago

This command sequences fails:

cabal unpack cassava-0.5.2.0
cd cassava-0.5.2.0
cabal build -w ghc-8.10.1 --builddir dist-8.10.1 --allow-newer

I get several errors which all stem from

src/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 .c
abal 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 f
ile wasn't elided.
hvr commented 4 years ago

btw, such a undiscriminated use of --allow-newer is something we should really deprecate in cabal; that's just asking for trouble... :-/

Here's a more principled use of --allow-newer which is more surgical rather than the naive "ignore all constraints on bytestring regardless of any invariants" sledge-hammer:

--allow-newer="cassava-0.5.2.0:bytestring"
--constraint="cassava -bytestring--lt-0_10_4"
--constraint="bytestring >= 0.10.4"
JivanRoquet commented 3 years ago

Hello @hvr thanks for the tip, is there any way to specify an array for allow-newer in stack.yaml ?

I tried this

allow-newer:
  - cassava-0.5.2.0:bytestring

but Stack complains:

Error in $['allow-newer']: failed to parse field 'allow-newer': expected Bool, but encountered Array