Automating GHC build for Windows

David Macek david.macek.0 at
Sun Mar 29 11:56:38 UTC 2015

I hope you don't mind me posting to an old thread.

I'm re-building ghc-7.10.1 a lot these days and there is one recurring permission issue that looks awfully similar to the ones mentioned here. The issue seems to be deterministic -- appears on every build IIRC and cannot be fixed by re-running make. My real-time malware scanner is disabled and I assume it's not caused by indexing services.

The problem seems to be due to botched ACLs in/of the /tmp directory. Some of the files/directories inside are undeletable by the user which is running the build and some can't be deleted even with admin rights. To fix this, I have to force take ownership and grant myself permissions on the files/directories. The build can't continue even after emptying the /tmp directory, as the permissions on the directory itself seems to be broken -- so much that Windows Explorer refuses to show the Advanced Security Settings window for it. Deleting the directory and re-creating with correct permissions allows the build to continue.

The tail of a failing build log follows. Unfortunately, it doesn't tell much about the operation that failed. I hope I'll be able to find some time to find out what's failing and what's causing the permissions change.

"inplace/bin/ghc-cabal" check libraries/ghc-prim
"inplace/bin/ghc-cabal" configure libraries/ghc-prim dist-install "" --with-ghc="<buildir>/inplace/bin/ghc-stage1" --with-ghc-pkg="<buildir>/inplace/bin/ghc-pkg" --flag=include-ghc-prim --disable-library-for-ghci --enable-library-vanilla --enable-library-for-ghci --disable-library-profiling --disable-shared --configure-option=CFLAGS=" -fno-stack-protector   " --configure-option=LDFLAGS="  " --configure-option=CPPFLAGS="   " --gcc-options=" -fno-stack-protector      " --with-gcc="/mingw64/bin/gcc" --with-ld="/mingw64/bin/ld" --configure-option=--with-cc="/mingw64/bin/gcc" --with-ar="/mingw64/bin/ar"
Configuring ghc-prim-
ghc-cabal.exe: permission denied
libraries/ghc-prim/ recipe for target 'libraries/ghc-prim/dist-install/' failed
make[1]: *** [libraries/ghc-prim/dist-install/] Error 1
Makefile:71: recipe for target 'all' failed
make: *** [all] Error 2

(Paths starting with <buildir> were shortened by me for the purpose of posting here.)

David Macek

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4234 bytes
Desc: S/MIME Cryptographic Signature
URL: <>

More information about the ghc-devs mailing list