[darcs-users] Something is seriously wrong with Darcs on Windows

Simon Marlow marlowsd at gmail.com
Mon Apr 26 21:52:32 UTC 2010

On 24/04/10 15:07, Petr Rockai wrote:
> Hi,
> Eric Kow<kowey at darcs.net>  writes:
>> 3. Work on darcs 2.4.2 resolving the Windows issue specifically
> at this point, it is a matter of bumping h-s dependency to 0.4.12.
> I have (semi-accidentally) tracked this bug down to yet another lstat
> screwup in GHC. On win32, System.Posix.Internals.lstat just gives random
> data. The index size and existence is derived from this random data and
> that explains both symptoms that have been observed.

Could you submit a bug for that?  I'm not by a Windows box right now to 
test it, but looking at the code it looks like lstat has exactly the 
same implementation as c_stat:

foreign import ccall unsafe "HsBase.h __hscore_lstat"
    lstat :: CFilePath -> Ptr CStat -> IO CInt

foreign import ccall unsafe "HsBase.h __hscore_stat"
    c_stat :: CFilePath -> Ptr CStat -> IO CInt


INLINE int __hscore_stat(wchar_t *file, struct_stat *buf) {
	return _wstati64(file,buf);
INLINE int __hscore_lstat(wchar_t *fname, struct_stat *buf )
	return _wstati64(fname,buf);

very strange...


> I now use:
> #if mingw32_HOST_OS
> lstat = c_stat
> #else
> import System.Posix.Internals( lstat )
> #endif
> Yours,
>     Petr.

More information about the darcs-users mailing list