snapframework / snap

Top-level package for the official Snap Framework libraries, includes the snaplets API as well as infrastructure for sessions, auth, and templates.
http://snapframework.com/
BSD 3-Clause "New" or "Revised" License
455 stars 68 forks source link

Can't install snap 0.7 #21

Closed adinapoli closed 12 years ago

adinapoli commented 12 years ago

Hi, this is what I've got trying to install snap 0.7:

$ cabal install snap Resolving dependencies... cabal: cannot configure attoparsec-text-0.8.5.1. It requires attoparsec >=0.7 && <0.10 For the dependency on attoparsec >=0.7 && <0.10 there are these packages: attoparsec-0.7.1, attoparsec-0.7.2, attoparsec-0.8.0.0, attoparsec-0.8.0.1, attoparsec-0.8.0.2, attoparsec-0.8.1.0, attoparsec-0.8.1.1, attoparsec-0.8.2.0, attoparsec-0.8.3.0, attoparsec-0.8.4.0, attoparsec-0.8.5.0, attoparsec-0.8.5.1, attoparsec-0.8.5.2, attoparsec-0.8.5.3, attoparsec-0.8.6.0, attoparsec-0.8.6.1, attoparsec-0.9.0.0, attoparsec-0.9.1.1 and attoparsec-0.9.1.2. However none of them are available. attoparsec-0.7.1 was excluded because snap-server-0.7 requires attoparsec ==0.10. attoparsec-0.7.1 was excluded because attoparsec-enumerator-0.3 requires attoparsec ==0.10. attoparsec-0.7.1 was excluded because snap-core-0.7 requires attoparsec ==0.10.*

[...]

It's my impression or attoparsec should be installed by cabal along with Snap? (I mean, cabal should resolve the dependecies as well, right?)

In case I'm wrong, feel free to close this issue :)

Have a nice day, Alfredo

hvr commented 12 years ago

Sometimes cabal can't resolve them by itself, as they'd require reinstalling packages while breaking other packages...

Have you tried with a clean ghc-environment (i.e. one where you don't have older versions of libraries such as attoparsec installed) or alternatively by using cabal-dev?

adinapoli commented 12 years ago

No, I haven't. I'll try and keep you posted :)

gregorycollins commented 12 years ago

Also: blow away your ~/.ghc directory.

adinapoli commented 12 years ago

Ok, installing it into a sandboxed environment (e.g. with hsenv) does the dirty job. We can close this issue :) Btw, thanks again for the awesome work with Snap you are doing!

Best regards, Alfredo

kevinjardine commented 12 years ago

I would like to reopen this issue (but github does not allow me to) because I have encountered the same dependency problem and using cabal-dev does not resolve it for me.

At very least I suggest that there be more detailed instructions for building this code. As of a week or so ago I had no trouble building and now I'm stuck because my Snap app needs the latest Heist features.

gregorycollins commented 12 years ago

Have you done "rm -Rf ~/.ghc" ?

hvr commented 12 years ago

@gregorycollins btw, imho cabal should get a cabal reset subcommand which wipes everything that's been compiled in the userdb for the current ghc version... ;-)

kevinjardine commented 12 years ago

@gregorycollins There is no such directory on my Windows 7 system so far as I can see.

adinapoli commented 12 years ago

I've reopened the issue, as requested. Btw, I have fixed the dependency error using henv, not cabal-dev. Cabal dev simply didn't work, for me though.

mightybyte commented 12 years ago

@kevinjardine You need to figure out where Haskell packages are stored on your system when you install them. None of us use Windows, so you'll need to do a bit of digging. This is more of an issue with Cabal/cabal-install than Snap.

One thing that might tell you is to start up ghci and then run the following.

:m System.Directory
getAppUserDataDirectory "ghc"

I think that will tell you where your packages are installed. You need to delete everything in there and reinstall fresh.

The #haskell IRC channel is usually very helpful with things like this.

kevinjardine commented 12 years ago

I believe that the next version of the Haskell Platform is coming out soon so I will probably wait until then and simply uninstall my old version then.

Is this issue likely to be a regular occurrence?

Kevin

----- Original Message ----- From: mightybyte reply@reply.github.com To: Kevin Jardine kevinjardine@yahoo.com Cc: Sent: Thursday, December 8, 2011 4:49 PM Subject: Re: [snap] Can't install snap 0.7 (#21)

@kevinjardine You need to figure out where Haskell packages are stored on your system when you install them.  None of us use Windows, so you'll need to do a bit of digging.  This is more of an issue with Cabal/cabal-install than Snap.

One thing that might tell you is to start up ghci and then run the following.

:m System.Directory
getAppUserDataDirectory "ghc"

I think that will tell you where your packages are installed.  You need to delete everything in there and reinstall fresh.

The Haskell IRC channel is usually very helpful with things like this.


Reply to this email directly or view it on GitHub: https://github.com/snapframework/snap/issues/21#issuecomment-3064011

mightybyte commented 12 years ago

This is a well known issue with Cabal. Hopefully it will be fixed at some point, but it's a very complex problem. To some extent, this is just inevitable growing pains due to Haskell's increasing popularity. If you're going to use Haskell, you really need to figure out where Cabal installs your packages and how to delete them. You also might try deleting your cabal-dev directory and retrying that installation. I assume you've done "cabal update"?

kevinjardine commented 12 years ago

Yes, I ran cabal update first, installed cabal-dev and compiled the latest attoparsec using it. I was able to successfully cabal-dev install the latest xmlhtml code from github but cabal-dev install inside the heist git directory returned the result:

There is no available version of xmlhtml that satisfies >= 0.1.6 && <0.2

This despite the fact that I had just used cabal-dev install to install xmlhtml -0.1.6.0

So it looks like cabal-dev is broken.

I agree that this cabal-dev error appears to have little to do with Snap. It seems rather that cabal-dev is broken.

The original problem remains however - the snap 0.7 package fails to install because of the unmet attoparsec-text requirement.

attoparsec-text requires attoparsec <0.10 but snap requires attoparsec == 0.10.*

I will see if there is a more up-to-date attoparsec-text package somewhere.

mightybyte commented 12 years ago

We don't depend on attoparsec-text any more. The dependency is probably there because of something else that has already been built with that dependency that is not getting reinstalled. This is why you need to do whatever is the Windows equivalent of rm -fr ~/.ghc. I just double-checked on my machine and snap installs with no trouble from a clean slate.

kevinjardine commented 12 years ago

Would the new Snap dependency rules then imply that Snap is not compatible with attoparsec-text or any application that depends on it?

In any case I solved the problem by running

cabal unpack attoparsec-text

and manually bumped the version number and dependency.

Would you like me to contact the attoparsec-text maintainer and request that he do the same?

mightybyte commented 12 years ago

attoparsec-text is deprecated. https://plus.google.com/110179193789986075878/posts/XevNhMhi7mu

gregorycollins commented 12 years ago

Everyone, please: have you nuked your package directory? If the answer is "no", please take the branch in the flowchart leading to "find out where my package directory is and nuke it" before proceeding to "comment further on this issue."

One easy way to find out where your package directory is located is ghc-pkg list. Here's what it looks like on my system:

$ ghc-pkg list | grep '^[^ ]'
WARNING: there are broken packages.  Run 'ghc-pkg check' for more details.
/Library/Frameworks/GHC.framework/Versions/7.0.3-x86_64/usr/lib/ghc-7.0.3/package.conf.d:
/Users/gdc/.ghc/x86_64-darwin-7.0.3/package.conf.d:

Here we have global and local (per-user) package directories. Unless you make the mistake of using "cabal install --global" (which is almost never advised), you want to nuke the user one. On my system that's:

/Users/gdc/.ghc/

Just go ahead and zap that whole directory, the contents inside can (and will) be rebuilt.

BTW: If you've spoilt your platform installation by using cabal install --global (they should add a flag to that command --yes-i-really-mean-it), the situation is usually not recoverable and you need to reinstall the platform.

kevinjardine commented 12 years ago

Other solutions to this issue are discussed here:

https://plus.google.com/u/0/111705054912446689620/posts/V1186HGWEap

aluink commented 12 years ago

I just had this issue in Windows. I found my .ghc dir here.

C:\Documents and Settings\aluink\Application Data\ghc

I blew that away and it worked fine.

kevinjardine commented 12 years ago

The conclusion on the thread that I linked to is that it is not actually necessary to "blow away" anything to install Snap, but if that worked for you, fine.