diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-03-25 11:47:23 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-04-08 13:55:15 -0400 |
commit | 6e2c3b7cba823cd9c315edb9c0c0edeece33ac30 (patch) | |
tree | f0bd68e9a07e668e6f76c13390f6f6cd50bf0848 /rules/way-prelims.mk | |
parent | 56254e6be108bf7d1993df269b3ae22a91903d45 (diff) | |
download | haskell-6e2c3b7cba823cd9c315edb9c0c0edeece33ac30.tar.gz |
driver: Introduce HomeModInfoCache abstraction
The HomeModInfoCache is a mutable cache which is updated incrementally
as the driver completes, this makes it robust to exceptions including
(SIGINT)
The interface for the cache is described by the `HomeMOdInfoCache` data
type:
```
data HomeModInfoCache = HomeModInfoCache { hmi_clearCache :: IO [HomeModInfo]
, hmi_addToCache :: HomeModInfo -> IO () }
```
The first operation clears the cache and returns its contents. This is
designed so it's harder to end up in situations where the cache is
retained throughout the execution of upsweep.
The second operation allows a module to be added to the cache.
The one slightly nasty part is in `interpretBuildPlan` where we have to
be careful to ensure that the cache writes happen:
1. In parralel
2. Before the executation continues after upsweep.
This requires some simple, localised MVar wrangling.
Fixes #20780
Diffstat (limited to 'rules/way-prelims.mk')
0 files changed, 0 insertions, 0 deletions