Migration guide for multiple home units

ÉRDI Gergő gergo at erdi.hu
Sun Jun 19 04:31:48 UTC 2022


On Thu, 16 Jun 2022, Erdi, Gergo via ghc-devs wrote:

> Is there a migration guide for GHC API clients for the new “multiple home units”
> feature?

OK so in concrete terms, please see my attached program which is a heavily 
cut-down, standalone version of my real program. On commit 
fd42ab5fa1df847a6b595dfe4b63d9c7eecbf400^ (i.e. 
3219610e3ba6cb6a5cd1f4e32e2b4befea5bd384) it compiles and works as 
expected. On commit fd42ab5fa1df847a6b595dfe4b63d9c7eecbf400 onwards, two 
problems pop up:

1. `extendMG` has changed and now requires manually specifying outgoing 
dependency edges. I thought the whole point of `summariseFile` was to 
collect this information? The reason I need to `extendMG` at that point is 
to get intra-unit orphan instances working.

2. `modifyUnitState` and its two uses (`addUnit` and `registerModule`) 
need to be updated to the new API. I think it makes sense that these need 
changing, since they touch exactly on the issue of which units are being 
compiled right now. However, I don't know how to update these. Also, I 
guess `setHomeUnit` should change the `CurrentUnit` instead of the 
`HomeUnit` now?

Thanks,
 	Gergo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GHCAPI.hs
Type: text/x-haskell
Size: 9209 bytes
Desc: 
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20220619/5f4ccba8/attachment.hs>


More information about the ghc-devs mailing list