jonascarpay / apecs

a fast, extensible, type driven Haskell ECS framework for games
391 stars 43 forks source link

Apecs doesn't build with template-haskell-2.15.0.0 #57

Closed spacekitteh closed 4 years ago

spacekitteh commented 4 years ago

apecs  > [ 5 of 12] Compiling Apecs.THTuples
apecs  >
apecs  > /tmp/stack7315/apecs-0.8.2/src/Apecs/THTuples.hs:58:11: error:
apecs  >     • Couldn't match expected type ‘(Type -> TySynEqn) -> Dec’
apecs  >                   with actual type ‘Dec’
apecs  >     • The first argument of ($) takes one argument,
apecs  >       but its type ‘Dec’ has none
apecs  >       In the expression:
apecs  >         TySynInstD strgN
apecs  >           $ TySynEqn [varTuple] (tupleUpT . fmap strgT $ vars)
apecs  >       In the fourth argument of ‘InstanceD’, namely
apecs  >         ‘[TySynInstD strgN
apecs  >             $ TySynEqn [varTuple] (tupleUpT . fmap strgT $ vars)]’
apecs  >    |
apecs  > 58 |         [ TySynInstD strgN $
apecs  >    |           ^^^^^^^^^^^^^^^^^^...
apecs  >
apecs  > /tmp/stack7315/apecs-0.8.2/src/Apecs/THTuples.hs:58:22: error:
apecs  >     • Couldn't match expected type ‘TySynEqn’ with actual type ‘Name’
apecs  >     • In the first argument of ‘TySynInstD’, namely ‘strgN’
apecs  >       In the expression: TySynInstD strgN
apecs  >       In the expression:
apecs  >         TySynInstD strgN
apecs  >           $ TySynEqn [varTuple] (tupleUpT . fmap strgT $ vars)
apecs  >    |
apecs  > 58 |         [ TySynInstD strgN $
apecs  >    |                      ^^^^^
apecs  >
apecs  > /tmp/stack7315/apecs-0.8.2/src/Apecs/THTuples.hs:59:20: error:
apecs  >     • Couldn't match expected type ‘Maybe [TyVarBndr]’
apecs  >                   with actual type ‘[Type]’
apecs  >     • In the first argument of ‘TySynEqn’, namely ‘[varTuple]’
apecs  >       In the second argument of ‘($)’, namely
apecs  >         ‘TySynEqn [varTuple] (tupleUpT . fmap strgT $ vars)’
apecs  >       In the expression:
apecs  >         TySynInstD strgN
apecs  >           $ TySynEqn [varTuple] (tupleUpT . fmap strgT $ vars)
apecs  >    |
apecs  > 59 |           TySynEqn [varTuple] (tupleUpT . fmap strgT $ vars)
apecs  >    |                    ^^^^^^^^^^
apecs  >
apecs  > /tmp/stack7315/apecs-0.8.2/src/Apecs/THTuples.hs:82:15: error:
apecs  >     • Couldn't match expected type ‘(Type -> TySynEqn) -> t’
apecs  >                   with actual type ‘Dec’
apecs  >     • The first argument of ($) takes one argument,
apecs  >       but its type ‘Dec’ has none
apecs  >       In the expression:
apecs  >         TySynInstD elemN $ TySynEqn [varTuple] (tupleUpT $ fmap elemT vars)
apecs  >       In an equation for ‘elemI’:
apecs  >           elemI
apecs  >             = TySynInstD elemN
apecs  >                 $ TySynEqn [varTuple] (tupleUpT $ fmap elemT vars)
apecs  >     • Relevant bindings include
apecs  >         elemI :: t (bound at src/Apecs/THTuples.hs:82:7)
apecs  >    |
apecs  > 82 |       elemI = TySynInstD elemN $ TySynEqn [varTuple] (tupleUpT $ fmap elemT vars)
apecs  >    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
apecs  >
apecs  > /tmp/stack7315/apecs-0.8.2/src/Apecs/THTuples.hs:82:26: error:
apecs  >     • Couldn't match expected type ‘TySynEqn’ with actual type ‘Name’
apecs  >     • In the first argument of ‘TySynInstD’, namely ‘elemN’
apecs  >       In the expression: TySynInstD elemN
apecs  >       In the expression:
apecs  >         TySynInstD elemN $ TySynEqn [varTuple] (tupleUpT $ fmap elemT vars)
apecs  >    |
apecs  > 82 |       elemI = TySynInstD elemN $ TySynEqn [varTuple] (tupleUpT $ fmap elemT vars)
apecs  >    |                          ^^^^^
apecs  >
apecs  > /tmp/stack7315/apecs-0.8.2/src/Apecs/THTuples.hs:82:43: error:
apecs  >     • Couldn't match expected type ‘Maybe [TyVarBndr]’
apecs  >                   with actual type ‘[Type]’
apecs  >     • In the first argument of ‘TySynEqn’, namely ‘[varTuple]’
apecs  >       In the second argument of ‘($)’, namely
apecs  >         ‘TySynEqn [varTuple] (tupleUpT $ fmap elemT vars)’
apecs  >       In the expression:
apecs  >         TySynInstD elemN $ TySynEqn [varTuple] (tupleUpT $ fmap elemT vars)
apecs  >    |
apecs  > 82 |       elemI = TySynInstD elemN $ TySynEqn [varTuple] (tupleUpT $ fmap elemT vars)
apecs  >    |                                           ^^^^^^^^^^
apecs  >

--  While building package apecs-0.8.2 using:
      /home/spacekitteh/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_3.0.0.0_ghc-8.8.1 --builddir=.stack-work/dist/x86_64-linux/Cabal-3.0.0.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1```
jonascarpay commented 4 years ago

Can you provide some more information on your environment? CI doesn't report any issues with GHC 8.8.1.

spacekitteh commented 4 years ago

Perhaps it's a Stack issue. I've tried with Stack nightlies 2020-01-21 and 2020-01-25, and both fail when it comes to compiling the TemplateHaskell bits.

jonascarpay commented 4 years ago

On CI, they fail because gloss is not (yet, hopefully) in those resolvers. Did you edit stack.yaml, and if so, can you post it here so?

spacekitteh commented 4 years ago
resolver: nightly-2020-01-21

packages:
  - .

extra-deps:
  - cairo-canvas-0.1.0.0@sha256:c9d3e5e9aabc1b261c9ce97e9ea53b8a8d9b743ca0e9b0502521569ed98fa40a,1721
  - cairo-0.13.8.0@sha256:9b64a376ebaa4f153bba5866a32291fd4bed48147009cce9158ce6533928eba8,4075
  - gtk2hs-buildtools-0.13.8.0@sha256:132f38155fc677430a47ea750918973161c876fb6f281d342ac2f07eb99229ce,5238
  - apecs-0.8.2@sha256:68447d0f7cb164f2cf719ae056e693426d6cb63ddaa919d039ad738f6235dda6,2056
spacekitteh commented 4 years ago

However, the error isn't compiling apecs-gloss, it's in the Apecs.THTuples module.

jonascarpay commented 4 years ago

Thanks for reporting, it should be fixed now.