2014-05-09 46 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