haskell / haddock

Haskell Documentation Tool
www.haskell.org/haddock/
BSD 2-Clause "Simplified" License
361 stars 241 forks source link

Can't compile haddock-api-2.22.0 off Hackage (stack) #1246

Open DunetsNM opened 3 years ago

DunetsNM commented 3 years ago

Steps:

Error:

haddock-api    > src\Haddock\Backends\LaTeX.hs:246:32: error:
haddock-api    >     parse error on input `-- ^ to print before each name in an export list'
haddock-api    >     |
haddock-api    > 246 |           -> ( LaTeX           -- ^ to print before each name in an export list
haddock-api    >     |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DunetsNM commented 3 years ago

Also tried haddock-api-2.22.0@rev:1 and got the same error. The workaround is to replace haddock-api-2.22.0 in stack.yaml with latest commit on the ghc-8.6 branch (haddock-library still comes off hackage):

- github: haskell/haddock
  commit: 1f704e30d5f40fa5113045b252c0e48aebd842be
  subdirs:
    - haddock-api

However I need it off Hackage to complete a contribution to ghcide (there's a requirement that all external dependencies should come from Hackage)

I can do a PR to ghc-8.6 with a new version (2.22.0.1) , is that enough to release it to Hackage?

DunetsNM commented 3 years ago

Similar situation (but different compilation error) is for valid combination of haddock-library-1.9.0 and haddock-api-2.24.0 - which is also cured by using latest commit of its respective branch ghc-8.10

Can do a PR for that too (2.24.0.1) if that's enough to have it on Hackage soon

tonyday567 commented 3 years ago

Searching for a valid combination for ghc-8.10.2, using:

- haddock-library-1.9.0
# ghc-8.10 branch
- github: haskell/haddock
    commit: 3cfd582503f4962843e81a2053346ad66b0b1c14
    subdirs:
      - haddock-api

I ran into:

haddock-api    > [10 of 40] Compiling Haddock.Interface.LexParseRn
haddock-api    > [11 of 40] Compiling Haddock.Interface.Json
haddock-api    > [12 of 40] Compiling Haddock.GhcUtils
haddock-api    >         
haddock-api    > /private/var/folders/mg/c1z3ybzn4_50dm77fhtt_t840000gn/T/stack-6a233b3b737762c5/haddock-api-2.24.0/src/Haddock/GhcUtils.hs:62:42: error:
haddock-api    >     • Could not deduce: p ~ GhcPass p0
haddock-api    >       from the context: (SrcSpanLess (LPat p) ~ Pat p,
haddock-api    >                          HasSrcSpan (LPat p))
haddock-api    >         bound by the type signature for:
haddock-api    >                    getMainDeclBinder :: forall p.
haddock-api    >                                         (SrcSpanLess (LPat p) ~ Pat p, HasSrcSpan (LPat p)) =>
haddock-api    >                                         HsDecl p -> [IdP p]
haddock-api    >         at src/Haddock/GhcUtils.hs:(60,1)-(61,40)
haddock-api    >       ‘p’ is a rigid type variable bound by
haddock-api    >         the type signature for:
haddock-api    >           getMainDeclBinder :: forall p.
haddock-api    >                                (SrcSpanLess (LPat p) ~ Pat p, HasSrcSpan (LPat p)) =>
haddock-api    >                                HsDecl p -> [IdP p]
haddock-api    >         at src/Haddock/GhcUtils.hs:(60,1)-(61,40)
haddock-api    >       Expected type: TyClDecl (GhcPass p0)
haddock-api    >         Actual type: TyClDecl p
haddock-api    >     • In the first argument of ‘tcdName’, namely ‘d’
haddock-api    >       In the expression: tcdName d
haddock-api    >       In the expression: [tcdName d]
haddock-api    >     • Relevant bindings include
haddock-api    >         d :: TyClDecl p (bound at src/Haddock/GhcUtils.hs:62:28)
haddock-api    >         getMainDeclBinder :: HsDecl p -> [IdP p]
haddock-api    >           (bound at src/Haddock/GhcUtils.hs:62:1)
haddock-api    >    |    
haddock-api    > 62 | getMainDeclBinder (TyClD _ d) = [tcdName d]
haddock-api    >    |                                          ^
haddock-api    >
tonyday567 commented 3 years ago

Error as per #1229