Serialize builds of `rts` and `system-cxx-std-lib`
Fixes #22099 (closed)
I cannot say for sure that this will fix the linked issue, but I explained why I believe this fixes the root problem in:
… and when we applied this patch internally the problem appeared to disappear for a few builds in a row with a large number of cores.
The short summary of the above comment is that the Makefile
serializes the package registrations using ghc-pkg
, with the
exception of two packages (rts
and system-cxx-std-lib
) and
we expect that this one instance of parallelism that was still
left in the Makefile
was the root cause of the flaky build
failure.
This fix would be consistent with two known things about the failure:
-
The build failure only occurs for parallel
Make
builds… and these are the only two
ghc-pkg
calls that run concurrently -
The error first appeared in the GHC 9.4 branch and was absent in GHC 9.2
… and GHC 9.4 was the first release that included
system-cxx-std-lib
(as far as I know), which would explain why this problem didn't happen before.
The change here forces the two packages to be registered in sequence.
This problem will of course go away in GHC 9.6 by virtue of
dropping the make
-based build, but since the GHC 9.4 branch is
supported and active we wanted to upstream this patch to the
9.4 development branch.