Control: reassign -1 ghc 8.0.1-8 Control: tags -1 + pending On Mon, Oct 31, 2016 at 10:45AM, Chris Lamb wrote: > Dear Maintainer, > > haskell-debian fails to build from source in unstable/amd64: > > [...] > > [34 of 37] Compiling Debian.GenBuildDeps ( Debian/GenBuildDeps.hs, > dist-ghc/build/Debian/GenBuildDeps.o ) > ghc: panic! (the 'impossible' happened) > (GHC version 8.0.1 for x86_64-unknown-linux): > find_tycon > Loc > [] > > Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
This should be fixed by the following patch (available on our repo): | Subject: Avoid find_tycon panic if datacon is not in scope | | When using TH to splice expressions involving record field construction, | the parent datacon may not be in scope. We shouldn't panic about this, | because we will be renaming Exact RdrNames which don't require any | disambiguation. | | Reviewers: austin, bgamari | Reviewed By: bgamari | Differential Revision: https://phabricator.haskell.org/D2321 | GHC Trac Issues: #12130 | | Origin: upstream, https://git.haskell.org/ghc.git/commitdiff/694e0f3a08030 | | Index: b/compiler/rename/RnPat.hs | =================================================================== | --- a/compiler/rename/RnPat.hs | +++ b/compiler/rename/RnPat.hs | @@ -636,7 +636,7 @@ rnHsRecFields ctxt mk_arg (HsRecFields { | find_tycon :: GlobalRdrEnv -> Name {- DataCon -} -> Maybe Name {- TyCon -} | -- Return the parent *type constructor* of the data constructor | -- (that is, the parent of the data constructor), | - -- or 'Nothing' if it is a pattern synonym. | + -- or 'Nothing' if it is a pattern synonym or not in scope. | -- That's the parent to use for looking up record fields. | find_tycon env con | | Just (AConLike (RealDataCon dc)) <- wiredInNameTyThing_maybe con | @@ -648,8 +648,9 @@ rnHsRecFields ctxt mk_arg (HsRecFields { | ParentIs p -> Just p | _ -> Nothing | | - | otherwise | - = pprPanic "find_tycon" (ppr con $$ ppr (lookupGRE_Name env con)) | + | otherwise = Nothing | + -- This can happen if the datacon is not in scope | + -- and we are in a TH splice (Trac #12130) | | dup_flds :: [[RdrName]] | -- Each list represents a RdrName that occurred more than once I hold off on the upload in order to see if GHC will finish compiling on mips64el. Best, -- Ilias