2014-05-09 45 views
3

我創建了一個cabal沙箱,我試圖在我的OSX上構建hakyll Haskell包,但在包temporary-1.2.0.2上發生構建錯誤。可能是什麼原因?
小集團版本低於1.20
生成錯誤是:Haskell包構建錯誤

abcdef-MacBook-Pro:hakyll bd$ cabal install temporary 
Resolving dependencies... 
Configuring temporary-1.2.0.2... 
Building temporary-1.2.0.2... 
Preprocessing library temporary-1.2.0.2... 
[1 of 3] Compiling Distribution.Compat.Exception (Distribution/Compat/Exception.hs, dist/dist-sandbox-352cd149/build/Distribution/Compat/Exception.o) 
[2 of 3] Compiling Distribution.Compat.TempFile (Distribution/Compat/TempFile.hs, dist/dist-sandbox-352cd149/build/Distribution/Compat/TempFile.o) 
[3 of 3] Compiling System.IO.Temp (System/IO/Temp.hs, dist/dist-sandbox-352cd149/build/System/IO/Temp.o) 

System/IO/Temp.hs:59:3: 
    Could not deduce (MonadMask m) arising from a use of `bracket' 
    from the context (MonadIO m, MonadCatch m) 
     bound by the type signature for 
       withTempFile :: (MonadIO m, MonadCatch m) => 
           FilePath -> String -> (FilePath -> Handle -> m a) -> m a 
     at System/IO/Temp.hs:(53,17)-(57,19) 
    Possible fix: 
     add (MonadMask m) to the context of 
     the type signature for 
      withTempFile :: (MonadIO m, MonadCatch m) => 
          FilePath -> String -> (FilePath -> Handle -> m a) -> m a 
    In the expression: 
     bracket 
     (liftIO (openTempFile tmpDir template)) 
     (\ (name, handle) 
      -> liftIO (hClose handle >> ignoringIOErrors (removeFile name))) 
     (uncurry action) 
    In an equation for `withTempFile': 
     withTempFile tmpDir template action 
      = bracket 
       (liftIO (openTempFile tmpDir template)) 
       (\ (name, handle) 
       -> liftIO (hClose handle >> ignoringIOErrors (removeFile name))) 
       (uncurry action) 

System/IO/Temp.hs:79:3: 
    Could not deduce (MonadMask m) arising from a use of `bracket' 
    from the context (MonadCatch m, MonadIO m) 
     bound by the type signature for 
       withTempDirectory :: (MonadCatch m, MonadIO m) => 
             FilePath -> String -> (FilePath -> m a) -> m a 
     at System/IO/Temp.hs:(73,22)-(77,24) 
    Possible fix: 
     add (MonadMask m) to the context of 
     the type signature for 
      withTempDirectory :: (MonadCatch m, MonadIO m) => 
           FilePath -> String -> (FilePath -> m a) -> m a 
    In the expression: 
     bracket 
     (liftIO (createTempDirectory targetDir template)) 
     (liftIO . ignoringIOErrors . removeDirectoryRecursive) 
    In an equation for `withTempDirectory': 
     withTempDirectory targetDir template 
      = bracket 
       (liftIO (createTempDirectory targetDir template)) 
       (liftIO . ignoringIOErrors . removeDirectoryRecursive) 
Failed to install temporary-1.2.0.2 
cabal: Error: some packages failed to install: 
temporary-1.2.0.2 failed during the building phase. The exception was: 
ExitFailure 1 

回答

2

這是由於一個錯誤的「臨時」包:https://github.com/batterseapower/temporary/pull/12

由於維護不響應,有沒有一直是對hackage的臨時更新,並且有人創建了一個暫時的分支。

從我可以告訴'臨時'依賴是來自pandoc和pandoc-citeproc。我能夠通過執行以下操作來安裝hakyll,這很不方便,但爲我工作,不需要下載和修改一堆軟件包以使用'temporary-rc'而不是'臨時'。

    經由 cabal get temporary-rc
  1. 編輯臨時rc.cabal和
  2. 下載臨時-RC到一個臨時文件夾改變 「名:」 字段(第一行)從 '臨時-RC' 到 '臨時'
  3. 我使用沙箱,所以如果你是,做cabal sandbox add-source <path/to/temporary-rc>(臨時-RC文件夾中的最後一步temp目錄)
    • 如果你沒有使用沙箱,我想你可以從做cabal install temporary-rc文件夾將其安裝到您的用戶包-db中。我沒有測試過這個。
  4. 正常安裝hakyll,它應該拿起修改過的'臨時'軟件包。

如果你想在家裏跟隨,有一個thread on haskell-libraries討論的情況。

+1

謝謝。實際上,如果臨時包裹所有者沒有響應,那麼Hakyll所有者應該改用臨時rc。 – xyzt

+1

僅供參考,現在已經在'temporary-1.2.0.3'中修復 - https://github.com/batterseapower/temporary/pull/12#issuecomment-42769179 –

+1

已解決...現在使用cabal安裝hakyll是好的。 – xyzt