diff options
author | Gabriella Gonzalez <gabriella@mercury.com> | 2022-11-07 13:47:27 -0800 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2022-12-13 09:30:48 +0000 |
commit | c43e56810a8a2b43a8947221ee1e3d50d638fc9a (patch) | |
tree | d5300a99ee36c37bc02ce0056270ab2f56089d33 | |
parent | fcce6b7e8f2bb0fe9527258233a5475024dd1885 (diff) | |
download | haskell-c43e56810a8a2b43a8947221ee1e3d50d638fc9a.tar.gz |
Serialize builds of `rts` and `system-cxx-std-lib`wip/mp-9.4-backports
Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22099
I cannot say for sure that this will fix the linked issue, but
I explained why I believe this fixes the root problem in:
https://gitlab.haskell.org/ghc/ghc/-/issues/22099#note_461386
… 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-pkgs`, 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.
-rw-r--r-- | ghc.mk | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -628,6 +628,12 @@ libraries/ghc-prim/dist-install/package-data.mk : inplace/lib/package.conf.d/sys # add the final package.conf dependency: ghc-prim depends on RTS libraries/ghc-prim/dist-install/package-data.mk : rts/dist-install/package.conf.inplace + +# Force these two packages to be registered sequentially so that they are not +# registered in parallel. For more details, see: +# +# https://gitlab.haskell.org/ghc/ghc/-/issues/22099 +inplace/lib/package.conf.d/system-cxx-std-lib-1.0.conf : rts/dist-install/package.conf.inplace endif # -------------------------------- |