Cannot build hledger-lib with Setup.hs/parsec 3 #22

Closed
simonmichael opened this Issue Apr 8, 2013 · 5 comments

Projects

None yet

1 participant

@simonmichael
Owner

Original author: Original...@gmail.com (August 11, 2010 02:37:49)

When attempting to build hledger-lib with Setup.hs, I get

~/.cabal/packages/hackage.haskell.org/hledger-lib/0.11.1/hledger-lib-0.11.1 % ./Setup.hs build
Preprocessing library hledger-lib-0.11.1...
Building hledger-lib-0.11.1...
[ 1 of 17] Compiling Hledger.Data.Utils ( Hledger/Data/Utils.hs, dist/build/Hledger/Data/Utils.o )
[ 2 of 17] Compiling Hledger.Data.Types ( Hledger/Data/Types.hs, dist/build/Hledger/Data/Types.o )
[ 3 of 17] Compiling Hledger.Data.Dates ( Hledger/Data/Dates.hs, dist/build/Hledger/Data/Dates.o )

Hledger/Data/Dates.hs:262:22:
Couldn't match expected type ghc-prim:GHC.Prim.Any' against inferred typeChar'
Expected type: GenParser ghc-prim:GHC.Prim.Any u a
Inferred type: GenParser Char st SmartDate
In the expression: yyyymmdd
In the first argument of choice'', namely[yyyymmdd, ymd, ym, md, ....]'

However, it builds fine when I use cabal install; I can't figure out what cabal install is doing differently. (I am new at Haskell and was trying to compile hledger with profiling, as it runs really slowly on my ledger file.)

Original issue: http://code.google.com/p/hledger/issues/detail?id=22

@simonmichael
Owner

From Original...@gmail.com on August 11, 2010 02:39:52
Oh, I should point out that this is a per-user install, though I also do the cabal installs in my user directory. So I ran ./Setup.hs configure --user.

@simonmichael
Owner

From simon@joyful.com on August 11, 2010 15:39:15
Thanks for the report. It works for me with:

~/src/hledger-lib-0.11.1$ ghc-pkg list parsec
/usr/local/lib/ghc-6.12.3/package.conf.d:

/Users/simon/.ghc/i386-darwin-6.12.3/package.conf.d:
parsec-2.1.0.1

~/src/hledger-lib-0.11.1$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.3

I wonder if you have parsec 3 (if so, try ./Setup.hs configure --constraint 'parsec < 3') or if you have stale object files (try ./Setup.hs clean).

@simonmichael
Owner

From Original...@gmail.com on August 11, 2010 16:32:31
That fixed it, thanks! I have parsec 3 in the global ghc package database, and parsec 2 in the user database. I had to run

./Setup.hs configure --constraint 'parsec < 3' --package-db /home/massysett/.ghc/i386-linux-6.12.1/package.conf.d

otherwise Setup.hs would not find the parsec 2 in the user database.

@simonmichael
Owner

From simon@joyful.com on August 11, 2010 16:42:33
Great. We should build with parsec 3 also, I'll keep this issue open.

@simonmichael
Owner

From simon@joyful.com on August 12, 2010 14:43:53
Fixed by adding a type signature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment