Problem compiling with ghc-7.4.1 #103

Closed
AndreasVoellmy opened this Issue Nov 21, 2012 · 14 comments

5 participants

@AndreasVoellmy

I wasn't able to run cabal install yesod-platform, because of a failure on persistent. The failure:

$ cabal install persistent-1.0.1.3
Resolving dependencies...
Configuring persistent-1.0.1.3...
Building persistent-1.0.1.3...
Preprocessing library persistent-1.0.1.3...
[ 1 of 15] Compiling Database.Persist.Util ( Database/Persist/Util.hs, dist/build/Database/Persist/Util.o )
[ 2 of 15] Compiling Database.Persist.TH.Library ( Database/Persist/TH/Library.hs, dist/build/Database/Persist/TH/Library.o )
[ 3 of 15] Compiling Database.Persist.EntityDef ( Database/Persist/EntityDef.hs, dist/build/Database/Persist/EntityDef.o )
[ 4 of 15] Compiling Database.Persist.Quasi ( Database/Persist/Quasi.hs, dist/build/Database/Persist/Quasi.o )
[ 5 of 15] Compiling Database.Persist.Store ( Database/Persist/Store.hs, dist/build/Database/Persist/Store.o )
[ 6 of 15] Compiling Database.Persist.GenericSql.Internal ( Database/Persist/GenericSql/Internal.hs, dist/build/Database/Persist/GenericSql/Internal.o )
[ 7 of 15] Compiling Database.Persist.GenericSql.Raw ( Database/Persist/GenericSql/Raw.hs, dist/build/Database/Persist/GenericSql/Raw.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.4.0.0 ... linking ... done.
Loading package deepseq-1.3.0.0 ... linking ... done.
Loading package bytestring-0.10.0.1 ... linking ... done.
Loading package text-0.11.2.3 ... linking ... done.
Loading package hashable-1.1.2.5 ... linking ... done.
Loading package base-unicode-symbols-0.2.2.4 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package transformers-base-0.4.1 ... linking ... done.
Loading package monad-control-0.3.1.4 ... linking ... done.
Loading package stm-2.4 ... linking ... done.
Loading package old-locale-1.0.0.4 ... linking ... done.
Loading package time-1.4 ... linking ... done.
Loading package primitive-0.5.0.1 ... linking ... done.
Loading package vector-0.10.0.1 ... linking ... done.
Loading package resource-pool-0.2.1.1 ... linking ... done.
Loading package containers-0.5.1.0 ... linking ... done.
Loading package lifted-base-0.2 ... linking ... done.
Loading package mtl-2.1.2 ... linking ... done.
Loading package resourcet-0.4.0.2 ... linking ... done.
Loading package pool-conduit-0.1.0.3 ... linking ... done.
Loading package path-pieces-0.1.2 ... linking ... done.
Loading package blaze-builder-0.3.1.0 ... linking ... done.
Loading package date-cache-0.3.0 ... linking ... done.
Loading package filepath-1.3.0.0 ... linking ... done.
Loading package unix-2.6.0.0 ... linking ... done.
Loading package directory-1.2.0.1 ... linking ... done.
Loading package old-time-1.1.0.0 ... linking ... done.
Loading package unix-time-0.1.2 ... linking ... done.
Loading package fast-logger-0.3.1 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package monad-logger-0.2.1 ... linking ... done.
Loading package semigroups-0.8.4.1 ... linking ... done.
Loading package void-0.5.8 ... linking ... done.
Loading package conduit-0.5.2.7 ... linking ... done.
Loading package blaze-markup-0.5.1.1 ... linking ... done.
Loading package blaze-html-0.5.1.0 ... linking ... done.
Loading package base64-bytestring-1.0.0.0 ... linking ... done.
Loading package attoparsec-0.10.2.0 ... linking ... done.
Loading package dlist-0.5 ... linking ... done.
Loading package syb-0.3.7 ... linking ... done.
Loading package unordered-containers-0.2.2.1 ... linking ... done.
Loading package aeson-0.6.0.2 ... linking ... done.

Database/Persist/GenericSql/Raw.hs:92:5:
Couldn't match expected type (Int, Int)'
with actual type
(# t0, t1 #)'
In the fourth argument of Language.Haskell.TH.Syntax.Loc', namely
(# 92, 5 #)'
In the first argument of monadLoggerLogSource', namely
Language.Haskell.TH.Syntax.Loc
"./Database/Persist/GenericSql/Raw.hs"
"persistent-1.0.1.3"
"Database.Persist.GenericSql.Raw"
(# 92, 5 #)
(# 92, 12 #)'
In the expression:
monadLoggerLogSource
(Language.Haskell.TH.Syntax.Loc
"./Database/Persist/GenericSql/Raw.hs"
"persistent-1.0.1.3"
"Database.Persist.GenericSql.Raw"
(# 92, 5 #)
(# 92, 12 #))
a_aVlx
Control.Monad.Logger.LevelDebug
(b_aVly {})
cabal: Error: some packages failed to install:
persistent-1.0.1.3 failed during the building phase. The exception was:
ExitFailure 1

Some details about my configuration:
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.1

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.1 LTS"

$ uname -a
Linux 3.4.0 #1 SMP Mon Jun 25 15:39:02 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux

@snoyberg
Yesod Web Framework member

I can't reproduce this issue on my machine, also using Ubuntu and GHC 7.4.1. Can you try wiping out your ~/.ghc folder and trying again?

@btv

I can second that this problem happens to me.

$ uname -a
Linux 3.6.10-2.fc17.x86_64 #1 SMP Tue Dec 11 18:07:34 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

fedora 17 machine with fedora 18's ghc installed (7.4.1)

I tried your request of removing .ghc and when I built yesod it failed on persisted. When I tried to build persistent specifically I got this error:

Database/Persist/GenericSql/Raw.hs:129:5:
Couldn't match expected type (Int, Int)'
with actual type
(# t0, t1 #)'
In the fourth argument of Language.Haskell.TH.Syntax.Loc', namely
(# 129, 5 #)'
In the first argument of monadLoggerLogSource', namely
Language.Haskell.TH.Syntax.Loc
"./Database/Persist/GenericSql/Raw.hs"
"persistent-1.1.0.1"
"Database.Persist.GenericSql.Raw"
(# 129, 5 #)
(# 129, 12 #)'
In the expression:
monadLoggerLogSource
(Language.Haskell.TH.Syntax.Loc
"./Database/Persist/GenericSql/Raw.hs"
"persistent-1.1.0.1"
"Database.Persist.GenericSql.Raw"
(# 129, 5 #)
(# 129, 12 #))
a_a13d9
Control.Monad.Logger.LevelDebug
(b_a13da {})
Failed to install persistent-1.1.0.1

@snoyberg
Yesod Web Framework member

@btv Can you install GHC from http://www.haskell.org/ghc/download_ghc_7_4_1#binaries instead and see if it reproduces the same problem?

@btv

@snoyberg, thanks for the response. I wasn't able to install ghc from the binaries, but I was able to get a different environment from justhub. Was able to install persistent without issue. So this is closed on my end.

Happy Holidays!

@snoyberg
Yesod Web Framework member

@btv I've sent an email about this to a Fedora package maintainer, I'll see if I can get to the bottom of this. Thanks for doing the testing!

@snoyberg
Yesod Web Framework member

Jens Petersen pointed out that the problem originally was reported on Ubuntu, so it's certainly not a Fedora specific issue.

@snoyberg snoyberg added a commit to kazu-yamamoto/logger that referenced this issue Dec 27, 2012
@snoyberg snoyberg Attempted workaround for yesodweb/persistent#103 f0ae291
@juhp

I didn't try to reproduce with monad-logger-0.2.3.1, but "cabal install persistent" worked for me just now with Fedora 18 (ghc-7.4.1). :)

(I think GHC's binary releases are linked against older gmp so they won't work out of the box on recent Linux distros (though a dummy libgmp.so.3 symlink can workaround that).)

@snoyberg
Yesod Web Framework member

Thanks for looking into this @juhp. I looked into it a bit yesterday, and believe that it's likely a GHC bug, as the error is that the code generated by the qLocation TH function is invalid. The point of the workaround in monad-logger-0.2.3.2 is to try and work around that bug... if it in fact exists.

@gregwebs
Yesod Web Framework member

should this issue be resolved?

@juhp

Yes I think it can be closed.

@gregwebs gregwebs closed this Apr 23, 2013
@gregwebs gregwebs reopened this Jun 29, 2013
@gregwebs
Yesod Web Framework member

I am seeing this with the latest version of persistent which has monad-logger > 0.3

@gregwebs
Yesod Web Framework member

haskell-platform install on Ubuntu server 12.10

ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.2

@gregwebs
Yesod Web Framework member

I tried using template-haskell < 2.8 and then < 2.7, but that did not help

@gregwebs
Yesod Web Framework member

I think I will solve this by installing ghc 7.6

@gregwebs gregwebs closed this Jun 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment