snoyberg / mono-traversable

Type classes for mapping, folding, and traversing monomorphic containers
152 stars 61 forks source link

Doesn't build with ghc 8.2.1 #188

Closed phlummox closed 3 years ago

phlummox commented 4 years ago

This seems most likely to be a bug with ghc, but I mention it in case you can assist , and to let you know that mono-traversable may not compile with ghc 8.2.1.

I just had a travis build fail (here) while trying to build mono-traversable 1.0.15.1 with ghc 8.2.1. I've boiled it down to something that's reproducible (on my machine) with just the two attached files; MyModule.hs is stripped down from mon-traversable's src/Data/Containers.hs. Not being especially familiar with either mono-traversable or unordered-containers, I have stopped there -- I don't know how to get a dependency-free minimal example the ghc maintainers might be interested in. If you have any suggestions, I'd love to hear them. Or should I contact the unordered-containers maintainers?

Summary

ghc panic compiling very simple file, stripped down from Data.Containers

Steps to reproduce

Save the following files in a directory (stripping off the .txt extension):

MyModule.hs.txt mono-traversable.cabal.txt

With cabal 1.24 and ghc 8.2.1, do:

$ cabal update
$ cabal install --dependencies-only
$ cabal build

Expected behavior

Should compile, and not produce a panic.

Actual behaviour

Building mono-traversable-1.0.15.1...
Preprocessing library mono-traversable-1.0.15.1...
[1 of 1] Compiling MyModule         ( MyModule.hs, dist/build/MyModule.o )

<no location info>: error:
    ghc: panic! (the 'impossible' happened)
  (GHC version 8.2.1 for x86_64-unknown-linux):
    getUnboxedSumName
  513
  Call stack:
      CallStack (from HasCallStack):
        prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable
        callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable
        pprPanic, called at compiler/prelude/KnownUniques.hs:104:5 in ghc:KnownUniques

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

The code from Data.Container looks perfectly run-of-the-mill to me - no odd extensions, nothing that looks unusual about the class or instance. Have I failed to spot something odd about it? Or does unordered-containers do something especially unusual?

Environment

Any assistance would be appreciated.

snoyberg commented 4 years ago

Does it compile with GHC 8.2.2? Overall, I don't have intentions of working on this, but if you find a non-invasive change that works around a GHC bug I'd probably merge it.

phlummox commented 4 years ago

It does, yes - so my quick fix has just been to not try and build on Travis using 8.2.1. If I find a better fix I'll let you know.

snoyberg commented 4 years ago

I generally consider .1 releases of GHC unstable in any event, so I'm even less likely to consider a hacky fix for this. The CI for this repo didn't catch this because we only test with 8.2.2.