diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2019-08-16 03:58:28 +0200 |
---|---|---|
committer | Daniel Gröber (dxld) <dxld@darkboxed.org> | 2019-09-17 17:48:26 +0200 |
commit | d19e59312f3a6648bd53d489c60ec11b73289f40 (patch) | |
tree | 5146177c3eafac13db252ea975012db244243d55 /tests | |
parent | f73498e8c861871294e9472a261b66884df8ca7e (diff) |
Make caching more fine grained
Previously we only had a cache for the project info and each unit
info. However adding support for passing overridden compiler paths to build
tools introduces a nasty data dependency: to fully configure 'Program's
we (used to) need ProjInfo which needs an already configured 'Programs' in
readProjInfo (ugh).
After at least four failed attempts at untangling this I arrived at this
solution. Simply splitting up the caches into some smaller parts does the
trick and as a side product forced me to add an abstraction for the caching
logic so as to not reapeat myself even more.
Relatedly runQuery is not just a field accessor anymore but actualy does
some IO of itself to manage the cache and make already configured
'Program's available to the rest of the library.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/GhcSession.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/GhcSession.hs b/tests/GhcSession.hs index 02e5c76..9fc7899 100644 --- a/tests/GhcSession.hs +++ b/tests/GhcSession.hs @@ -323,7 +323,7 @@ test modProgs (psdImpl -> ProjSetupImpl{..}) topdir tmpdir projdir cabal_file -- TODO: Cludge until we can just build the unit dependencies -- TODO: Move back under runQuery when we fixed backpack - buildProject qe + runQuery buildProject qe cs <- concat <$> runQuery (allUnits (Map.elems . uiComponents)) qe |