Error Compiling Snap.Snaplet.HeistNoClass #166

Closed
ham1 opened this Issue Jan 26, 2013 · 8 comments

Comments

Projects
None yet
4 participants

ham1 commented Jan 26, 2013

Steps to reproduce:

  1. Install Ubuntu server 12.10 64-bit
  2. sudo apt-get install haskell-platform
    (Using GHC v7.4.2)
  3. cabal update
  4. cabal install snap

Gives the following:

[18 of 29] Compiling Snap.Snaplet.HeistNoClass ( src/Snap/Snaplet/HeistNoClass.hs, >dist/build/Snap/Snaplet/HeistNoClass.o )

src/Snap/Snaplet/HeistNoClass.hs:195:32:
Couldn't match expected type n0 (Either e'0 b0)' with actual typeText'
Expected type: String -> n0 (Either e'0 b0)
Actual type: String -> Text
In the first argument of (.)', namelyT.pack'
In the first argument of mapEitherT', namely(T.pack . intercalate "")'
cabal: Error: some packages failed to install:
snap-0.10.0.1 failed during the building phase. The exception was:
ExitFailure 1

I have a similar problem on Arch Linux.

I'm running cabal-dev version 1.16.0 (installed from cloned git repo).
I'm running ghc version 7.6.1 that was installed via with Arch Linux's pacman.

When I run cabal-dev install inside the snap-0.10.0.1 directory (extracted from the snap tarball I downloade d from hackage), I get the following (the second attempt at installing):

$ cabal-dev install
Resolving dependencies...
Configuring snap-0.10.0.1...
Building snap-0.10.0.1...
Preprocessing executable 'snap' for snap-0.10.0.1...
Preprocessing library snap-0.10.0.1...
[18 of 29] Compiling Snap.Snaplet.HeistNoClass ( src/Snap/Snaplet/HeistNoClass.hs, dist/build/Snap/Snaplet/HeistNoClass.o )

src/Snap/Snaplet/HeistNoClass.hs:195:59:
Couldn't match kind *' against* -> '
Kind incompatibility when matching types:
cat0 :: * -> * -> *
EitherT e0 :: (
-> *) -> * -> *
In the second argument of mapEitherT', namelyid'
In the expression: mapEitherT (T.pack . intercalate "") id
Failed to install snap-0.10.0.1
cabal: Error: some packages failed to install:
snap-0.10.0.1 failed during the building phase. The exception was:
ExitFailure 1

Owner

gregorycollins commented Jan 28, 2013

@mightybyte: got the story on this from @Gabriel439 -- the issue is that errors (which we depend on) depends on the "either" package, without setting an upper bound; one of the either API functions (mapEitherT) changed in version 3.1. We should change the lower bound on either to 3.1 and fix the use of mapEitherT.

Owner

mightybyte commented Jan 28, 2013

Ok, I uploaded 0.11 to hackage, which should fix this problem.

On Mon, Jan 28, 2013 at 12:25 AM, Gregory Collins
notifications@github.comwrote:

@mightybyte https://github.com/mightybyte: got the story on this from
@Gabriel439 https://github.com/Gabriel439 -- the issue is that errors
(which we depend on) depends on the "either" package, without setting an
upper bound; one of the either API functions (mapEitherT) changed in
version 3.1. We should change the lower bound on either to 3.1 and fix the
use of mapEitherT.


Reply to this email directly or view it on GitHubhttps://github.com/snapframework/snap-core/issues/166#issuecomment-12769073.

@gregorycollins and @mightybyte, thanks for tracking this down and providing such a fast fix!

I'm still having problems installing snap. Here are my steps (which may be the wrong steps):

git clone git://github.com/snapframework/heist.git
git clone git://github.com/snapframework/snap.git
cabal-dev install heist snap 

Output:

[16 of 29] Compiling Snap.Snaplet.Internal.Initializer ( src/Snap/Snaplet/Internal/Initializer.hs, dist/build/Snap/Snaplet/Internal/Initializer.o )

src/Snap/Snaplet/Internal/Initializer.hs:24:1: Warning:
Module `Prelude' does not export `catch'
[17 of 29] Compiling Snap.Snaplet     ( src/Snap/Snaplet.hs, dist/build/Snap/Snaplet.o )
[18 of 29] Compiling Snap.Snaplet.HeistNoClass ( src/Snap/Snaplet/HeistNoClass.hs, dist/build/Snap/Snaplet/HeistNoClass.o )

src/Snap/Snaplet/HeistNoClass.hs:195:59:
Couldn't match kind `*' against `* -> *'
Kind incompatibility when matching types:
  cat0 :: * -> * -> *
  EitherT e0 :: (* -> *) -> * -> *
In the second argument of `mapEitherT', namely `id'
In the expression: mapEitherT (T.pack . intercalate "") id
Failed to install snap-0.10.0.1
cabal: Error: some packages failed to install:
snap-0.10.0.1 failed during the building phase. The exception was:
ExitFailure 1
Owner

mightybyte commented Jan 29, 2013

Hmmm, something is weird, because the latest code doesn't call mapEitherT.
It calls bimapEitherT. Do a "cabal update" first. If you do "cabal
install snap", you don't need to download code from github. To install
code from github, you just cd to the correct directory, then do "cabal
install". But you don't need to download code from github in the first
place since I uploaded the latest to hackage.

On Tue, Jan 29, 2013 at 1:33 AM, Tim Stewart notifications@github.comwrote:

I'm still having problems installing snap. Here are my steps (which may be
the wrong steps):

git clone git://github.com/snapframework/heist.git
git clone git://github.com/snapframework/snap.git
cabal-dev http://github.com/snapframework/snap.gitcabal-dev install heist snap

Output:

[16 of 29] Compiling Snap.Snaplet.Internal.Initializer ( src/Snap/Snaplet/Internal/Initializer.hs, dist/build/Snap/Snaplet/Internal/Initializer.o )

src/Snap/Snaplet/Internal/Initializer.hs:24:1: Warning:
Module Prelude' does not exportcatch'
[17 of 29] Compiling Snap.Snaplet ( src/Snap/Snaplet.hs, dist/build/Snap/Snaplet.o )
[18 of 29] Compiling Snap.Snaplet.HeistNoClass ( src/Snap/Snaplet/HeistNoClass.hs, dist/build/Snap/Snaplet/HeistNoClass.o )

src/Snap/Snaplet/HeistNoClass.hs:195:59:
Couldn't match kind *' against* -> '
Kind incompatibility when matching types:
cat0 :: * -> * -> *
EitherT e0 :: (
-> *) -> * -> *
In the second argument of mapEitherT', namelyid'
In the expression: mapEitherT (T.pack . intercalate "") id
Failed to install snap-0.10.0.1
cabal: Error: some packages failed to install:
snap-0.10.0.1 failed during the building phase. The exception was:
ExitFailure 1


Reply to this email directly or view it on GitHubhttps://github.com/snapframework/snap-core/issues/166#issuecomment-12822360.

@mightybyte that did it. Thanks for the push in the right direction. I had just assumed I needed to use cabal-dev.

ham1 commented Feb 3, 2013

It works perfectly now, thank you.

Sorry it took me a few days to try this, my SSD died :(

@ham1 ham1 closed this Feb 3, 2013

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