<div dir="ltr">Without knowing much about the surrounding code, I would try two things here.<div><br></div><div>1. Is it possible that the file was opened by for writing and not closed because of lazy I/O?</div><div><br></div><div>2. Since the error is completely deterministic, you could try "freezing" evaluation right before the crash (either by a breakpoint in ghci or just adding a time delay / console read on the code), and then using <a href="http://serverfault.com/questions/1966/how-do-you-find-what-process-is-holding-a-file-open-in-windows" target="_blank">a utility app</a> to check which process is keeping the file open, whether it's the same process or something else.</div><div><br></div><div>If any of the involved paths is a directory, this could be <a href="https://ghc.haskell.org/trac/ghc/ticket/8482" target="_blank">#8482</a>, although that does not seem to be the case.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 30, 2014 at 7:13 PM, Páli Gábor János <span dir="ltr"><<a href="mailto:pali.gabor@gmail.com" target="_blank">pali.gabor@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>2014-10-30 16:24 GMT+01:00 Gintautas Miliauskas <<a href="mailto:gintautas@miliauskas.lt" target="_blank">gintautas@miliauskas.lt</a>>:<br>
> I wonder what's going on with DeleteFile. What is the step that's failing?<br>
<br>
</span>Basically it happens at the same point, that is, at the "configure"<br>
phase but at the ghc-prim package. Note that the previously mentioned<br>
workaround has a "removeFile" action [1], I guess the failure of that<br>
triggers the DeleteFile exception.<br>
<span><br>
> Can you post the log?<br>
<br>
</span>"inplace/bin/ghc-cabal.exe" configure libraries/ghc-prim dist-install<br>
"" --with-ghc="C:/msys64/home/ghc-builder/ghc/inplace/bin/ghc-stage1.exe"<br>
--with-ghc-pkg="C:/msys64/home/ghc-builder/ghc/inplace/bin/ghc-pkg.exe"<br>
--flag=include-ghc-prim --disable-library-for-ghci<br>
--enable-library-vanilla --enable-library-for-ghci<br>
--enable-library-profiling --disable-shared<br>
<span>--configure-option=CFLAGS=" -U__i686 -march=i686 -fno-stack-protector<br>
" --configure-option=LDFLAGS=" " --configure-option=CPPFLAGS=" "<br>
--gcc-options=" -U__i686 -march=i686 -fno-stack-protector "<br>
</span>--with-gcc="C:/msys64/home/ghc-builder/ghc/inplace/mingw/bin/gcc.exe"<br>
--with-ld="C:/msys64/home/ghc-builder/ghc/inplace/mingw/bin/ld.exe"<br>
--configure-option=--with-cc="C:/msys64/home/ghc-builder/ghc/inplace/mingw/bin/gcc.exe"<br>
--with-ar="/usr/bin/ar" --with-alex="/usr/local/bin/alex"<br>
--with-happy="/usr/local/bin/happy"<br>
Configuring ghc-prim-0.3.1.0...<br>
ghc-cabal.exe: DeleteFile "dist-install\\setup-config": permission<br>
denied (The process cannot access the file because it is being used by<br>
another process.)<br>
libraries/ghc-prim/<a href="http://ghc.mk:4" target="_blank">ghc.mk:4</a>: recipe for target<br>
'libraries/ghc-prim/dist-install/<a href="http://package-data.mk" target="_blank">package-data.mk</a>' failed<br>
make[1]: *** [libraries/ghc-prim/dist-install/<a href="http://package-data.mk" target="_blank">package-data.mk</a>] Error 1<br>
Makefile:71: recipe for target 'all' failed<br>
<span><br>
> I also wonder why this issue is not arising on other Windows machines...<br>
<br>
</span>As the comment in the workaround goes, it has a "Big fat hairy race<br>
condition". Therefore I am inclined to believe that it may be a<br>
problem for other systems as well, but I am the most unfortunate one<br>
who hits this error with 100% probability :-)<br>
<br>
[1] <a href="https://github.com/ghc/ghc/blob/master/libraries/bin-package-db/GHC/PackageDb.hs#L267" target="_blank">https://github.com/ghc/ghc/blob/master/libraries/bin-package-db/GHC/PackageDb.hs#L267</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Gintautas Miliauskas</div>
</div></div>