0

I tried to install system-fileio to my global package db and failure was :

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

I tried it on Windows 7.

bitli
  • 575
  • 2
  • 14
  • 2
    The problem isn't the `System.IO.Error` import, it's the line with the error: `lib\hssystemfileio-win32.c:10:17: error: storage size of 'st' isn't known` – felix-eku May 24 '14 at 09:02
  • Yes, I wrote a letter to the committer and he wrote me that there are an investigation about this issue and I can track here: https://github.com/jmillikin/haskell-filesystem/issues/1 – bitli May 25 '14 at 06:27
  • The build failures were caused by an old MinGW version in the Haskell Platform. Version 0.3.14 of the system-fileio package fixes this issue. There's more info on the linked github issue, for anyone curious about why it was difficult to reproduce. – John Millikin May 30 '14 at 04:25

1 Answers1

1

I just ran into this same problem on Windows 7 with system-fileio-0.3.13, using both the windows command line with Haskell Platform 2013.2.0.0's built-in mingw and also inside msys with a newer mingw64. The problem appears to be caused by a change introduced between system-fileio-0.3.12 and system-fileio-0.3.13. system-fileio's git repo doesn't seem to have a web interface to link to, but 0.3.12's lib\hssystemfileio-win32.c uses:

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

while 0.3.13's hssystemfileio-win32.c has changed to:

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

Copying 0.3.12's hssystemfileio-win32.c over top of 0.3.13's does seem to allow it to build, though I don't know if it actually functions correctly.

I don't know if this will work for you, but I'm trying to build yesod on Windows 7 (inside a sandbox with an upgraded cabal-install from the one in the Haskell Platform) and I extracted a system-fileio 0.3.13 tarball from Hackage, copied 0.3.12's hssystemfileio-win32.c over, and then did a cabal sandbox add-source ../system-fileio-0.3.13 inside my yesod sandbox. My cabal install of yesod could then proceed and seems to have worked. If you're doing a system install of system-fileio, you probably should be able to just build in the extracted and modified system-fileio-0.3.13 directory directly.

I'm sure someone who knows something about Haskell and cabal will be able to provide a proper solution instead of this hack.

a4332471
  • 26
  • 1
  • I just moved from the (32-bit) Haskell Platform to the ghc-7.8.2-x86_64 download from haskell.org, and system-fileio 0.3.13 now builds just fine. I don't know if this points to 0.3.13 working on 64-bit systems/headers only, or if it's a result of the newer GHC or newer bundled mingw. – a4332471 May 24 '14 at 23:09
  • Yes, I wrote a letter to the committer and he wrote me that there are an investigation about this issue and I can track here: https://github.com/jmillikin/haskell-filesystem/issues/1 – bitli May 25 '14 at 06:27
  • You do not have to rebuild the yesod package. I removed system-fileio-0.3.13 package from cabal package and download system-fileio-0.3.13 and system-fileio-0.3.12 and I exchanged the lib library of system-fileio-0.3.13 to system-fileio-0.3.12 and install. That's why cabal does not want to download and install the newest version. – bitli May 25 '14 at 08:58
  • 1
    The build failures were caused by an old MinGW version in the Haskell Platform. Version 0.3.14 of the system-fileio package fixes this issue. There's more info on the linked github issue, for anyone curious about why it was difficult to reproduce. – John Millikin May 30 '14 at 04:24