rupesh4514 / grammatical-framework

Automatically exported from code.google.com/p/grammatical-framework
0 stars 0 forks source link

cabal install fails (without haskell platform) #83

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. cabal update
2. cabal install gf

What is the expected output? What do you see instead?

[1 of 1] Compiling Network.Shed.Httpd ( Network/Shed/Httpd.hs, 
dist/build/Network/Shed/Httpd.o )

Network/Shed/Httpd.hs:142:24:
    Ambiguous occurrence `sClose'
    It could refer to either `N.sClose',
                             imported from `Network' at Network/Shed/Httpd.hs:38:1-14
                          or `Network.Socket.sClose',
                             imported from `Network.Socket' at Network/Shed/Httpd.hs:48:1-21
Failed to install httpd-shed-0.4

What version of the product are you using? On what operating system?

Ubuntu with
The Glorious Glasgow Haskell Compilation System, version 7.6.3
cabal-install version 1.16.0.2

Please provide any additional information below.

I know that you recommend the Haskell platform, but I'm trying to concoct a 
formula for GF at Homebrew and it seems that the Haskell platform is frowned on.

Original issue reported on code.google.com by jsalu...@gmail.com on 9 May 2014 at 11:35

Attachments:

GoogleCodeExporter commented 9 years ago
The latest version of httpd-shed on hackage is 0.4.0.1, which fixes this 
problem. If you have run 'cabal update', it should not be trying to use version 
0.4...

Also see Note 1 on http://www.grammaticalframework.org/download/ for extra 
steps required to install haskeline on Ubuntu.

Original comment by hallg...@chalmers.se on 9 May 2014 at 11:57

GoogleCodeExporter commented 9 years ago
Tried cabal install httpd-shed before gf:

Registering httpd-shed-0.4.0.1...
Installed httpd-shed-0.4.0.1

Then, when trying cabal install gf got:

# cabal install gf
Resolving dependencies...
In order, the following would be installed:
extensible-exceptions-0.1.1.4 (new package)
parallel-3.2.0.4 (new package)
random-1.0.1.1 (new package)
syb-0.4.1 (new package)
terminfo-0.4.0.0 (new package)
time-compat-0.1.0.3 (new package)
transformers-0.3.0.0 (new version)
haskeline-0.7.1.2 (new package)
monads-tf-0.1.0.2 (new package)
MonadCatchIO-transformers-0.3.1.0 (new package)
MonadCatchIO-mtl-0.3.1.0 (new package)
mtl-2.1.3.1 (new version)
fst-0.10.0.0 (new package)
parsec-3.1.5 (reinstall) changes: mtl-2.2.0.1 -> 2.1.3.1
json-0.7 (new package)
network-2.5.0.0 (new version)
httpd-shed-0.4 (new version)
utf8-string-0.3.7 -bytestring-in-base (new package)
xhtml-3000.2.1 (new package)
cgi-3001.1.8.5 -bytestring-in-base (new package)
gf-3.5 (new package)
cabal: The following packages are likely to be broken by the reinstalls:
network-2.4.2.3
httpd-shed-0.4.0.1
Use --force-reinstalls if you want to install anyway.

Original comment by jsalu...@gmail.com on 9 May 2014 at 1:54

GoogleCodeExporter commented 9 years ago
But if I use haskell-platform (and no cabal-install) in Ubuntu. It installs ok:

# cabal install gf
Resolving dependencies...
Downloading httpd-shed-0.4.0.1...
Configuring httpd-shed-0.4.0.1...
Building httpd-shed-0.4.0.1...
...
//.cabal/share/gf-3.5/www/grammars/Letter.pgf
Installed gf-3.5

Original comment by jsalu...@gmail.com on 9 May 2014 at 2:08

GoogleCodeExporter commented 9 years ago
With cabal (and no haskell-platform) it works with:

cabal install gf --constraint=httpd-shed==0.4.0.1

Original comment by jsalu...@gmail.com on 9 May 2014 at 2:26

GoogleCodeExporter commented 9 years ago
Also note that GHC has a global package data base available to all user and a 
user-specific package database. You can see both with 'ghc-pkg list'. Also, 
cabal-install uses a local cache of the packages available on hackage, this 
cache needs to be updated manually with 'cabal update' and each user (including 
root) has a separate cache.

So you have to be very careful to consistently run 'cabal install' and 'cabal 
update' as the same user, otherwise you will get inconsistent results. My 
recommendation are:

* Reserve the global package database for things installed from the Ubuntu 
repositories (with apt-get install ...) to avoid conflicts between the package 
versions available in the Ubuntu repositories and the versions available on 
Hackage.

* Do not run 'cabal update' or 'cabal install' as root and do not use the 
--global flag.

Original comment by hallg...@chalmers.se on 9 May 2014 at 2:47

GoogleCodeExporter commented 9 years ago
Just FYI: It fails for a regular user (not root) as well:

test@9fd25d8eaedd:~$ cabal update
test@9fd25d8eaedd:~$ cabal install alex happy
test@9fd25d8eaedd:~$ cabal install gf

Gives:

Building httpd-shed-0.4...
Preprocessing library httpd-shed-0.4...
[1 of 1] Compiling Network.Shed.Httpd ( Network/Shed/Httpd.hs, 
dist/build/Network/Shed/Httpd.o )

Network/Shed/Httpd.hs:142:24:
    Ambiguous occurrence `sClose'
    It could refer to either `N.sClose',
                             imported from `Network' at Network/Shed/Httpd.hs:38:1-14
                          or `Network.Socket.sClose',
                             imported from `Network.Socket' at Network/Shed/Httpd.hs:48:1-21
Failed to install httpd-shed-0.4
cabal: Error: some packages failed to install:
fst-0.10.0.0 depends on terminfo-0.4.0.0 which failed to install.
gf-3.5 depends on httpd-shed-0.4 which failed to install.
haskeline-0.7.1.2 depends on terminfo-0.4.0.0 which failed to install.
httpd-shed-0.4 failed during the building phase. The exception was:
ExitFailure 1
terminfo-0.4.0.0 failed during the configure step. The exception was:
ExitFailure 1

Original comment by jsalu...@gmail.com on 13 May 2014 at 5:07

GoogleCodeExporter commented 9 years ago
OK.

This problem is caused by changes in the network package that caused httpd-shed 
(and probably other packages) to break. httpd-0.4.0.1 was released to work 
around it.

But can avoid this problem if you start by installing the Haskell Platform. Is 
there a reason you don't want to do that?

Original comment by hallg...@chalmers.se on 13 May 2014 at 9:16

GoogleCodeExporter commented 9 years ago
I'm trying to publish a formula for gf in the Homebrew main repository. 
They instructed me to another pull request  
https://github.com/Homebrew/homebrew/pull/27926
As it seems, they prefer to not use haskell-platform because it usually lags 
behind and the current lack of cabal sandboxes in it.

Original comment by jsalu...@gmail.com on 14 May 2014 at 6:22

GoogleCodeExporter commented 9 years ago
Ok, but if you want to install everything directly from Hackage, you run a 
greater risk of running in to Hackage Dependency Hell, so you need to be 
prepared to use some manual intervention (like 
--constraint=httpd-shed==0.4.0.1) to make things work. 

The source of the current problem is that Cabal has to make a difficult choice:

   network-2.4.x + httpd-shed-0.4.0.1

or

   network-2.5 + httpd-shed-0.4

and it apparently picks the latter option, which unfortunately does not work. 
The right solution to this I think is to ask the maintainer of httpd-shed (Andy 
Gill) to release a new version of httpd-shed that works with network-2.5.

If you also want to use GHC 7.8, a new version of the cgi package is needed. 
(There are pull requests for this https://github.com/andersk/haskell-cgi/pulls, 
but the cgi package maintainer has not applied them).

Original comment by hallg...@chalmers.se on 14 May 2014 at 8:46

GoogleCodeExporter commented 9 years ago
Ok. Thanks.
I'd use all this evidence to try to convince them to accept  the 
haskell-platform way.

Original comment by jsalu...@gmail.com on 14 May 2014 at 9:13