haskell / attoparsec

A fast Haskell library for parsing ByteStrings
http://hackage.haskell.org/package/attoparsec
Other
514 stars 93 forks source link

problem building 0.14.4 #222

Closed bfrk closed 11 months ago

bfrk commented 12 months ago

This occurred when building the head of darcs on Debian bullseye. (We had attoparsec < 0.15 in our darcs.cabal. With < 0.14.4 it works flawlessly.)

Here is the build output:

Failed to build attoparsec-0.14.4.
Build log (
/home/user/franksen/.cabal/logs/ghc-8.8.4/attoparsec-0.14.4-b1689e6bd4187328671e41cdb199e46cf407805fd8b166d39dc0575faad99f55.log
):
Configuring library for attoparsec-0.14.4..
Warning:
    This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure.
      package text (text-1.2.4.0) requires binary-0.8.7.0
      package scientific (scientific-0.3.7.0-d80a4d10056c493c2686791649721ff11b443b3c3457b0e406d762ac0adebdfd) requires binary-0.8.7.0
      package text (text-2.0.2-633b852027b20c0fa15cdc6aa0582a16799aa2dba778e609e65489fd22c4a0c8) requires binary-0.8.9.1-0f5f037a6179f75aed6abb77ac1a7a0ae025cbd9e3dcd0e23ca509b9fae6dc9a
      package text (text-1.2.4.0) requires bytestring-0.10.10.1
      package scientific (scientific-0.3.7.0-d80a4d10056c493c2686791649721ff11b443b3c3457b0e406d762ac0adebdfd) requires bytestring-0.10.10.1
      package hashable (hashable-1.4.3.0-5f8d3849d8857f853f30d4feee05da5bd8f65d15d19b90118a2f4c505af6c375) requires bytestring-0.10.10.1
      package binary (binary-0.8.7.0) requires bytestring-0.10.10.1
      package attoparsec (attoparsec-0.14.4) requires bytestring-0.10.10.1
      package text (text-2.0.2-633b852027b20c0fa15cdc6aa0582a16799aa2dba778e609e65489fd22c4a0c8) requires bytestring-0.11.4.0-7180aa0dc02744d1241f201d995e3f2c13042c6a53630f87ca36e74ecf16120e
      package binary (binary-0.8.9.1-0f5f037a6179f75aed6abb77ac1a7a0ae025cbd9e3dcd0e23ca509b9fae6dc9a) requires bytestring-0.11.4.0-7180aa0dc02744d1241f201d995e3f2c13042c6a53630f87ca36e74ecf16120e
      package attoparsec (attoparsec-0.14.4-68a450eeb00722f50f02f80ef991269e3c5f5925b9a53e027649b425a17ae8de) requires bytestring-0.11.4.0-7180aa0dc02744d1241f201d995e3f2c13042c6a53630f87ca36e74ecf16120e
      package scientific (scientific-0.3.7.0-d80a4d10056c493c2686791649721ff11b443b3c3457b0e406d762ac0adebdfd) requires text-1.2.4.0
      package hashable (hashable-1.4.3.0-5f8d3849d8857f853f30d4feee05da5bd8f65d15d19b90118a2f4c505af6c375) requires text-1.2.4.0
      package attoparsec (attoparsec-0.14.4) requires text-1.2.4.0
      package attoparsec (attoparsec-0.14.4-68a450eeb00722f50f02f80ef991269e3c5f5925b9a53e027649b425a17ae8de) requires text-2.0.2-633b852027b20c0fa15cdc6aa0582a16799aa2dba778e609e65489fd22c4a0c8
Preprocessing library for attoparsec-0.14.4..
Building library for attoparsec-0.14.4..
[ 1 of 16] Compiling Data.Attoparsec.Internal.Types ( Data/Attoparsec/Internal/Types.hs, dist/build/Data/Attoparsec/Internal/Types.o )

Data/Attoparsec/Internal/Types.hs:242:18: error:
    • Couldn't match type ‘ByteString’
                     with ‘bytestring-0.11.4.0:Data.ByteString.Internal.Type.ByteString’
      NB: ‘bytestring-0.11.4.0:Data.ByteString.Internal.Type.ByteString’
            is defined in ‘Data.ByteString.Internal.Type’
                in package ‘bytestring-0.11.4.0’
          ‘ByteString’
            is defined in ‘Data.ByteString.Internal’
                in package ‘bytestring-0.10.10.1’
      Expected type: State ByteString -> ByteString -> State ByteString
        Actual type: B.Buffer
                     -> bytestring-0.11.4.0:Data.ByteString.Internal.Type.ByteString
                     -> B.Buffer
    • In the expression: B.pappend
      In an equation for ‘pappendChunk’: pappendChunk = B.pappend
      In the instance declaration for ‘Chunk ByteString’
    |
242 |   pappendChunk = B.pappend
    |                  ^^^^^^^^^

Data/Attoparsec/Internal/Types.hs:257:18: error:
    • Couldn't match type ‘Text’
                     with ‘text-2.0.2:Data.Text.Internal.Text’
      NB: ‘text-2.0.2:Data.Text.Internal.Text’
            is defined in ‘Data.Text.Internal’ in package ‘text-2.0.2’
          ‘Text’ is defined in ‘Data.Text.Internal’ in package ‘text-1.2.4.0’
      Expected type: State Text -> Text -> State Text
        Actual type: T.Buffer
                     -> text-2.0.2:Data.Text.Internal.Text -> T.Buffer
    • In the expression: T.pappend
      In an equation for ‘pappendChunk’: pappendChunk = T.pappend
      In the instance declaration for ‘Chunk Text’
    |
257 |   pappendChunk = T.pappend
    |                  ^^^^^^^^^

Data/Attoparsec/Internal/Types.hs:262:41: error:
    • Couldn't match expected type ‘Iter’
                  with actual type ‘text-2.0.2:Data.Text.Unsafe.Iter’
      NB: ‘text-2.0.2:Data.Text.Unsafe.Iter’
            is defined in ‘Data.Text.Unsafe’ in package ‘text-2.0.2’
          ‘Iter’ is defined in ‘Data.Text.Unsafe’ in package ‘text-1.2.4.0’
    • In the expression: T.iter buf i
      In a pattern binding: Iter c l = T.iter buf i
      In the expression: let Iter c l = T.iter buf i in Just (c, l)
    |
262 |     | i < T.length buf = let Iter c l = T.iter buf i in Just (c, l)
    |                                         ^^^^^^^^^^^^
cabal: Failed to build attoparsec-0.14.4 (which is required by darcs-2.17.3).
See the build log above for details.
Bodigrim commented 11 months ago

dist/build/Data/Attoparsec/Internal/Types.o suggests cabal v1-build, which is outdated and out of support. Could you possibly try with cabal v2-build?

bfrk commented 11 months ago

Thanks. This is very strange. I haven't used cabal v1-build in ages (always using plain cabal build) and I am pretty sure I didn't when I got this error. I can no longer reproduce the problem, so might as well close it.

bfrk commented 11 months ago

Contrary to what I said in my previous message the problem persists and is reproducible on Debian bullseye with the ghc (8.8.4) and cabal (3.0.0.0 compiled using version 3.0.1.0 of the Cabal library) from the distro packages. It works fine with a newer version of cabal (3.8, installed via ghcup) so I guess this is a bug in the old version of cabal from the distro, rather than attoparsec.