Automating GHC build for Windows

Páli Gábor János pali.gabor at gmail.com
Thu Oct 30 18:13:10 UTC 2014


2014-10-30 16:24 GMT+01:00 Gintautas Miliauskas <gintautas at miliauskas.lt>:
> I wonder what's going on with DeleteFile. What is the step that's failing?

Basically it happens at the same point, that is, at the "configure"
phase but at the ghc-prim package.  Note that the previously mentioned
workaround has a "removeFile" action [1], I guess the failure of that
triggers the DeleteFile exception.

> Can you post the log?

"inplace/bin/ghc-cabal.exe" configure libraries/ghc-prim dist-install
"" --with-ghc="C:/msys64/home/ghc-builder/ghc/inplace/bin/ghc-stage1.exe"
--with-ghc-pkg="C:/msys64/home/ghc-builder/ghc/inplace/bin/ghc-pkg.exe"
--flag=include-ghc-prim --disable-library-for-ghci
--enable-library-vanilla --enable-library-for-ghci
--enable-library-profiling --disable-shared
--configure-option=CFLAGS=" -U__i686 -march=i686 -fno-stack-protector
 " --configure-option=LDFLAGS="   " --configure-option=CPPFLAGS="   "
--gcc-options=" -U__i686 -march=i686 -fno-stack-protector       "
--with-gcc="C:/msys64/home/ghc-builder/ghc/inplace/mingw/bin/gcc.exe"
--with-ld="C:/msys64/home/ghc-builder/ghc/inplace/mingw/bin/ld.exe"
--configure-option=--with-cc="C:/msys64/home/ghc-builder/ghc/inplace/mingw/bin/gcc.exe"
--with-ar="/usr/bin/ar" --with-alex="/usr/local/bin/alex"
--with-happy="/usr/local/bin/happy"
Configuring ghc-prim-0.3.1.0...
ghc-cabal.exe: DeleteFile "dist-install\\setup-config": permission
denied (The process cannot access the file because it is being used by
another process.)
libraries/ghc-prim/ghc.mk:4: recipe for target
'libraries/ghc-prim/dist-install/package-data.mk' failed
make[1]: *** [libraries/ghc-prim/dist-install/package-data.mk] Error 1
Makefile:71: recipe for target 'all' failed

> I also wonder why this issue is not arising on other Windows machines...

As the comment in the workaround goes, it has a "Big fat hairy race
condition".  Therefore I am inclined to believe that it may be a
problem for other systems as well, but I am the most unfortunate one
who hits this error with 100% probability :-)

[1] https://github.com/ghc/ghc/blob/master/libraries/bin-package-db/GHC/PackageDb.hs#L267


More information about the ghc-devs mailing list