2017-04-11 122 views
0

我正嘗試通過cabal安裝來安裝 robot無法通過cabal安裝來安裝機器人

每當我嘗試通過cabal安裝機器人或克隆git repo後,我會收到以下錯誤消息。

 
Resolving dependencies... 
cabal: Entering directory '/tmp/cabal-tmp-6435/xhb-0.6.2015.8.1' 
Configuring xhb-0.6.2015.8.1... 
Building xhb-0.6.2015.8.1... 
Preprocessing library xhb-0.6.2015.8.1... 
[ 1 of 61] Compiling Graphics.XHB.Shared (Graphics/XHB/Shared.hs, dist/build/Graphics/XHB/Shared.o) 

Graphics/XHB/Shared.hs:271:17: error: 
    Ambiguous occurrence ‘putInt8’ 
    It could refer to either ‘Data.Binary.Put.putInt8’, 
          imported from ‘Data.Binary.Put’ at Graphics/XHB/Shared.hs:9:1-22 
          or ‘Graphics.XHB.Shared.putInt8’, 
          defined at Graphics/XHB/Shared.hs:309:1 

Graphics/XHB/Shared.hs:275:19: error: 
    Ambiguous occurrence ‘getInt8’ 
    It could refer to either ‘Data.Binary.Get.getInt8’, 
          imported from ‘Data.Binary.Get’ at Graphics/XHB/Shared.hs:10:1-22 
          or ‘Graphics.XHB.Shared.getInt8’, 
          defined at Graphics/XHB/Shared.hs:312:1 

Graphics/XHB/Shared.hs:279:17: error: 
    Ambiguous occurrence ‘putInt16host’ 
    It could refer to either ‘Data.Binary.Put.putInt16host’, 
          imported from ‘Data.Binary.Put’ at Graphics/XHB/Shared.hs:9:1-22 
          or ‘Graphics.XHB.Shared.putInt16host’, 
          defined at Graphics/XHB/Shared.hs:315:1 

Graphics/XHB/Shared.hs:283:19: error: 
    Ambiguous occurrence ‘getInt16host’ 
    It could refer to either ‘Data.Binary.Get.getInt16host’, 
          imported from ‘Data.Binary.Get’ at Graphics/XHB/Shared.hs:10:1-22 
          or ‘Graphics.XHB.Shared.getInt16host’, 
          defined at Graphics/XHB/Shared.hs:318:1 

Graphics/XHB/Shared.hs:287:17: error: 
    Ambiguous occurrence ‘putInt32host’ 
    It could refer to either ‘Data.Binary.Put.putInt32host’, 
          imported from ‘Data.Binary.Put’ at Graphics/XHB/Shared.hs:9:1-22 
          or ‘Graphics.XHB.Shared.putInt32host’, 
          defined at Graphics/XHB/Shared.hs:321:1 

Graphics/XHB/Shared.hs:291:19: error: 
    Ambiguous occurrence ‘getInt32host’ 
    It could refer to either ‘Data.Binary.Get.getInt32host’, 
          imported from ‘Data.Binary.Get’ at Graphics/XHB/Shared.hs:10:1-22 
          or ‘Graphics.XHB.Shared.getInt32host’, 
          defined at Graphics/XHB/Shared.hs:324:1 
cabal: Leaving directory '/tmp/cabal-tmp-6435/xhb-0.6.2015.8.1' 
Failed to install xhb-0.6.2015.8.1 
cabal: Error: some packages failed to install: 
xhb-0.6.2015.8.1 failed during the building phase. The exception was: 
ExitFailure 1 


有人可以請指導我如何繼續。

+0

顯然有些兼容性問題。 'xhb'似乎有點不足,實際上我沒有看到它曾經用GHC-8進行過測試。你安裝了什麼版本的'base'和['binary'](http://hackage.haskell.org/package/binary)? – leftaroundabout

+0

我已經安裝了base-4.9.1.0和binary-0.8.5.1 –

回答

1

好的,所以問題在於binary-0.8導出了很多二元-0.7沒有的原語。比較http://hackage.haskell.org/package/binary-0.7.5.0/docs/Data-Binary-Put.html#g:3http://hackage.haskell.org/package/binary-0.8.5.1/docs/Data-Binary-Put.html#g:3

+ putInt8 :: Int8 -> Put 
+ putWord64be :: Word64 -> Put 
+ putInt16be :: Int16 -> Put 
... 

xhb這些函數是分開導入的,當使用binary-0.8時會導致名稱衝突。

解決最安全的方法:fork xhb,使import Data.Binary.{Put|Get}進口qualified,然後從你想每次使用的putInt8等哪個模塊明確澄清..

然後你可以提交當你拉入請求完成。

或者,您可以通過添加約束條件binary < 0.8來完成安裝,但這只是一種解決方法。

cabal install xhb --constraint="binary<0.8" 

xhb安裝後,安裝的robot那麼應無故障運行。