Windows上的Cabal安装问题

时间:2014-07-01 03:10:32

标签: haskell cabal

我在使用cabal在Windows上安装软件包时遇到了一些问题。以下命令:

cabal install ghc-mod

产生这些错误

C:\temp> cabal install ghc-mod
Resolving dependencies...
Failed to install haskell-src-exts-1.15.0.1
cabal.exe: Error: some packages failed to install:
ghc-mod-4.1.3 depends on haskell-src-exts-1.15.0.1 which failed to install.
haskell-src-exts-1.15.0.1 failed while unpacking the package. The exception was:
C:\Users\...\AppData\Local\Temp\haskell-src-exts-1.15.0.1-55548\haskell-src-    exts-1.15.0.1\dist-tmp:
MoveFileEx
"C:\\Users\\...\\AppData\\Local\\Temp\\haskell-src-exts-1.15.0.1-55548\\haskell-src-exts-1.15.0.1\\dist-tmp"
"C:\\Users\\...\\AppData\\Local\\Temp\\haskell-src-exts-1.15.0.1-55548\\haskell-src-exts-1.15.0.1\\dist":
permission denied (Acesso negado.)
hlint-1.9 depends on haskell-src-exts-1.15.0.1 which failed to install.

我也尝试过:

cabal install haskell-src-exts

但是我得到了同样的错误。

有人可以帮助我吗?

更新

执行cabal install haskell-src-exts输出错误:

c:\> cabal install haskell-src-exts

Resolving dependencies...
Failed to install haskell-src-exts-1.15.0.1
cabal: Error: some packages failed to install:
haskell-src-exts-1.15.0.1 failed while unpacking the package. The exception was:
C:\Users\DIULLE~1\AppData\Local\Temp\haskell-src-exts-1.15.0.1-35992\haskell-src-exts-1.15.0.1\dist-tmp: 
MoveFileEx
"C:\\Users\\DIULLE~1\\AppData\\Local\\Temp\\haskell-src-exts-1.15.0.1-35992\\haskell-src-exts-1.15.0.1\\dist-tmp"
"C:\\Users\\DIULLE~1\\AppData\\Local\\Temp\\haskell-src-exts-1.15.0.1-35992\\haskell-src-exts-1.15.0.1\\dist": 
permission denied (Acesso negado.)

1 个答案:

答案 0 :(得分:4)

这是一个known bug for some time 1 ,似乎是固定的six days ago,所以请更新你的cabal 2

> cabal update
> cabal install cabal cabal-install
> cabal install ghc-mod

但是,如果您不想跳上cabal-git-train,您仍然可以手动打开包装,配置和安装包。这将阻止该行为,因为它是通过移动临时字典和名称冲突触发的:

> cabal unpack haskell-src-exts
> cd haskell-src-exts*
> cabal configure
> cabal build
> cabal install

1:由于该错误已于2月22日报告,因此似乎会影响从>= 1.18.*< 1.20.0.3的所有版本。
2:确保你真的运行新版本。