jberthold / packman

Evaluation-orthogonal serialisation of Haskell data, as a library
Other
59 stars 9 forks source link

cbits/Pack.c: error: ‘MUT_ARR_PTRS_FROZEN0’ undeclared #15

Closed juhp closed 5 years ago

juhp commented 5 years ago

Not sure why this started happening, but packman-0.5.0 no longer rebuilds in current Stackage Nightly:

Building library for packman-0.5.0..
[1 of 4] Compiling GHC.Packing.PackException ( dist/build/GHC/Packing/PackException.hs, dist/build/GHC/Packing/PackException.o )
[2 of 4] Compiling GHC.Packing.Type ( GHC/Packing/Type.hs, dist/build/GHC/Packing/Type.o )
[3 of 4] Compiling GHC.Packing.Core ( GHC/Packing/Core.hs, dist/build/GHC/Packing/Core.o )
[4 of 4] Compiling GHC.Packing      ( GHC/Packing.hs, dist/build/GHC/Packing.o )
cbits/Pack.c: In function ‘getClosureInfo’:

cbits/Pack.c:589:10: error:
     error: ‘MUT_ARR_PTRS_FROZEN0’ undeclared (first use in this function)
         case MUT_ARR_PTRS_FROZEN0:
              ^
    |
589 |     case MUT_ARR_PTRS_FROZEN0:
    |          ^

cbits/Pack.c:589:10: error:
     note: each undeclared identifier is reported only once for each function it appears in
    |
589 |     case MUT_ARR_PTRS_FROZEN0:
    |          ^

cbits/Pack.c:590:10: error:
     error: ‘MUT_ARR_PTRS_FROZEN’ undeclared (first use in this function)
         case MUT_ARR_PTRS_FROZEN:
              ^
    |
590 |     case MUT_ARR_PTRS_FROZEN:
    |          ^

cbits/Pack.c:601:10: error:
     error: ‘SMALL_MUT_ARR_PTRS_FROZEN0’ undeclared (first use in this function)
         case SMALL_MUT_ARR_PTRS_FROZEN0:
              ^
    |
601 |     case SMALL_MUT_ARR_PTRS_FROZEN0:
    |          ^

cbits/Pack.c:602:10: error:
     error: ‘SMALL_MUT_ARR_PTRS_FROZEN’ undeclared (first use in this function)
         case SMALL_MUT_ARR_PTRS_FROZEN:
              ^
    |
602 |     case SMALL_MUT_ARR_PTRS_FROZEN:
    |          ^
cbits/Pack.c: In function ‘packClosure’:

cbits/Pack.c:1118:10: error:
     error: ‘MUT_ARR_PTRS_FROZEN0’ undeclared (first use in this function)
         case MUT_ARR_PTRS_FROZEN0:
              ^
     |
1118 |     case MUT_ARR_PTRS_FROZEN0:
     |          ^

cbits/Pack.c:1119:10: error:
     error: ‘MUT_ARR_PTRS_FROZEN’ undeclared (first use in this function)
         case MUT_ARR_PTRS_FROZEN:
              ^
     |
1119 |     case MUT_ARR_PTRS_FROZEN:
     |          ^

cbits/Pack.c:1166:10: error:
     error: ‘SMALL_MUT_ARR_PTRS_FROZEN’ undeclared (first use in this function)
         case SMALL_MUT_ARR_PTRS_FROZEN:
              ^
     |
1166 |     case SMALL_MUT_ARR_PTRS_FROZEN:
     |          ^

cbits/Pack.c:1167:10: error:
     error: ‘SMALL_MUT_ARR_PTRS_FROZEN0’ undeclared (first use in this function)
         case SMALL_MUT_ARR_PTRS_FROZEN0:
              ^
     |
1167 |     case SMALL_MUT_ARR_PTRS_FROZEN0:
     |          ^
cbits/Pack.c: In function ‘UnpackClosure’:

cbits/Pack.c:1940:18: error:
     error: ‘MUT_ARR_PTRS_FROZEN0’ undeclared (first use in this function)
                 case MUT_ARR_PTRS_FROZEN0:
                      ^
     |
1940 |             case MUT_ARR_PTRS_FROZEN0:
     |                  ^

cbits/Pack.c:1941:18: error:
     error: ‘MUT_ARR_PTRS_FROZEN’ undeclared (first use in this function)
                 case MUT_ARR_PTRS_FROZEN:
                      ^
     |
1941 |             case MUT_ARR_PTRS_FROZEN:
     |                  ^

cbits/Pack.c:1975:18: error:
     error: ‘SMALL_MUT_ARR_PTRS_FROZEN0’ undeclared (first use in this function)
                 case SMALL_MUT_ARR_PTRS_FROZEN0:
                      ^
     |
1975 |             case SMALL_MUT_ARR_PTRS_FROZEN0:
     |                  ^

cbits/Pack.c:1976:18: error:
     error: ‘SMALL_MUT_ARR_PTRS_FROZEN’ undeclared (first use in this function)
                 case SMALL_MUT_ARR_PTRS_FROZEN:
                      ^
     |
1976 |             case SMALL_MUT_ARR_PTRS_FROZEN:
     |                  ^
cbits/Pack.c: In function ‘UnpackArray’:

cbits/Pack.c:2232:17: error:
     error: ‘MUT_ARR_PTRS_FROZEN0’ undeclared (first use in this function)
             type != MUT_ARR_PTRS_FROZEN0 && type != MUT_ARR_PTRS_FROZEN) {
                     ^
     |
2232 |         type != MUT_ARR_PTRS_FROZEN0 && type != MUT_ARR_PTRS_FROZEN) {
     |                 ^

cbits/Pack.c:2232:49: error:
     error: ‘MUT_ARR_PTRS_FROZEN’ undeclared (first use in this function)
             type != MUT_ARR_PTRS_FROZEN0 && type != MUT_ARR_PTRS_FROZEN) {
                                                     ^
     |
2232 |         type != MUT_ARR_PTRS_FROZEN0 && type != MUT_ARR_PTRS_FROZEN) {
     |                                                 ^
`gcc' failed in phase `C Compiler'. (Exit code: 1)
eschnett commented 5 years ago

I believe this is caused by https://phabricator.haskell.org/D4784, which also explains how to correct this: These constants need to be renamed according to the summary there, i.e.

SMALL_MUT_ARR_PTRS_FROZEN0 -> SMALL_MUT_ARR_PTRS_FROZEN_DIRTY
SMALL_MUT_ARR_PTRS_FROZEN -> SMALL_MUT_ARR_PTRS_FROZEN_CLEAN
MUT_ARR_PTRS_FROZEN0 -> MUT_ARR_PTRS_FROZEN_DIRTY
MUT_ARR_PTRS_FROZEN -> MUT_ARR_PTRS_FROZEN_CLEAN

If you tell me how you prefer this, I'll submit a pull request. Would #ifdef be the way to go? Which GHC version should I use -- 860?

eschnett commented 5 years ago

... or should I change the code to use the new names, and use a #define to make things work on older GHC versions?

eschnett commented 5 years ago

Ping?

jberthold commented 5 years ago

I just see these two issues: So sorry for the delay! Apparently I am not getting any notifications at all for issues in this repository for quite a while already.

The compilation error is caused by changes in the GHC internals. Specifically the renaming causes a simple error - there may be more to discover. Code on masterwon't support GHCs newer than 8.2, but there is a branch for ghc 8.6, see commit fb2aac53ba8d27df1fb981ce93e5d3dad0360bde I was quite busy recently and haven't had much time to look into this code. Will try to get an upgrade to a newer GHC done within a month or so but I cannot promise it. I'm happy to answer questions and kead "guided tours" of the code for people who want to contribute or take over.

juhp commented 5 years ago

Sorry for not commenting; also I see it would have been better in retrospect if I had reported the ghc-version in my report.

Yes these constants got renamed in ghc-8.6 - #ifdef would probably work...

jberthold commented 5 years ago

I have merged the earlier branch that should fix this problem.