I am following the Yesod quick start guide and I am getting errors doing cabal install
and yesod devel
regarding the persistent-sqlite
module. I've already installed ghc-7.4.1 and haskell-platform-2012.2.0.0.
$ cabal install:
Loading package persistent-sqlite-0.9.0.2 ... linking ... ghc: /home/roberto/.cabal/lib/persistent-sqlite-0.9.0.2/ghc-7.4.1/HSpersistent-sqlite-0.9.0.2.o: unknown symbol `__warn_memset_zero_len'
ghc: unable to load package `persistent-sqlite-0.9.0.2'
cabal: Error: some packages failed to install: mate-0.0.0 failed during the building phase. The exception was: ExitFailure 1
$ yesod devel:
ghc: /home/roberto/.cabal/lib/persistent-sqlite-0.9.0.2/ghc-7.4.1/HSpersistent-sqlite-0.9.0.2.o: unknown symbol `__warn_memset_zero_len'
ghc: unable to load package `persistent-sqlite-0.9.0.2' Build failure, pausing...
$ ghc-pkg list:
persistent-sqlite-0.9.0.2
yesod-platform-1.0.5
$ cabal install persistent-sqlite --reinstall
In function ‘memset’,
inlined from ‘exprDup’ at cbits/sqlite3.c:68471:0:
/usr/include/bits/string3.h:82:0: warning: call to ‘__warn_memset_zero_len’ declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters
If I comment that line out, __warn_memset_zero_len();
in /usr/include/bits/string3.h:82
, everything goes fine. Is there a proper solution, like telling ghc not to stop on a compilation warning?
I was asking the same question on FreeNode irc on #ghc-dev and was told that this error happens due to some problems in Template Haskell mechanism that uses GHCi to pre-compile things. This happens exactly when trying to pre-compile SQLite libraries.
And I was also informed that this should be fixed with the new version of GHC that is about to be released: v7.8.x (but it will still take some time to get it as part of a new Haskell Platform).
And I am quite surprised that the problem is there for such a long time.