commercialhaskell / path

Typed filepath
Other
122 stars 45 forks source link

Build failure with GHC 9.0.1 #174

Closed sjakobi closed 2 years ago

sjakobi commented 3 years ago

v0.8.0 fails to build with

src/Path/Internal.hs:120:11: error:
    • Couldn't match type ‘m’ with ‘TH.Q’
      Expected: m TH.Name
        Actual: TH.Q TH.Name
      ‘m’ is a rigid type variable bound by
        the type signature for:
          TH.lift :: forall (m :: * -> *). TH.Quote m => Path a b -> m TH.Exp
        at src/Path/Internal.hs:117:3-6
    • In a stmt of a 'do' block:
        bn <- lookupTypeNameThrow $ tyConName btc
      In the expression:
        do let btc = typeRepTyCon $ typeRep $ mkBaseProxy p
               ttc = typeRepTyCon $ typeRep $ mkTypeProxy p
           bn <- lookupTypeNameThrow $ tyConName btc
           tn <- lookupTypeNameThrow $ tyConName ttc
           [| Path $(return (TH.LitE (TH.StringL str))) ::
                Path $(return $ TH.ConT bn) $(return $ TH.ConT tn) |]
           pending(rn) [<splice, return (TH.LitE (TH.StringL str))>,
                        <splice, return $ TH.ConT tn>, <splice, return $ TH.ConT bn>]
      In an equation for ‘TH.lift’:
          TH.lift p@(Path str)
            = do let btc = ...
                     ....
                 bn <- lookupTypeNameThrow $ tyConName btc
                 tn <- lookupTypeNameThrow $ tyConName ttc
                 ....
            where
                mkBaseProxy :: Path a b -> Proxy a
                mkBaseProxy _ = Proxy
                mkTypeProxy :: Path a b -> Proxy b
                mkTypeProxy _ = Proxy
                ....
    • Relevant bindings include
        lift :: Path a b -> m TH.Exp (bound at src/Path/Internal.hs:117:3)
    |
120 |     bn <- lookupTypeNameThrow $ tyConName btc
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Path/Internal.hs:137:15: error:
    • Couldn't match type: TH.TExp a0
                     with: Path a b
      Expected: Path a b -> TH.Code m (Path a b)
        Actual: Path a b -> TH.Code m (TH.TExp a0)
    • In the expression: TH.unsafeTExpCoerce . TH.lift
      In an equation for ‘TH.liftTyped’:
          TH.liftTyped = TH.unsafeTExpCoerce . TH.lift
      In the instance declaration for ‘TH.Lift (Path a b)’
    • Relevant bindings include
        liftTyped :: Path a b -> TH.Code m (Path a b)
          (bound at src/Path/Internal.hs:137:3)
    |
137 |   liftTyped = TH.unsafeTExpCoerce . TH.lift
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I believe this was already fixed on master. It would be great to get a compatible release! :)

NorfairKing commented 3 years ago

This was supposed to be fixed in https://github.com/commercialhaskell/path/pull/170. Is it not?

sjakobi commented 3 years ago

This was supposed to be fixed in #170. Is it not?

Looks like it is. Could you possibly make a release?

NorfairKing commented 3 years ago

@sjakobi I can't. I think only @chrisdone can. Chris, could you make a release?

sjakobi commented 3 years ago

@NorfairKing you apparently did the release for v0.8.0. In principle I could I could do the release myself (see http://hackage.haskell.org/package/path/maintainers/) but I've been involved so little in this project in the past few years that it would feel like overstepping some kind of boundaries to me.

NorfairKing commented 3 years ago

@sjakobi Oh! I I didn't remember that. I just made https://github.com/commercialhaskell/path/pull/175 to see what CI says about 9.0.1

sjakobi commented 3 years ago

No worries @NorfairKing. Thanks!

sjakobi commented 3 years ago

FYI: As a Hackage trustee, I have created a revision for path-0.8.0 that prevents it from building with template-haskell-2.17.0.0: http://hackage.haskell.org/package/path-0.8.0/revisions/

andrewufrank commented 3 years ago

I have still the following errors - could somebody upload a new version which compiles with 9.0.1? thank you!

Configuring library for path-0.8.0..
Preprocessing library for path-0.8.0..
Building library for path-0.8.0..
[1 of 4] Compiling Path.Internal    ( src/Path/Internal.hs, dist/build/Path/Internal.o, dist/build/Path/Internal.dyn_o )

src/Path/Internal.hs:120:11: error:
    * Couldn't match type `m' with `TH.Q'
      Expected: m TH.Name
        Actual: TH.Q TH.Name
      `m' is a rigid type variable bound by
        the type signature for:
          TH.lift :: forall (m :: * -> *). TH.Quote m => Path a b -> m TH.Exp
        at src/Path/Internal.hs:117:3-6
    * In a stmt of a 'do' block:
        bn <- lookupTypeNameThrow $ tyConName btc
      In the expression:
        do let btc = typeRepTyCon $ typeRep $ mkBaseProxy p
               ttc = typeRepTyCon $ typeRep $ mkTypeProxy p
           bn <- lookupTypeNameThrow $ tyConName btc
           tn <- lookupTypeNameThrow $ tyConName ttc
           [| Path $(return (TH.LitE (TH.StringL str))) ::
                Path $(return $ TH.ConT bn) $(return $ TH.ConT tn) |]
           pending(rn) [<splice, return (TH.LitE (TH.StringL str))>,
                        <splice, return $ TH.ConT tn>, <splice, return $ TH.ConT bn>]
      In an equation for `TH.lift':
          TH.lift p@(Path str)
            = do let btc = ...
                     ....
                 bn <- lookupTypeNameThrow $ tyConName btc
                 tn <- lookupTypeNameThrow $ tyConName ttc
                 ....
            where
                mkBaseProxy :: Path a b -> Proxy a
                mkBaseProxy _ = Proxy
                mkTypeProxy :: Path a b -> Proxy b
                mkTypeProxy _ = Proxy
                ....
    * Relevant bindings include
        lift :: Path a b -> m TH.Exp (bound at src/Path/Internal.hs:117:3)
    |
120 |     bn <- lookupTypeNameThrow $ tyConName btc
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Path/Internal.hs:137:15: error:
    * Couldn't match type: TH.TExp a0
                     with: Path a b
      Expected: Path a b -> TH.Code m (Path a b)
        Actual: Path a b -> TH.Code m (TH.TExp a0)
    * In the expression: TH.unsafeTExpCoerce . TH.lift
      In an equation for `TH.liftTyped':
          TH.liftTyped = TH.unsafeTExpCoerce . TH.lift
      In the instance declaration for `TH.Lift (Path a b)'
    * Relevant bindings include
        liftTyped :: Path a b -> TH.Code m (Path a b)
          (bound at src/Path/Internal.hs:137:3)
    |
137 |   liftTyped = TH.unsafeTExpCoerce . TH.lift
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sjakobi commented 2 years ago

Closing, since path-0.9.1 is compatible with GHC 9.0.1.

Happy holidays, everyone! :)