how to find where and why cabal fails - could not resolve dependencies
Asked Answered
C

0

6

I tried to install few modules this morning to get Eclipse FP to work, scion-browser and buildwrapper failed.

[root@localhost ghc-mod]# cabal install scion-browser
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: scion-browser-0.3.0

[root@localhost ghc-mod]# cabal install buildwrapper
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: buildwrapper-0.8.0

I briefly went on #haskell IRC but couldn't get an answer but I didn't hang around long in IRC. Then I gave up on EclipseFP and went on merry path with vim. I've used vim before for other languages and I thought I will be fine even though I might not have a debugger. But curiosity took me to install few plugins that can enhance my coding experience in haskell, however one of the plugins require ghc-mod so I thought I'll give cabal install a go again. I ended up with following error.

[root@localhost ghc-mod]# cabal install ghc-mod
Resolving dependencies...
Configuring ghc-mod-0.3.0...
Building ghc-mod-0.3.0...
Preprocessing executable 'ghc-mod' for ghc-mod-0.3.0...
[1 of 6] Compiling Param            ( Param.hs, dist/build/ghc-mod/ghc-mod-tmp/Param.o )
[2 of 6] Compiling Lang             ( Lang.hs, dist/build/ghc-mod/ghc-mod-tmp/Lang.o )
[3 of 6] Compiling List             ( List.hs, dist/build/ghc-mod/ghc-mod-tmp/List.o )
[4 of 6] Compiling Check            ( Check.hs, dist/build/ghc-mod/ghc-mod-tmp/Check.o )
[5 of 6] Compiling Browse           ( Browse.hs, dist/build/ghc-mod/ghc-mod-tmp/Browse.o )

Browse.hs:41:72:
    Not in scope: data constructor `ExplicitForall'
    Perhaps you meant `ExplicitForAll' (imported from Language.Haskell.Exts.Extension)
Failed to install ghc-mod-0.3.0
cabal: Error: some packages failed to install:
ghc-mod-0.3.0 failed during the building phase. The exception was:
ExitFailure 1

I tried cloning the project then running cabal install and I end up with following result.

[root@localhost ghc-mod]# cabal install
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: ghc-mod-4.1.0

I'd really like to get to the bottom of this issue. I don't know exactly where cabal is failing so it is really hard to find out what dependency it is complaining about exactly. By the way following are the versions of cabal and ghc.

[root@localhost ghc-mod]# cabal --version
cabal-install version 1.16.0.2
using version 1.16.0 of the Cabal library 

[root@localhost ghc-mod]# 
[root@localhost ghc-mod]# ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3

Could anyone help me understand the error message from cabal please? I'm relatively new to haskell so apologies if I've missed a trivial point.

Chambermaid answered 24/4, 2014 at 19:22 Comment(9)
This is an error in the library, ExplicitForAll was mis-spelt as ExplicitForall (lowercase a). The strange thing is that cabal install ghc-mod tries to install 0.3.0 - a version that is god knows how old. Try cabal install ghc-mod-4.0.2.Surly
Also, if you are getting Could not resolve dependencies a lot you are likely lost in the depths of dependency hell. I would just delete everything and install all of these packages from scratch.Surly
I get the same error for cabal install ghc-mod-4.0.2, cannot resolve dependencies. What do you mean by delete everything? I tried removing ~/.cabal directory in one of my laptops few months back and tried installing haskell-platform and everything again, but I always got the package already installed message . Since I use haskell as my hobby language and not for work I left it at that point like a coward and never got to bottom of that issue!Chambermaid
@Chambermaid Sounds like you're definitely lost in cabal hell. Try fully uninstalling GHC and reinstalling, you seem to have some packages installed system-wide which are messing things up. You can also try building ghc-mod in a cabal sandbox, then just copy the binary from the sandbox directory to your ~/.cabal/bin directory.Johnsen
I don't mind deleting things and reinstalling but is there any details of it on line that I could follow. The last time I tried deleting it didn't work. Also if there is an intro to usual development work flow with haskell using cabal hsenv sandbox and other tools, I'd be happy to follow that too.Chambermaid
Note that the package registry is stored in ~/.ghc, not ~/.cabal, so to start from a clean slate you just usually just need to delete the former.Lining
Please provide -v3 output for any of your cabal install invocations. So, for example, the output of cabal install --dry-run -v3 scion-browser.Jorrie
(If I had to speculate, I'd say your local package index is somehow broken or almost empty. Have you tried re-running cabal update?)Jorrie
I've tried cabal update, but I'll try your dry run option when I get a chance and update question with findings. Thanks!Chambermaid

© 2022 - 2024 — McMap. All rights reserved.