Fix recompilation checking for multiple home units
See individual commits for details.
There is a corresponding 9.4 branch with the already backported commits here: https://gitlab.haskell.org/ghc/ghc/-/commits/wip/recomp-fixes-9.4
Due to a large amount of spam we do not allow new users to create repositories, they are "external" users. If you are a new user and want to create a repository, for example for forking GHC, open a new issue on ghc/ghc using the "get-verified" issue template
See individual commits for details.
There is a corresponding 9.4 branch with the already backported commits here: https://gitlab.haskell.org/ghc/ghc/-/commits/wip/recomp-fixes-9.4