2013-04-20 156 views
2

我試圖通過cabal安裝安裝hake。無法通過cabal安裝Hake安裝

首先 - 雖然可用的最新的包是1.3.7,陰謀試圖安裝1.2

除了:

~ % cabal install hake-1.2 
Resolving dependencies... 
Configuring hake-1.2... 
Building hake-1.2... 
Preprocessing library hake-1.2... 

Development/Hake.hs:49:8: 
    Could not find module `System.Directory.Tools' 
    Perhaps you meant System.Directory (from directory-1.1.0.2) 
    Use -v to see a list of the files searched for. 
Failed to install hake-1.2 
cabal: Error: some packages failed to install: 
hake-1.2 failed during the building phase. The exception was: 
ExitFailure 1 

如果我嘗試更加具體的 - 我得到其他錯誤

~ % cabal install hake-1.3.7 
Resolving dependencies... 
cabal: Could not resolve dependencies: 
trying: hake-1.3.7 
rejecting: base-3.0.3.2, 3.0.3.1 (global constraint requires installed 
instance) 
rejecting: base-4.5.1.0/installed-81d... (conflict: hake => base<=4.3.1.0) 
rejecting: base-4.6.0.1, 4.6.0.0, 4.5.1.0, 4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0, 
4.3.0.0, 4.2.0.2, 4.2.0.1, 4.2.0.0, 4.1.0.0, 4.0.0.0 (global constraint 
requires installed instance) 

我很難過。

更新

看來筆者已在源的有關更改包裝,至少在GitHub上https://github.com/YoshikuniJujo/hake_haskell,但他們不是在Hackage呢。

回答

5

hake上有base的上限,阻止使用最新版本的ghc安裝最新版本。 (舊版本的hake缺少上限,但實際上需要一個,這就解釋了您得到的第一個錯誤。)

最好的選擇是聯繫作者並要求他將更新後的版本上傳到Hackage。下一個最好的(也是更直接的)選項是自己編輯.cabal文件。

$ cabal unpack hake-1.3.7 
$ cd hake-1.3.7 

然後編輯hake.cabal,找到Build-Depends:線包含base<=4.3.1.0和改變,要簡單地說base代替。然後在該目錄中說

$ cabal install 

。當然,這種修改依賴並不總是有效,但在這種情況下,似乎是這樣。

+0

謝謝你 - 我想我應該把學習小組放在更高的名單上。 – Abizern 2013-04-20 17:08:39

2

看着依賴關係base (≤4.3.1.0)hake-1.3.7需要相當舊版本的base庫。看起來像是想要at most GHC 7.0。 Cabal認爲它不能滿足base的要求,所以拒絕安裝hake

hake-1.2,另一方面,沒有指定base上的要求。由於Cabal並不知道這個要求,所以它錯誤地試圖構建hake,它只是不能編譯。