DerivedConstants.h not produced atomically
We have seen the following issue on CI (https://gitlab.haskell.org/ghc/ghc/-/jobs/645999):
| Run DeriveConstants: none => _build/stage1/lib/DerivedConstants.h (and 1 more)
| Run Cc FindCDependencies Stage1: rts/linker/elf_util.c => _build/stage1/rts/build/c/linker/elf_util.o.d
| Run Cc FindCDependencies Stage1: rts/sm/Storage.c => _build/stage1/rts/build/c/sm/Storage.o.d
| Run Cc FindCDependencies Stage1: rts/Hpc.c => _build/stage1/rts/build/c/Hpc.o.d
| Run Cc FindCDependencies Stage1: rts/StgPrimFloat.c => _build/stage1/rts/build/c/StgPrimFloat.o.d
| Run Cc FindCDependencies Stage1: rts/sm/NonMoving.c => _build/stage1/rts/build/c/sm/NonMoving.o.d
| Run Cc FindCDependencies Stage1: rts/RaiseAsync.c => _build/stage1/rts/build/c/RaiseAsync.o.d
| Run Cc FindCDependencies Stage1: rts/posix/Itimer.c => _build/stage1/rts/build/c/posix/Itimer.o.d
| Run Cc FindCDependencies Stage1: rts/hooks/MallocFail.c => _build/stage1/rts/build/c/hooks/MallocFail.o.d
| Run Cc FindCDependencies Stage1: rts/sm/MarkWeak.c => _build/stage1/rts/build/c/sm/MarkWeak.o.d
| Run Cc FindCDependencies Stage1: rts/StaticPtrTable.c => _build/stage1/rts/build/c/StaticPtrTable.o.d
| Run Cc FindCDependencies Stage1: rts/linker/elf_reloc.c => _build/stage1/rts/build/c/linker/elf_reloc.o.d
| Run Cc FindCDependencies Stage1: rts/OldARMAtomic.c => _build/stage1/rts/build/c/OldARMAtomic.o.d
| Run Ghc CompileCWithGhc Stage1: rts/hooks/MallocFail.c => _build/stage1/rts/build/c/hooks/MallocFail.o
| Run Ghc CompileCWithGhc Stage1: rts/hooks/StackOverflow.c => _build/stage1/rts/build/c/hooks/StackOverflow.o
| Run Cc FindCDependencies Stage1: rts/posix/Signals.c => _build/stage1/rts/build/c/posix/Signals.o.d
| Run Cc FindCDependencies Stage1: rts/PrimOps.cmm => _build/stage1/rts/build/cmm/PrimOps.o.d
| Run Cc FindCDependencies Stage1: rts/linker/MachO.c => _build/stage1/rts/build/c/linker/MachO.o.d
| Run Cc FindCDependencies Stage1: rts/ClosureFlags.c => _build/stage1/rts/build/c/ClosureFlags.o.d
| Run Ghc CompileCWithGhc Stage1: rts/OldARMAtomic.c => _build/stage1/rts/build/c/OldARMAtomic.o
| Run Cc FindCDependencies Stage1: rts/Inlines.c => _build/stage1/rts/build/c/Inlines.o.d
ghc: panic! (the 'impossible' happened)
(GHC version 9.1.20210410:
Couldn't find #define HS_CONSTANTS " in _build/stage1/lib/DerivedConstants.h
CallStack (from HasCallStack):
error, called at _build/stage0/compiler/build/GHC/Platform/Constants.hs:143:20 in ghc:GHC.Platform.Constants
It's because DerivedConstants.h
file is not created atomically. Fix incoming.