well-typed / cborg

Binary serialisation in the CBOR format
https://hackage.haskell.org/package/cborg
191 stars 86 forks source link

cborg 0.2.3.0 fails to build against latest primitive; needs revision #242

Closed vmchale closed 4 years ago

vmchale commented 4 years ago

Here is build output:

vanessa@vanessa-desktop /tmp/cborg-0.2.3.0 🌸 cabal build
Resolving dependencies...
Build profile: -w ghc-8.10.1 -O1
In order, the following will be built (use -v for more details):
 - cborg-0.2.3.0 (lib) (first run)
Configuring library for cborg-0.2.3.0..
Preprocessing library for cborg-0.2.3.0..
Building library for cborg-0.2.3.0..
[ 1 of 14] Compiling Codec.CBOR.ByteArray.Internal ( src/Codec/CBOR/ByteArray/Internal.hs, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/ByteArray/Internal.o, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/ByteArray/Internal.dyn_o )
[ 2 of 14] Compiling Codec.CBOR.ByteArray.Sliced ( src/Codec/CBOR/ByteArray/Sliced.hs, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/ByteArray/Sliced.o, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/ByteArray/Sliced.dyn_o )
[ 3 of 14] Compiling Codec.CBOR.ByteArray ( src/Codec/CBOR/ByteArray.hs, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/ByteArray.o, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/ByteArray.dyn_o )
[ 4 of 14] Compiling Codec.CBOR.Decoding ( src/Codec/CBOR/Decoding.hs, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/Decoding.o, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/Decoding.dyn_o )
[ 5 of 14] Compiling Codec.CBOR.Encoding[boot] ( src/Codec/CBOR/Encoding.hs-boot, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/Encoding.o-boot, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/Encoding.dyn_o )
[ 6 of 14] Compiling Codec.CBOR.FlatTerm[boot] ( src/Codec/CBOR/FlatTerm.hs-boot, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/FlatTerm.o-boot, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/FlatTerm.dyn_o )
[ 7 of 14] Compiling Codec.CBOR.Encoding ( src/Codec/CBOR/Encoding.hs, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/Encoding.o, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/Encoding.dyn_o )
[ 8 of 14] Compiling Codec.CBOR.Magic ( src/Codec/CBOR/Magic.hs, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/Magic.o, /tmp/cborg-0.2.3.0/dist-newstyle/build/x86_64-linux/ghc-8.10.1/cborg-0.2.3.0/build/Codec/CBOR/Magic.dyn_o )

src/Codec/CBOR/Magic.hs:569:9: error:
    Ambiguous occurrence ‘copyByteArrayToPtr’
    It could refer to
       either ‘Prim.copyByteArrayToPtr’,
              imported from ‘Data.Primitive.ByteArray’ at src/Codec/CBOR/Magic.hs:103:1-49
           or ‘Codec.CBOR.Magic.copyByteArrayToPtr’,
              defined at src/Codec/CBOR/Magic.hs:597:1
    |
569 |         copyByteArrayToPtr ba off ptr len
    |         ^^^^^^^^^^^^^^^^^^

I guess it needs a package revision!

jimenezrick commented 4 years ago

Same issue here, primitive exports now Data.Primitive.ByteArray.copyByteArrayToPtrSource (since: 0.7.1.0) causing the ambiguity.

https://hackage.haskell.org/package/primitive-0.7.1.0/docs/Data-Primitive-ByteArray.html#v:copyByteArrayToPtr

LeventErkok commented 4 years ago

Just wanted to chime in and express support for this to be fixed. (I suppose a import hiding might fix it?) It's causing issues in downstream tools. Thanks!

vmchale commented 4 years ago

Seems to be fixed :p