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

Fix errors in 32 bit compat shims, update hie.yaml #296

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FinleyMcIlwaine
Copy link
Collaborator

@FinleyMcIlwaine FinleyMcIlwaine commented Jul 28, 2022

Fixes the errors reported in #293, adds the serialise benchmark components to hie.yaml. The cborg changes are just naive fixes for type errors and I am not sure how semantically sound they are, but I did observe that the reported build errors no longer occur and the tests pass (tested using i686/ubuntu Docker image).

@bgamari
Copy link
Member

bgamari commented Aug 9, 2022

@FinleyMcIlwaine in principle this looks good but it would be good to validate with GHC 9.4.

@parsonsmatt
Copy link
Contributor

I've tried building locally with GHC 9.4.1 and it is still failing:

Building library for cborg-0.2.7.0..
[ 1 of 14] Compiling Codec.CBOR.ByteArray.Internal ( src/Codec/CBOR/ByteArray/Internal.hs, dist/build/Codec/CBOR/ByteArray/Internal.o, dist/build/Codec/CBOR/ByteArray/Internal.dyn_o )
[ 2 of 14] Compiling Codec.CBOR.ByteArray.Sliced ( src/Codec/CBOR/ByteArray/Sliced.hs, dist/build/Codec/CBOR/ByteArray/Sliced.o, dist/build/Codec/CBOR/ByteArray/Sliced.dyn_o )

src/Codec/CBOR/ByteArray/Sliced.hs:44:1: warning: [-Wunused-imports]
    The qualified import of ‘Data.ByteString.Short.Internal’ is redundant
      except perhaps to import instances from ‘Data.ByteString.Short.Internal’
    To import instances alone, use: import Data.ByteString.Short.Internal()
   |
44 | import qualified Data.ByteString.Short.Internal as BSS
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 3 of 14] Compiling Codec.CBOR.ByteArray ( src/Codec/CBOR/ByteArray.hs, dist/build/Codec/CBOR/ByteArray.o, dist/build/Codec/CBOR/ByteArray.dyn_o )

src/Codec/CBOR/ByteArray.hs:39:1: warning: [-Wunused-imports]
    The qualified import of ‘Data.ByteString.Short.Internal’ is redundant
      except perhaps to import instances from ‘Data.ByteString.Short.Internal’
    To import instances alone, use: import Data.ByteString.Short.Internal()
   |
39 | import qualified Data.ByteString.Short.Internal as BSS
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 4 of 14] Compiling Codec.CBOR.Decoding ( src/Codec/CBOR/Decoding.hs, dist/build/Codec/CBOR/Decoding.o, dist/build/Codec/CBOR/Decoding.dyn_o )

src/Codec/CBOR/Decoding.hs:408:54: error:
    • Couldn't match expected type ‘Word64#’ with actual type ‘Word#’
    • In the first argument of ‘W64#’, namely ‘w#’
      In the first argument of ‘k’, namely ‘(W64# w#)’
      In the expression: k (W64# w#)
    |
408 |   Decoder (\k -> return (ConsumeWord (\w# -> k (W64# w#))))
    |                                                      ^^

src/Codec/CBOR/Decoding.hs:427:57: error:
    • Couldn't match expected type ‘Word64#’ with actual type ‘Word#’
    • In the first argument of ‘W64#’, namely ‘w#’
      In the first argument of ‘k’, namely ‘(W64# w#)’
      In the expression: k (W64# w#)
    |
427 |   Decoder (\k -> return (ConsumeNegWord (\w# -> k (W64# w#))))
    |                                                         ^^

src/Codec/CBOR/Decoding.hs:467:53: error:
    • Couldn't match expected type ‘Int64#’ with actual type ‘Int#’
    • In the first argument of ‘I64#’, namely ‘n#’
      In the first argument of ‘k’, namely ‘(I64# n#)’
      In the expression: k (I64# n#)
    |
467 |   Decoder (\k -> return (ConsumeInt (\n# -> k (I64# n#))))
    |                                                     ^^

src/Codec/CBOR/Decoding.hs:507:63: error:
    • Couldn't match expected type ‘Word64#’ with actual type ‘Word#’
    • In the first argument of ‘W64#’, namely ‘w#’
      In the first argument of ‘k’, namely ‘(W64# w#)’
      In the expression: k (W64# w#)
    |
507 |   Decoder (\k -> return (ConsumeWordCanonical (\w# -> k (W64# w#))))
    |                                                               ^^

src/Codec/CBOR/Decoding.hs:526:66: error:
    • Couldn't match expected type ‘Word64#’ with actual type ‘Word#’
    • In the first argument of ‘W64#’, namely ‘w#’
      In the first argument of ‘k’, namely ‘(W64# w#)’
      In the expression: k (W64# w#)
    |
526 |   Decoder (\k -> return (ConsumeNegWordCanonical (\w# -> k (W64# w#))))
    |                                                                  ^^

src/Codec/CBOR/Decoding.hs:566:62: error:
    • Couldn't match expected type ‘Int64#’ with actual type ‘Int#’
    • In the first argument of ‘I64#’, namely ‘n#’
      In the first argument of ‘k’, namely ‘(I64# n#)’
      In the expression: k (I64# n#)
    |
566 |   Decoder (\k -> return (ConsumeIntCanonical (\n# -> k (I64# n#))))
    |                                                              ^^

src/Codec/CBOR/Decoding.hs:740:53: error:
    • Couldn't match expected type ‘Word64#’ with actual type ‘Word#’
    • In the first argument of ‘W64#’, namely ‘w#’
      In the first argument of ‘k’, namely ‘(W64# w#)’
      In the expression: k (W64# w#)
    |
740 |   Decoder (\k -> return (ConsumeTag (\w# -> k (W64# w#))))
    |                                                     ^^

src/Codec/CBOR/Decoding.hs:761:62: error:
    • Couldn't match expected type ‘Word64#’ with actual type ‘Word#’
    • In the first argument of ‘W64#’, namely ‘w#’
      In the first argument of ‘k’, namely ‘(W64# w#)’
      In the expression: k (W64# w#)
    |
761 |   Decoder (\k -> return (ConsumeTagCanonical (\w# -> k (W64# w#))))
    |                                                              ^^

src/Codec/CBOR/Decoding.hs:960:74: error:
    • Couldn't match expected type ‘Int64#’ with actual type ‘Int#’
    • In the first argument of ‘I64#’, namely ‘off#’
      In the first argument of ‘k’, namely ‘(I64# off#)’
      In the expression: k (I64# off#)
    |
960 | peekByteOffset = Decoder (\k -> return (PeekByteOffset (\off# -> k (I64# off#))))
    |                                                                          ^^^^
[ 5 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:170:30: error:
    • Couldn't match expected type ‘Word64#’ with actual type ‘Word#’
    • In the first argument of ‘W64#’, namely
        ‘(byteSwap# (indexWord64OffAddr# ip# 0#))’
      In the expression: W64# (byteSwap# (indexWord64OffAddr# ip# 0#))
      In an equation for ‘grabWord64’:
          grabWord64 (Ptr ip#)
            = W64# (byteSwap# (indexWord64OffAddr# ip# 0#))
    |
170 | grabWord64 (Ptr ip#) = W64# (byteSwap# (indexWord64OffAddr# ip# 0#))
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Codec/CBOR/Magic.hs:170:41: error:
    • Couldn't match expected type ‘Word#’ with actual type ‘Word64#’
    • In the first argument of ‘byteSwap#’, namely
        ‘(indexWord64OffAddr# ip# 0#)’
      In the first argument of ‘W64#’, namely
        ‘(byteSwap# (indexWord64OffAddr# ip# 0#))’
      In the expression: W64# (byteSwap# (indexWord64OffAddr# ip# 0#))
    |
170 | grabWord64 (Ptr ip#) = W64# (byteSwap# (indexWord64OffAddr# ip# 0#))
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Codec/CBOR/Magic.hs:442:29: error:
    • Couldn't match expected type ‘Word#’ with actual type ‘Word64#’
    • In the first argument of ‘W#’, namely ‘w#’
      In the expression: W# w#
      In an equation for ‘word64ToWord’: word64ToWord (W64# w#) = W# w#
    |
442 | word64ToWord (W64# w#) = W# w#
    |                             ^^

src/Codec/CBOR/Magic.hs:495:17: error:
    • Couldn't match expected type ‘Word#’ with actual type ‘Word64#’
    • In the first argument of ‘ltWord#’, namely ‘w#’
      In the first argument of ‘isTrue#’, namely
        ‘(w# `ltWord#` 0x8000000000000000##)’
      In the expression: isTrue# (w# `ltWord#` 0x8000000000000000##)
    |
495 |   case isTrue# (w# `ltWord#` 0x8000000000000000##) of
    |                 ^^

src/Codec/CBOR/Magic.hs:496:34: error:
    • Couldn't match expected type ‘Word#’ with actual type ‘Word64#’
    • In the first argument of ‘word2Int#’, namely ‘w#’
      In the first argument of ‘I#’, namely ‘(word2Int# w#)’
      In the first argument of ‘Just’, namely ‘(I# (word2Int# w#))’
    |
496 |     True  -> Just (I# (word2Int# w#))
    |                                  ^^
[ 7 of 14] Compiling Codec.CBOR.Encoding[boot] ( src/Codec/CBOR/Encoding.hs-boot, dist/build/Codec/CBOR/Encoding.o-boot, dist/build/Codec/CBOR/Encoding.dyn_o-boot )
[ 8 of 14] Compiling Codec.CBOR.FlatTerm[boot] ( src/Codec/CBOR/FlatTerm.hs-boot, dist/build/Codec/CBOR/FlatTerm.o-boot, dist/build/Codec/CBOR/FlatTerm.dyn_o-boot )
[ 9 of 14] Compiling Codec.CBOR.Encoding ( src/Codec/CBOR/Encoding.hs, dist/build/Codec/CBOR/Encoding.o, dist/build/Codec/CBOR/Encoding.dyn_o )

@FinleyMcIlwaine
Copy link
Collaborator Author

This is now affected by haskell-foundation/foundation#565

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

Successfully merging this pull request may close these issues.

3 participants