haskell / random

Random number library
Other
53 stars 50 forks source link

ghc 8.4 release -- fixing sized work build issues #136

Closed cartazio closed 1 year ago

cartazio commented 1 year ago

anything depending on random currently can't build

Configuring library for random-1.2.0..
Preprocessing library for random-1.2.0..
Building library for random-1.2.0..
[1 of 3] Compiling System.Random.Internal ( src/System/Random/Internal.hs, dist/build/System/Random/Internal.o, dist/build/System/Random/Internal.dyn_o )

src/System/Random/Internal.hs:748:46: error:
    • Couldn't match expected type ‘Word#’ with actual type ‘Word32#’
    • In the first argument of ‘word2Int#’, namely ‘w#’
      In the first argument of ‘chr#’, namely ‘(word2Int# w#)’
      In the first argument of ‘C#’, namely ‘(chr# (word2Int# w#))’
    |
748 | word32ToChar (W32# w#) = C# (chr# (word2Int# w#))
    |                                              ^^

src/System/Random/Internal.hs:752:30: error:
    • Couldn't match expected type ‘Word32#’ with actual type ‘Word#’
    • In the first argument of ‘W32#’, namely ‘(int2Word# (ord# c#))’
      In the expression: W32# (int2Word# (ord# c#))
      In an equation for ‘charToWord32’:
          charToWord32 (C# c#) = W32# (int2Word# (ord# c#))
    |
752 | charToWord32 (C# c#) = W32# (int2Word# (ord# c#))
    |                              ^^^^^^^^^^^^^^^^^^^

i can prepare a PR if that would help with speeding up the turn around, this is blocking some stuff i'm helping folks with

thx

lehins commented 1 year ago

I can suggest switching to the newest version of random.

If I misunderstood you for any reason and any of the points I mentioned above are incorrect, please reopen the ticket.

Closing as duplicate of #99

Bodigrim commented 1 year ago

[1 of 3] Compiling System.Random.Internal ( src/System/Random/Internal.hs, dist/build/System/Random/Internal.o, dist/build/System/Random/Internal.dyn_o )

dist/build folder suggests that you are using an outdated cabal v1-build, which is a very strange choice for GHC 9.4. Try updating cabal to 3.0+ and cabal update then?

cartazio commented 1 year ago

This was definitely with recent cabal. The problem turned out to be that the folks had a stack generated prject file and a bad cabal freeze that was trolling me

cartazio commented 1 year ago

And yes I meant 9.4, it’s been a long January :)