Hadrian: Build tries to use non-existant package.cache
Summary
Hadrian seems to fail to track a dependency on "package.cache" ".../_quick/stage1/lib/package.conf.d" as I get an error about it not existing. However simply restarting the build does not trigger this error. And I can not reliably reproduce it either.
I suspect it's a race condition that only happens rarely.
There is the output from hadrian.
/-----------------------------------------------------\
| Successfully built library 'rts' (Stage1, way thr). |
| Library: _quick/stage1/rts/build/libHSrts-1.0_thr.a |
\-----------------------------------------------------/
E:/ghc_tyConEnv/inplace/mingw/bin/ar.exe: creating _quick/stage1/rts/build/libHSrts-1.0_debug.a
/-------------------------------------------------------\
| Successfully built library 'rts' (Stage1, way debug). |
| Library: _quick/stage1/rts/build/libHSrts-1.0_debug.a |
\-------------------------------------------------------/
| Copy file: _quick/stage1/lib/ghcversion.h => _quick/stage1/rts/build/ghcversion.h
| Copy file: _quick/stage1/lib/DerivedConstants.h => _quick/stage1/rts/build/DerivedConstants.h
| Copy file: _quick/stage1/lib/ghcplatform.h => _quick/stage1/rts/build/ghcplatform.h
| Copy file: _quick/stage1/lib/ghcautoconf.h => _quick/stage1/rts/build/ghcautoconf.h
| Configure package 'hp2ps'
# cabal-configure (for _quick/stage1/utils/hp2ps/setup-config)
| Copy package 'rts'
# cabal-copy (for _quick/stage1/lib/package.conf.d/rts-1.0.conf)
| Register package 'rts'
# cabal-register (for _quick/stage1/lib/package.conf.d/rts-1.0.conf)
ghc.exe: there is no package.cache in E:/ghc_tyConEnv/_quick/stage1/lib/package.conf.d even though package database is not empty
Error when running Shake build system:
at action, called at src\Rules.hs:40:19 in main:Rules
at need, called at src\Rules.hs:62:5 in main:Rules
* Depends on: _quick/stage1/bin/hp2ps.exe
at apply1, called at src\Development\Shake\Internal\Rules\Oracle.hs:159:32 in shake-0.19.1-6250ef10c63b4e72951bf21b7bbfb0a16f6e14c8:Development.Shake.Internal.Rules.Oracle
* Depends on: OracleQ (ContextDataKey (Context {stage = Stage1, package = Package {pkgType = Program, pkgName = "hp2ps", pkgPath = "utils/hp2ps"}, way = v}))
at need, called at src\Hadrian\Oracles\Cabal\Rules.hs:54:9 in main:Hadrian.Oracles.Cabal.Rules
* Depends on: _quick/stage1/utils/hp2ps/setup-config
* Raised the exception:
ExitFailure 1
Steps to reproduce
I got this error when building master with 6 threads. But I don't think it's easy to reproduce.
Environment
- GHC version used: 8.10.x
- Operating System: Windows