0

我试图将 system-fileio 安装到我的全局包 db 并且失败是:

c:\Haskell\2013.2.0.0\bin>cabal-1.20.0.1.exe install system-fileio
Resolving dependencies...
Configuring system-fileio-0.3.13...
Building system-fileio-0.3.13...
Failed to install system-fileio-0.3.13
Last 10 lines of the build log ( C:\Users\bitli\AppData\Roaming\cabal\logs\system-      fileio-0.3.13.log ):
The import of `System.IO.Error' is redundant
except perhaps to import instances from `System.IO.Error'
To import instances alone, use: import System.IO.Error()
lib\hssystemfileio-win32.c: In function 'hssystemfileio_copy_permissions':

lib\hssystemfileio-win32.c:10:17:
error: storage size of 'st' isn't known

lib\hssystemfileio-win32.c:11:2:
warning: implicit declaration of function '_wstat64'
cabal-1.20.0.1.exe: Error: some packages failed to install:
system-fileio-0.3.13 failed during the building phase. The exception was:
ExitFailure 1

我在 Windows 7 上尝试过。

4

1 回答 1

1

我刚刚在带有 system-fileio-0.3.13 的 Windows 7 上遇到了同样的问题,同时使用了带有 Haskell Platform 2013.2.0.0 的内置 mingw 的 windows 命令行以及带有更新的 mingw64 的 msys。该问题似乎是由 system-fileio-0.3.12 和 system-fileio-0.3.13 之间引入的更改引起的。system-fileio 的 git repo 似乎没有可链接的 Web 界面,但0.3.12 的 lib\hssystemfileio-win32.c使用:

struct _stat st;
int rc = _wstat(old_path, &st);

0.3.13 的 hssystemfileio-win32.c已更改为:

struct _stat64 st;
int rc = _wstat64(old_path, &st);

将 0.3.12 的 hssystemfileio-win32.c 复制到 0.3.13 之上似乎确实允许它构建,尽管我不知道它是否真的正常运行。

我不知道这是否对你有用,但我正在尝试在 Windows 7 上构建 yesod(在一个沙箱中,从 Haskell 平台中的一个升级的 cabal-install 中),我提取了一个 system-fileio 0.3。来自 Hackage 的 13 压缩包,将 0.3.12 的 hssystemfileio-win32.c 复制过来,然后cabal sandbox add-source ../system-fileio-0.3.13在我的 yesod 沙箱中做了一个。然后我cabal install的 yesod 可以继续进行,并且似乎已经奏效。如果您正在执行 system-fileio 的系统安装,您可能应该能够直接在提取和修改的 system-fileio-0.3.13 目录中构建。

我敢肯定,对 Haskell 和 cabal 有所了解的人将能够提供适当的解决方案,而不是这种 hack。

于 2014-05-24T20:27:04.940 回答