2014-05-02 26 views
5

Trên OS X 10.9.2, tôi đã cài đặt nền tảng GHC mới. (Có cài đặt trước, nhưng tôi tin rằng tôi đã xóa nó bằng cách xóa /Library/Haskell/Users/username/Library/Haskell.) Nền tảng đi kèm với Cabal 1.16. Tôi muốn Cabal mới nhất với sự hỗ trợ sandbox, vì vậy tôi chạy:cài đặt cabal 1.20.0.0 không cài đặt được trên OS X

cabal update 
cabal install cabal --reinstall 

Đó diễn ra tốt đẹp. Nhưng sau đó tôi đã cố gắng để nâng cấp cabal-install cũng như:

cabal install cabal-install -v 

Nó thất bại với kết quả như sau:

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 

Tôi không đặc biệt quen thuộc với Haskell bao bì. Lỗi dường như nói rằng nó không thể tìm thấy gói HTTP-4000.2.8-cdf033f9d7051824f52cd5101df67509. Tôi không biết về tổng kiểm tra, nhưng rõ ràng từ the docs phiên bản 4000.2.8 đó tồn tại.

Làm cách nào để xóa lỗi này và nhận cabal-install mới nhất?

Edit: Đây là kết quả từ ghc-pkg describe HTTP, theo yêu cầu trong các ý kiến:

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

Đầu ra của 'ghc-pkg mô tả HTTP' là gì - cụ thể là, kiểm tra gói đã cài đặt của bạn khớp với gói được chỉ định bởi cabal (trên dòng" không thỏa mãn ")? – user2407038

+0

Tôi đã chỉnh sửa câu hỏi để bao gồm thông tin đó. Và có, kiểm tra phù hợp. Cả hai đều là cdf033f9d7051824f52cd5101df67509. – rlkw1024

+1

'ghc-pkg' cho biết bạn nên' recache'. Nếu điều này không khắc phục được thì tôi không biết nó có thể là gì nữa. – user2407038

Trả lời

11

Có hai phần vào dung dịch.

Trước tiên, tôi phải làm ghc-pkg recache. Sau đó, tôi đã yêu cầu một cách rõ ràng phiên bản mới nhất của cabal-install bằng cách chạy cabal install cabal-install-1.20.0.0. Tôi không rõ tại sao một trong các bước này là cần thiết để có được phiên bản mới nhất của một cái gì đó cơ bản như cabal-install. Nhưng có giải pháp, ít nhất là bây giờ.

+0

Giải pháp này làm việc cho tôi. – dsg

+0

Tôi thêm một vấn đề tương tự. Cái này cũng có tác dụng với tôi. Vì những lý do lạ lùng, tôi phải làm một 'sudo' – mb14

+0

@ mb14, bạn có biết nơi các tập tin được cài đặt đã đi đâu không? Đối với tôi, họ đã đi vào ~/Library/Haskell, có thể ghi được mà không có sudo. Có phải thư mục đó, hoặc bất kỳ thư mục con nào của nó, không bạn có thể ghi được không? – rlkw1024

Các vấn đề liên quan