haskell-suite / haskell-src-exts

Manipulating Haskell source: abstract syntax, lexer, parser, and pretty-printer
Other
193 stars 94 forks source link

Future proofing: Name mismatch in signature and definition. #467

Open locallycompact opened 1 year ago

locallycompact commented 1 year ago

Incoming issue with latest version of happy

error: builder for '/nix/store/fmsnx28jx7qcnbrmhp5ar8b2h3zp182p-haskell-src-exts-1.23.1.drv' failed with exit code 1;
       last 10 log lines:
       > Using runghc version 9.7.20230327 found on system at:
       > /nix/store/5lvkwzy8w6qbw40si81g7pxpcng4z8sn-ghc-9.7.20230327/bin/runghc-9.7.20230327
       > Using strip version 2.40 found on system at:
       > /nix/store/h5003wsy3qqimqvrkn3bc5mwq4hhidag-gcc-wrapper-12.2.0/bin/strip
       > Using tar found on system at:
       > /nix/store/sdcicnwqb4ziv66nhkklsc06vkwb3vxs-gnutar-1.34/bin/tar
       > No uhc found
       > building
       > Preprocessing library for haskell-src-exts-1.23.1..
       > src/Language/Haskell/Exts/InternalParser.ly:2213: Name mismatch in signature and definition
       For full logs, run 'nix log /nix/store/fmsnx28jx7qcnbrmhp5ar8b2h3zp182p-haskell-src-exts-1.23.1.drv'.

https://gitlab.horizon-haskell.net/package-sets/horizon-core/-/jobs/204608

andreasabel commented 1 year ago

Is that here? https://github.com/haskell-suite/haskell-src-exts/blob/84a4930e0e5c051b7d9efd20ef7c822d5fc1c33b/src/Language/Haskell/Exts/InternalParser.ly#L2213

locallycompact commented 1 year ago

Looks like it.

depressed-pho commented 10 months ago

I could make it build but I'm not sure if this is a proper fix:

--- src/Language/Haskell/Exts/InternalParser.ly.orig    2020-06-02 02:35:42.000000000 +0000
+++ src/Language/Haskell/Exts/InternalParser.ly
@@ -2216,13 +2216,13 @@ Miscellaneous (mostly renamings)
         | 'family'     { family_name     (nIS $1) }

 > qtyvarop_(ostar) :: { QName L }
-> qtyvarop_ : '`' tyvar '`'     { UnQual ($1 <^^> $3 <** [$1, srcInfoSpan (ann $2), $3]) $2 }
+>          : '`' tyvar '`'      { UnQual ($1 <^^> $3 <** [$1, srcInfoSpan (ann $2), $3]) $2 }
 >          | tyvarsym_(ostar)   { UnQual (ann $1) $1 }

 > tyvarsym_(ostar) :: { Name L }
-> tyvarsym : VARSYM              { let Loc l (VarSym x) = $1 in Symbol (nIS l) x }
+>          : VARSYM              { let Loc l (VarSym x) = $1 in Symbol (nIS l) x }
 >          | '-'                 { Symbol (nIS $1) "-" }
 >          | ostar                   { Symbol (nIS $1) "*" }

 > impdeclsblock :: { ([ImportDecl L],[S],L) }
 >               : '{'  optsemis impdecls optsemis '}'         { let (ids, ss) = $3 in (ids, $1 : reverse $2 ++ ss ++ reverse $4 ++ [$5], $1 <^^> $5) }