Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cabal-install 1.20.0.0 fails to install on OS X

Tags:

haskell

cabal

On OS X 10.9.2, I installed the GHC platform fresh. (There was a prior installation, but I believe I wiped it out by deleting /Library/Haskell and /Users/username/Library/Haskell.) The Platform came with Cabal 1.16. I wanted the latest Cabal with sandbox support, so I ran:

cabal update
cabal install cabal --reinstall

That went fine. But then I tried to upgrade cabal-install as well:

cabal install cabal-install -v

It failed with the following output:

Reading available packages...
Choosing modular solver.
Resolving dependencies...
Ready to install cabal-install-1.20.0.0
Waiting for install task to finish...
Extracting
/Users/username/Library/Haskell/repo-cache/hackage.haskell.org/cabal-install/1.20.0.0/cabal-install-1.20.0.0.tar.gz
to
/var/folders/jt/ywln8_hn75q1yfkhnpcs1bzh0000gn/T/cabal-install-1.20.0.0-51744...
Updating cabal-install.cabal with the latest revision from the index.
Configuring cabal-install-1.20.0.0...
Flags chosen: old-directory=False
Dependency Cabal ==1.20.0.0: using Cabal-1.20.0.0
Dependency HTTP ==4000.2.8: using HTTP-4000.2.8
Dependency array ==0.4.0.1: using array-0.4.0.1
Dependency base ==4.6.0.1: using base-4.6.0.1
Dependency bytestring ==0.10.0.2: using bytestring-0.10.0.2
Dependency containers ==0.5.0.0: using containers-0.5.0.0
Dependency directory ==1.2.0.1: using directory-1.2.0.1
Dependency filepath ==1.3.0.1: using filepath-1.3.0.1
Dependency mtl ==2.1.2: using mtl-2.1.2
Dependency network ==2.4.1.2: using network-2.4.1.2
Dependency pretty ==1.1.1.0: using pretty-1.1.1.0
Dependency process ==1.1.0.2: using process-1.1.0.2
Dependency random ==1.0.1.1: using random-1.0.1.1
Dependency stm ==2.4.2: using stm-2.4.2
Dependency time ==1.4.0.1: using time-1.4.0.1
Dependency unix ==2.6.0.1: using unix-2.6.0.1
Dependency zlib ==0.5.4.1: using zlib-0.5.4.1

/var/folders/jt/ywln8_hn75q1yfkhnpcs1bzh0000gn/T/51744.c:1:12:
     warning: control reaches end of non-void function [-Wreturn-type]
int foo() {}
           ^
1 warning generated.
Using Cabal-1.16.0 compiled by ghc-7.6
Using compiler: ghc-7.6.3
Using install prefix:
/Users/username/Library/Haskell/ghc-7.6.3/lib/cabal-install-1.20.0.0
Binaries installed in:
/Users/username/Library/Haskell/ghc-7.6.3/lib/cabal-install-1.20.0.0/bin
Libraries installed in:
/Users/username/Library/Haskell/ghc-7.6.3/lib/cabal-install-1.20.0.0/lib
Private binaries installed in:
/Users/username/Library/Haskell/ghc-7.6.3/lib/cabal-install-1.20.0.0/libexec
Data files installed in:
/Users/username/Library/Haskell/ghc-7.6.3/lib/cabal-install-1.20.0.0/share
Documentation installed in:
/Users/username/Library/Haskell/ghc-7.6.3/lib/cabal-install-1.20.0.0/doc
Using alex version 3.0.5 found on system at: /usr/bin/alex
Using ar found on system at: /usr/bin/ar
No c2hs found
No cpphs found
No ffihugs found
Using gcc version 4.2.1 found on system at: /usr/bin/gcc
Using ghc version 7.6.3 found on system at: /usr/bin/ghc
Using ghc-pkg version 7.6.3 found on system at: /usr/bin/ghc-pkg
No greencard found
Using haddock version 2.13.2 found on system at: /usr/bin/haddock
Using happy version 1.18.10 found on system at: /usr/bin/happy
No hmake found
Using hpc version 0.6 found on system at: /usr/bin/hpc
Using hsc2hs version 0.67 found on system at: /usr/bin/hsc2hs
No hscolour found
No hugs found
No jhc found
Using ld found on system at: /usr/bin/ld
No lhc found
No lhc-pkg found
No nhc98 found
Using pkg-config version 0.28 found on system at: /usr/local/bin/pkg-config
Using ranlib found on system at: /usr/bin/ranlib
Using strip found on system at: /usr/bin/strip
Using tar found on system at: /usr/bin/tar
No uhc found
creating dist/build
creating dist/build/autogen
Building cabal-install-1.20.0.0...
Preprocessing executable 'cabal' for cabal-install-1.20.0.0...
Building executable cabal...
creating dist/build/cabal
creating dist/build/cabal/cabal-tmp
Building C Sources.
creating dist/build/cabal/cabal-tmp
/usr/bin/ghc -c -odir dist/build/cabal/cabal-tmp -Idist/build/cabal/cabal-tmp -optc-O2 -package-db dist/package.conf.inplace -package-id Cabal-1.20.0.0-ed0a7e0a5adc8ca1f9e6d405d3a3d56c -package-id HTTP-4000.2.8-cdf033f9d7051824f52cd5101df67509 -package-id array-0.4.0.1-3b78425c10ff2dad7acf7e8c8ae014c3 -package-id base-4.6.0.1-6c351d70a24d3e96f315cba68f3acf57 -package-id bytestring-0.10.0.2-bf7aaeef3f644374cd7d5a9066cd9017 -package-id containers-0.5.0.0-ab1dae9a94cd3cc84e7b2805636ebfa2 -package-id directory-1.2.0.1-b2c415ae3fe3357f80678150b6da5a3c -package-id filepath-1.3.0.1-b12cbe18566fe1532a1fda4c85e31cbe -package-id mtl-2.1.2-94c72af955e94b8d7b2f359dadd0cb62 -package-id network-2.4.1.2-28b12b2ed8a678ffb29bc07483d3d363 -package-id pretty-1.1.1.0-66181c695e6a2e173ba2088cf55cc396 -package-id process-1.1.0.2-d20d01635195e5ac2ebee73032c7fe84 -package-id random-1.0.1.1-ecb94a9408452ed74f22425077442903 -package-id stm-2.4.2-b5d718b1a5f1fbcdb61a336aef0c2130 -package-id time-1.4.0.1-10dc4804a19dc0000fab79908f1a9f50 -package-id unix-2.6.0.1-1b262a42f35f597365016088e0cde399 -package-id zlib-0.5.4.1-13ba81ac0d7e6f3bdf1ee5ddce4e9aab cbits/getnumcores.c
<command line>: cannot satisfy -package-id HTTP-4000.2.8-cdf033f9d7051824f52cd5101df67509
    (use -v for more information)
Failed to install cabal-install-1.20.0.0
World file is already up to date.
cabal: Error: some packages failed to install:
cabal-install-1.20.0.0 failed during the building phase. The exception was:
ExitFailure 1

I'm not especially familiar with Haskell packaging. The error seems to be saying it can't find the package HTTP-4000.2.8-cdf033f9d7051824f52cd5101df67509. I don't know about the checksum, but it's clear from the docs that version 4000.2.8 does exist.

How might I clear this error and get the latest cabal-install?

Edit: Here's the output from ghc-pkg describe HTTP, as requested in the comments:

WARNING: cache is out of date: /Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3/package.conf.d/package.cache
  use 'ghc-pkg recache' to fix.
name: HTTP
version: 4000.2.8
id: HTTP-4000.2.8-cdf033f9d7051824f52cd5101df67509
license: BSD3
copyright:
maintainer: Ganesh Sittampalam <[email protected]>
stability:
homepage: https://github.com/haskell/HTTP
package-url:
synopsis: A library for client-side HTTP
description: The HTTP package supports client-side web programming in Haskell. It lets you set up
             HTTP connections, transmitting requests and processing the responses coming back, all
             from within the comforts of Haskell. It's dependent on the network package to operate,
             but other than that, the implementation is all written in Haskell.
             .
             A basic API for issuing single HTTP requests + receiving responses is provided. On top
             of that, a session-level abstraction is also on offer  (the @BrowserAction@ monad);
             it taking care of handling the management of persistent connections, proxies,
             state (cookies) and authentication credentials required to handle multi-step
             interactions with a web server.
             .
             The representation of the bytes flowing across is extensible via the use of a type class,
             letting you pick the representation of requests and responses that best fits your use.
             Some pre-packaged, common instances are provided for you (@ByteString@, @String@.)
             .
             Here's an example use:
             .
             >
             >    do
             >      rsp <- Network.HTTP.simpleHTTP (getRequest "http://www.haskell.org/")
             >              -- fetch document and return it (as a 'String'.)
             >      fmap (take 100) (getResponseBody rsp)
             >
             >    do
             >      (_, rsp)
             >         <- Network.Browser.browse $ do
             >               setAllowRedirects True -- handle HTTP redirects
             >               request $ getRequest "http://www.haskell.org/"
             >      return (take 100 (rspBody rsp))
category: Network
author: Warrick Gray <[email protected]>
exposed: True
exposed-modules: Network.BufferType Network.Stream
                 Network.StreamDebugger Network.StreamSocket Network.TCP
                 Network.HTTP Network.HTTP.Headers Network.HTTP.Base
                 Network.HTTP.Stream Network.HTTP.Auth Network.HTTP.Cookie
                 Network.HTTP.Proxy Network.HTTP.HandleStream Network.Browser
hidden-modules: Network.HTTP.Base64 Network.HTTP.MD5Aux
                Network.HTTP.Utils Paths_HTTP
trusted: False
import-dirs: /Library/Haskell/ghc-7.6.3/lib/HTTP-4000.2.8/lib
library-dirs: /Library/Haskell/ghc-7.6.3/lib/HTTP-4000.2.8/lib
hs-libraries: HSHTTP-4000.2.8
extra-libraries:
extra-ghci-libraries:
include-dirs:
includes:
depends: array-0.4.0.1-3b78425c10ff2dad7acf7e8c8ae014c3
         base-4.6.0.1-6c351d70a24d3e96f315cba68f3acf57
         bytestring-0.10.0.2-bf7aaeef3f644374cd7d5a9066cd9017
         mtl-2.1.2-94c72af955e94b8d7b2f359dadd0cb62
         network-2.4.1.2-28b12b2ed8a678ffb29bc07483d3d363
         old-time-1.1.0.1-4096e5c0be1f1ff8883115216d1bc5d1
         parsec-3.1.3-a8edfa168176dff038c6dcd45a539942
hugs-options:
cc-options:
ld-options:
framework-dirs:
frameworks:
haddock-interfaces: /Library/Haskell/ghc-7.6.3/lib/HTTP-4000.2.8/doc/html/HTTP.haddock
haddock-html: /Library/Haskell/ghc-7.6.3/lib/HTTP-4000.2.8/doc/html
pkgroot: "/Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3"
like image 672
rlkw1024 Avatar asked May 02 '14 16:05

rlkw1024


1 Answers

There are two parts to the solution.

First, I had to do ghc-pkg recache. Then, I had to explicitly request the latest version of cabal-install by running cabal install cabal-install-1.20.0.0. It's not clear to me why either of these steps would be necessary just to get the latest version of something as basic as cabal-install. But there's the solution, at least for now.

like image 96
rlkw1024 Avatar answered Oct 03 '22 07:10

rlkw1024