well-typed / cborg

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

cborg fails to compile on m1 darwin (aarch64-specific maybe?) #283

Closed vmchale closed 2 years ago

vmchale commented 2 years ago

Here is the failure:

[ 8 of 14] Compiling Codec.CBOR.Magic ( src/Codec/CBOR/Magic.hs, dist/build/Codec/CBOR/Magic.o, dist/build/Codec/CBOR/Magic.dyn_o )

src/Codec/CBOR/Magic.hs:194:20: error:
    • Couldn't match expected type ‘Word16#’ with actual type ‘Word8#’
    • In the first argument of ‘W16#’, namely ‘w0#’
      In the first argument of ‘unsafeShiftL’, namely ‘W16# w0#’
      In the first argument of ‘(.|.)’, namely
        ‘W16# w0# `unsafeShiftL` 8’
    |
194 |        w1# -> W16# w0# `unsafeShiftL` 8 .|.
    |                    ^^^

src/Codec/CBOR/Magic.hs:195:20: error:
    • Couldn't match expected type ‘Word16#’ with actual type ‘Word8#’
    • In the first argument of ‘W16#’, namely ‘w1#’
      In the second argument of ‘(.|.)’, namely ‘W16# w1#’
      In the expression: W16# w0# `unsafeShiftL` 8 .|. W16# w1#
    |
195 |               W16# w1#
    |                    ^^^

src/Codec/CBOR/Magic.hs:205:24: error:
    • Couldn't match expected type ‘Word32#’ with actual type ‘Word8#’
    • In the first argument of ‘W32#’, namely ‘w0#’
      In the first argument of ‘unsafeShiftL’, namely ‘W32# w0#’
      In the first argument of ‘(.|.)’, namely
        ‘W32# w0# `unsafeShiftL` 24’
    |
205 |            w3# -> W32# w0# `unsafeShiftL` 24 .|.
    |                        ^^^

src/Codec/CBOR/Magic.hs:206:24: error:
    • Couldn't match expected type ‘Word32#’ with actual type ‘Word8#’
    • In the first argument of ‘W32#’, namely ‘w1#’
      In the first argument of ‘unsafeShiftL’, namely ‘W32# w1#’
      In the second argument of ‘(.|.)’, namely
        ‘W32# w1# `unsafeShiftL` 16’
    |
206 |                   W32# w1# `unsafeShiftL` 16 .|.
    |                        ^^^

src/Codec/CBOR/Magic.hs:207:24: error:
    • Couldn't match expected type ‘Word32#’ with actual type ‘Word8#’
    • In the first argument of ‘W32#’, namely ‘w2#’
      In the first argument of ‘unsafeShiftL’, namely ‘W32# w2#’
      In the second argument of ‘(.|.)’, namely
        ‘W32# w2# `unsafeShiftL` 8’
    |
207 |                   W32# w2# `unsafeShiftL`  8 .|.
    |                        ^^^

src/Codec/CBOR/Magic.hs:208:24: error:
    • Couldn't match expected type ‘Word32#’ with actual type ‘Word8#’
    • In the first argument of ‘W32#’, namely ‘w3#’
      In the second argument of ‘(.|.)’, namely ‘W32# w3#’
      In the expression:
        W32# w0# `unsafeShiftL` 24 .|. W32# w1# `unsafeShiftL` 16
          .|. W32# w2# `unsafeShiftL` 8
          .|. W32# w3#
    |
208 |                   W32# w3#
    |                        ^^^

src/Codec/CBOR/Magic.hs:226:29: error:
    • Couldn't match expected type ‘Word#’ with actual type ‘Word8#’
    • In the first argument of ‘w’, namely ‘w0#’
      In the first argument of ‘unsafeShiftL’, namely ‘w w0#’
      In the first argument of ‘(.|.)’, namely ‘w w0# `unsafeShiftL` 56’
    |
226 |                    w7# -> w w0# `unsafeShiftL` 56 .|.
    |                             ^^^

src/Codec/CBOR/Magic.hs:227:29: error:
    • Couldn't match expected type ‘Word#’ with actual type ‘Word8#’
    • In the first argument of ‘w’, namely ‘w1#’
      In the first argument of ‘unsafeShiftL’, namely ‘w w1#’
      In the second argument of ‘(.|.)’, namely ‘w w1# `unsafeShiftL` 48’
    |
227 |                           w w1# `unsafeShiftL` 48 .|.
    |                             ^^^

src/Codec/CBOR/Magic.hs:228:29: error:
    • Couldn't match expected type ‘Word#’ with actual type ‘Word8#’
    • In the first argument of ‘w’, namely ‘w2#’
      In the first argument of ‘unsafeShiftL’, namely ‘w w2#’
      In the second argument of ‘(.|.)’, namely ‘w w2# `unsafeShiftL` 40’
    |
228 |                           w w2# `unsafeShiftL` 40 .|.
    |                             ^^^

src/Codec/CBOR/Magic.hs:229:29: error:
    • Couldn't match expected type ‘Word#’ with actual type ‘Word8#’
    • In the first argument of ‘w’, namely ‘w3#’
      In the first argument of ‘unsafeShiftL’, namely ‘w w3#’
      In the second argument of ‘(.|.)’, namely ‘w w3# `unsafeShiftL` 32’
    |
229 |                           w w3# `unsafeShiftL` 32 .|.
    |                             ^^^

src/Codec/CBOR/Magic.hs:230:29: error:
    • Couldn't match expected type ‘Word#’ with actual type ‘Word8#’
    • In the first argument of ‘w’, namely ‘w4#’
      In the first argument of ‘unsafeShiftL’, namely ‘w w4#’
      In the second argument of ‘(.|.)’, namely ‘w w4# `unsafeShiftL` 24’
    |
230 |                           w w4# `unsafeShiftL` 24 .|.
    |                             ^^^

src/Codec/CBOR/Magic.hs:231:29: error:
    • Couldn't match expected type ‘Word#’ with actual type ‘Word8#’
    • In the first argument of ‘w’, namely ‘w5#’
      In the first argument of ‘unsafeShiftL’, namely ‘w w5#’
      In the second argument of ‘(.|.)’, namely ‘w w5# `unsafeShiftL` 16’
    |
231 |                           w w5# `unsafeShiftL` 16 .|.
    |                             ^^^

src/Codec/CBOR/Magic.hs:232:29: error:
    • Couldn't match expected type ‘Word#’ with actual type ‘Word8#’
    • In the first argument of ‘w’, namely ‘w6#’
      In the first argument of ‘unsafeShiftL’, namely ‘w w6#’
      In the second argument of ‘(.|.)’, namely ‘w w6# `unsafeShiftL` 8’
    |
232 |                           w w6# `unsafeShiftL`  8 .|.
    |                             ^^^

src/Codec/CBOR/Magic.hs:233:29: error:
    • Couldn't match expected type ‘Word#’ with actual type ‘Word8#’
    • In the first argument of ‘w’, namely ‘w7#’
      In the second argument of ‘(.|.)’, namely ‘w w7#’
      In the expression:
        w w0# `unsafeShiftL` 56 .|. w w1# `unsafeShiftL` 48
          .|. w w2# `unsafeShiftL` 40
          .|. w w3# `unsafeShiftL` 32
          .|. w w4# `unsafeShiftL` 24
          .|. w w5# `unsafeShiftL` 16
          .|. w w6# `unsafeShiftL` 8
          .|. w w7#
    |
233 |                           w w7#
    |                             ^^^
cabal: Failed to build cborg-0.2.6.0. See the build log above for details.

this is with primitive 0.7.3.0

alexbiehl commented 2 years ago

In https://github.com/well-typed/cborg/pull/285 I have set up CI for ghc-9.2.2 on linux and the build of that particular modules succeeds (builds fails a little latter due to missing type class instance - unrelated) so it might very well be aarch64 specific

alexbiehl commented 2 years ago

This seems to be a duplicate of https://github.com/well-typed/cborg/issues/276