2014-05-02 8 views
5

Su OS X 10.9.2, ho installato la piattaforma GHC fresca. (C'era un'installazione precedente, ma credo di aver cancellato cancellando /Library/Haskell e /Users/username/Library/Haskell.) La Piattaforma è arrivata con la Cabal 1.16. Volevo l'ultima Cabal con supporto sandbox, quindi ho eseguito:cabal-install 1.20.0.0 non riesce ad essere installato su OS X

cabal update 
cabal install cabal --reinstall 

Che è andato bene. Ma poi ho provato ad aggiornare cabal-install così:

cabal install cabal-install -v 

non è riuscito con il seguente risultato:

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 

Io non sono particolarmente familiarità con l'imballaggio Haskell. L'errore sembra dire che non riesce a trovare il pacchetto HTTP-4000.2.8-cdf033f9d7051824f52cd5101df67509. Non so il checksum, ma è chiaro da the docs che esiste la versione 4000.2.8.

Come posso cancellare questo errore e ottenere l'ultimo cabal-install?

Edit: Ecco l'output ghc-pkg describe HTTP, come richiesto nei commenti:

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

Qual è l'output di 'ghc-pkg descripts HTTP? - in particolare, il checksum del pacchetto installato corrisponde a quello specificato da cabal (sulla riga" non può soddisfare ")? – user2407038

+0

Ho modificato la domanda per includere tali informazioni. E sì, il checksum corrisponde. Entrambi sono cdf033f9d7051824f52cd5101df67509. – rlkw1024

+1

'ghc-pkg' dice che dovresti' recache'. Se ciò non risolve il problema, allora non so cos'altro potrebbe essere. – user2407038

risposta

11

Ci sono due parti per la soluzione.

In primo luogo, ho dovuto fare ghc-pkg recache. Quindi, ho dovuto richiedere esplicitamente l'ultima versione di cabal-install eseguendo cabal install cabal-install-1.20.0.0. Non mi è chiaro perché entrambi questi passaggi sarebbero necessari solo per ottenere l'ultima versione di qualcosa di base come cabal-install. Ma c'è la soluzione, almeno per ora.

+0

Questa soluzione ha funzionato per me. – dsg

+0

Aggiungo un problema simile. Questo ha funzionato anche per me. Per strane ragioni ho dovuto fare un 'sudo' – mb14

+0

@ mb14, sai dove sono andati i file installati? Per me, sono andati in ~/Library/Haskell, che dovrebbe essere scrivibile senza sudo. Quella cartella, o una delle sue sottocartelle, non è scrivibile da te? – rlkw1024