bscarlet / llvm-general

Rich LLVM bindings for Haskell (with transfer of LLVM IR to and from C++, detailed compilation pass control, etc.)
http://hackage.haskell.org/package/llvm-general
132 stars 38 forks source link

Couldn't compile with GCC 7.4 #64

Closed david-christiansen closed 11 years ago

david-christiansen commented 11 years ago

I was trying to compile version 3.3.5.0 with GHC 7.4.2. I got a GHC message that the impossible had happened. Luckily, I'm at a summer school where SPJ is teaching, and he gave me some GHC flags to get a better error message. It seems to be an empty comprehension coming out of some template haskell.

Upgrading to GHC 7.6.3 fixed the issue for me.

Error:

src/LLVM/General/Internal/Diagnostic.hs:18:1:
    Empty stmt list in do-block
    When splicing a TH declaration:
      InstanceD [ClassP GHC.Base.Monad [TupleT 1105529114]] (VarT ) [FunD LLVM.General.Internal.Coding.encodeM [Clause [VarP h_1627693441] (NormalB (InfixE (Just (VarE GHC.Base.return)) (VarE GHC.Base.$) (Just (CompE [])))) []]]
cabal: Error: some packages failed to install:
idris-0.9.9 depends on llvm-general-3.3.5.0 which failed to install.
llvm-general-3.3.5.0 failed during the building phase. The exception was:
ExitFailure 1
bscarlet commented 11 years ago

That empty comprehension is coming from a call to dataToExpQ - ghc itself seems to be responsible for generating the bogus template haskell.

3.3.5.0 built cleanly for me on 7.4.1, as well as the 7.6.3 which I usually use.

Could you share the magic flags you got fro SPJ?

david-christiansen commented 11 years ago

Thanks for the reply. I'm very new to TH :-)

I got the better error by putting --ghc-options=-dppr-debug at the end of the Cabal command line.

bscarlet commented 11 years ago

llvm-general-3.3.5.0 builds cleanly for me with ghc-7.4.2 on 64-bit OS X.

david-christiansen commented 11 years ago

Strange. This was on 64-bit Linux. In any case, my problem is gone. Perhaps it was some particularity of my Cabal setup.