2014-05-02 12 views
5

Unter OS X 10.9.2 habe ich die GHC-Plattform neu installiert. (Es gab eine vorherige Installation, aber ich glaube, ich habe es gelöscht, indem ich /Library/Haskell und /Users/username/Library/Haskell gelöscht habe.) Die Plattform kam mit Cabal 1.16. Ich wollte die neueste Cabal mit Sandbox-Unterstützung, also lief ich:cabal-install 1.20.0.0 kann nicht unter OS X installiert werden

cabal update 
cabal install cabal --reinstall 

Das ging gut. Aber dann habe ich versucht cabal-install auch zu aktualisieren:

cabal install cabal-install -v 

Es ist mit der folgenden Ausgabe fehlgeschlagen:

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 

Ich bin nicht besonders vertraut mit Haskell Verpackung. Der Fehler scheint zu sagen, dass es das Paket HTTP-4000.2.8-cdf033f9d7051824f52cd5101df67509 nicht finden kann. Ich weiß nichts über die Prüfsumme, aber es ist klar von the docs, dass die Version 4000.2.8 existiert.

Wie kann ich diesen Fehler löschen und die neueste cabal-install bekommen?

Edit: Hier ist die Ausgabe von ghc-pkg describe HTTP, wie in den Kommentaren angefordert:

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 @[email protected] 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 (@[email protected], @[email protected]) 
      . 
      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" 
+0

Was ist die Ausgabe von 'ghc-pkg describe HTTP' - genau stimmt die Prüfsumme des installierten Pakets mit der von cabal (in der Zeile" can not satisfy ") angegebenen überein? – user2407038

+0

Ich habe die Frage bearbeitet, um diese Information zu enthalten. Und ja, die Prüfsumme stimmt überein. Beide sind cdf033f9d7051824f52cd5101df67509. – rlkw1024

+1

'ghc-pkg' sagt, du solltest' recache'. Wenn das nicht funktioniert, weiß ich nicht, was es sonst noch sein könnte. – user2407038

Antwort

11

Es gibt zwei Teile zur Lösung.

Zuerst musste ich ghc-pkg recache tun. Dann musste ich explizit die letzte Version von cabal-install anfordern, indem ich cabal install cabal-install-1.20.0.0 ausgeführt. Es ist mir nicht klar, warum einer dieser Schritte notwendig wäre, nur um die neueste Version von etwas so Grundlegendes wie cabal-install zu erhalten. Aber da ist die Lösung, zumindest für den Moment.

+0

Diese Lösung hat für mich funktioniert. – dsg

+0

Ich füge ein ähnliches Problem hinzu. Das hat auch für mich funktioniert. Aus seltsamen Gründen musste ich ein "sudo" machen – mb14

+0

@ mb14, wissen Sie, wo die installierten Dateien gingen? Für mich ging es in ~/Library/Haskell, das ohne Sudo beschreibbar sein sollte. Ist dieser Ordner oder eines seiner Unterordner von Ihnen nicht beschreibbar? – rlkw1024

Verwandte Themen