`ghc-cabal configure` failures from DeleteFile on Windows
"inplace/bin/ghc-cabal.exe" configure libraries/binary dist-boot --with-ghc="c:/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/ghc.exe" --with-ghc-pkg="c:/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/ghc-pkg" --package-db=C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/libraries/bootstrapping.conf --disable-library-for-ghci --enable-library-vanilla --enable-library-for-ghci --disable-library-profiling --disable-shared --configure-option=CFLAGS="-Wall -Wno-error=inline -iquote C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/libraries/binary" --configure-option=LDFLAGS=" " --configure-option=CPPFLAGS=" " --gcc-options="-Wall -Wno-error=inline -iquote C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/libraries/binary " --constraint "binary == 0.8.7.0" --constraint "text == 1.2.3.1" --constraint "transformers == 0.5.6.2" --constraint "mtl == 2.2.2" --constraint "parsec == 3.1.14.0" --constraint "Cabal == 3.2.0.0" --constraint "hpc == 0.6.1.0" --constraint "ghc-boot-th == 8.11.0.20200108" --constraint "ghc-boot == 8.11.0.20200108" --constraint "template-haskell == 2.16.0.0" --constraint "ghc-heap == 8.11.0.20200108" --constraint "ghci == 8.11.0.20200108" --with-gcc="C:\\GitLabRunner\\builds\\e963ee11\\0\\ghc\\ghc\\toolchain\\lib\\../mingw/bin/gcc.exe" --with-ld="C:\\GitLabRunner\\builds\\e963ee11\\0\\ghc\\ghc\\toolchain\\lib\\../mingw/bin/ld.exe" --with-ar="C:\\GitLabRunner\\builds\\e963ee11\\0\\ghc\\ghc\\toolchain\\lib\\../mingw/bin/ar.exe" --with-alex="/c/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/alex" --with-happy="/c/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/happy"
"inplace/bin/ghc-cabal.exe" configure utils/hsc2hs dist --with-ghc="c:/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/ghc.exe" --with-ghc-pkg="c:/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/ghc-pkg" --package-db=C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/libraries/bootstrapping.conf --disable-library-for-ghci --disable-library-vanilla --disable-library-profiling --disable-shared --configure-option=CFLAGS="-Wall -Wno-error=inline -iquote C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/utils/hsc2hs" --configure-option=LDFLAGS=" " --configure-option=CPPFLAGS=" " --gcc-options="-Wall -Wno-error=inline -iquote C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/utils/hsc2hs " --constraint "binary == 0.8.7.0" --constraint "text == 1.2.3.1" --constraint "transformers == 0.5.6.2" --constraint "mtl == 2.2.2" --constraint "parsec == 3.1.14.0" --constraint "Cabal == 3.2.0.0" --constraint "hpc == 0.6.1.0" --constraint "ghc-boot-th == 8.11.0.20200108" --constraint "ghc-boot == 8.11.0.20200108" --constraint "template-haskell == 2.16.0.0" --constraint "ghc-heap == 8.11.0.20200108" --constraint "ghci == 8.11.0.20200108" --with-gcc="C:\\GitLabRunner\\builds\\e963ee11\\0\\ghc\\ghc\\toolchain\\lib\\../mingw/bin/gcc.exe" --with-ld="C:\\GitLabRunner\\builds\\e963ee11\\0\\ghc\\ghc\\toolchain\\lib\\../mingw/bin/ld.exe" --with-ar="C:\\GitLabRunner\\builds\\e963ee11\\0\\ghc\\ghc\\toolchain\\lib\\../mingw/bin/ar.exe" --with-alex="/c/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/alex" --with-happy="/c/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/happy"
"inplace/bin/ghc-cabal.exe" configure utils/gen-dll dist --with-ghc="c:/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/ghc.exe" --with-ghc-pkg="c:/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/ghc-pkg" --package-db=C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/libraries/bootstrapping.conf --disable-library-for-ghci --disable-library-vanilla --disable-library-profiling --disable-shared --configure-option=CFLAGS="-Wall -Wno-error=inline -iquote C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/utils/gen-dll" --configure-option=LDFLAGS=" " --configure-option=CPPFLAGS=" " --gcc-options="-Wall -Wno-error=inline -iquote C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/utils/gen-dll " --constraint "binary == 0.8.7.0" --constraint "text == 1.2.3.1" --constraint "transformers == 0.5.6.2" --constraint "mtl == 2.2.2" --constraint "parsec == 3.1.14.0" --constraint "Cabal == 3.2.0.0" --constraint "hpc == 0.6.1.0" --constraint "ghc-boot-th == 8.11.0.20200108" --constraint "ghc-boot == 8.11.0.20200108" --constraint "template-haskell == 2.16.0.0" --constraint "ghc-heap == 8.11.0.20200108" --constraint "ghci == 8.11.0.20200108" --with-gcc="C:\\GitLabRunner\\builds\\e963ee11\\0\\ghc\\ghc\\toolchain\\lib\\../mingw/bin/gcc.exe" --with-ld="C:\\GitLabRunner\\builds\\e963ee11\\0\\ghc\\ghc\\toolchain\\lib\\../mingw/bin/ld.exe" --with-ar="C:\\GitLabRunner\\builds\\e963ee11\\0\\ghc\\ghc\\toolchain\\lib\\../mingw/bin/ar.exe" --with-alex="/c/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/alex" --with-happy="/c/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/happy"
"inplace/bin/ghc-cabal.exe" configure utils/genapply dist --with-ghc="c:/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/ghc.exe" --with-ghc-pkg="c:/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/ghc-pkg" --package-db=C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/libraries/bootstrapping.conf --disable-library-for-ghci --disable-library-vanilla --disable-library-profiling --disable-shared --configure-option=CFLAGS="-Wall -I,includes/dist-install/build -Wno-error=inline -iquote C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/utils/genapply" --configure-option=LDFLAGS=" " --configure-option=CPPFLAGS=" " --gcc-options="-Wall -I,includes/dist-install/build -Wno-error=inline -iquote C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/utils/genapply " --constraint "binary == 0.8.7.0" --constraint "text == 1.2.3.1" --constraint "transformers == 0.5.6.2" --constraint "mtl == 2.2.2" --constraint "parsec == 3.1.14.0" --constraint "Cabal == 3.2.0.0" --constraint "hpc == 0.6.1.0" --constraint "ghc-boot-th == 8.11.0.20200108" --constraint "ghc-boot == 8.11.0.20200108" --constraint "template-haskell == 2.16.0.0" --constraint "ghc-heap == 8.11.0.20200108" --constraint "ghci == 8.11.0.20200108" --with-gcc="C:\\GitLabRunner\\builds\\e963ee11\\0\\ghc\\ghc\\toolchain\\lib\\../mingw/bin/gcc.exe" --with-ld="C:\\GitLabRunner\\builds\\e963ee11\\0\\ghc\\ghc\\toolchain\\lib\\../mingw/bin/ld.exe" --with-ar="C:\\GitLabRunner\\builds\\e963ee11\\0\\ghc\\ghc\\toolchain\\lib\\../mingw/bin/ar.exe" --with-alex="/c/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/alex" --with-happy="/c/GitLabRunner/builds/e963ee11/0/ghc/ghc/toolchain/bin/happy"
Configuring genapply-0.1...
Configuring gen-dll-0.1...
Configuring hsc2hs-0.68.6...
Configuring binary-0.8.7.0...
Warning: Instead of 'ghc-options: -DHAS_GENLIB=False
-DNM_TOOL_BIN="\"C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/inplace/mingw/bin/nm.exe\""
-DLIB_TOOL_BIN="\"C:/msys64/usr/bin/libtool\"" -DGENLIB_TOOL_BIN="\"\""
-DAR_TOOL_BIN="\"C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/inplace/mingw/bin/ar.exe\""
-UGEN_SXS' use 'cpp-options: -DHAS_GENLIB=False
-DNM_TOOL_BIN="\"C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/inplace/mingw/bin/nm.exe\""
-DLIB_TOOL_BIN="\"C:/msys64/usr/bin/libtool\"" -DGENLIB_TOOL_BIN="\"\""
-DAR_TOOL_BIN="\"C:/GitLabRunner/builds/e963ee11/0/ghc/ghc/inplace/mingw/bin/ar.exe\""
-UGEN_SXS'
Warning: The package has an extraneous version range for a dependency on an internal library:
binary -any && ==0.8.7.0, binary -any && ==0.8.7.0, binary -any && ==0.8.7.0, binary -any && ==0.8.7.0, binary -any && ==0.8.7.0,
binary -any && ==0.8.7.0, binary -any && ==0.8.7.0. This version range includes the
current package but isn't needed as the current package's library will always be used.
C:\GitLabRunner\builds\e963ee11\0\ghc\ghc\tmp\ghcD013.o: DeleteFile "\\\\?\\C:\\GitLabRunner\\builds\\e963ee11\\0\\ghc\\ghc\\tmp\\ghcD013.o": permission denied (Access is denied.)
utils/deriveConstants/ghc.mk:19: utils/deriveConstants/dist/package-data.mk: No such file or directory
make[1]: *** [libraries/binary/ghc.mk:3: libraries/binary/dist-boot/package-data.mk] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:124: all] Error 2
It seems that somehow ghc-cabal
is failing to delete a file that is still in use. As usual with Windows issues, this is non-deterministic.