summaryrefslogtreecommitdiff
path: root/compiler/GHC
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-09-13 13:41:15 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-09-17 09:41:20 -0400
commita6529ffdec9d1082308fe96a2cbd9c53f597bfb6 (patch)
treeafa00a2a15f134381ed9bcdc1935f3eb86378918 /compiler/GHC
parentbfddee13d10b183452508fa00116b6449ffeb757 (diff)
downloadhaskell-a6529ffdec9d1082308fe96a2cbd9c53f597bfb6.tar.gz
driver: Clean up temporary files after a module has been compiled
The refactoring accidently removed these calls to eagerly remove temporary files after a module has been compiled. This caused some issues with tmpdirs getting filled up on my system when the project had a large number of modules (for example, Agda) Fixes #20293
Diffstat (limited to 'compiler/GHC')
-rw-r--r--compiler/GHC/Driver/Make.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs
index bb15a919b9..26dba65d15 100644
--- a/compiler/GHC/Driver/Make.hs
+++ b/compiler/GHC/Driver/Make.hs
@@ -2259,7 +2259,10 @@ executeInstantiationNode k n wait_deps iu = do
-- avoid output interleaving
let lcl_hsc_env = setHPT deps hsc_env
msg <- asks env_messager
- lift $ MaybeT $ wrapAction lcl_hsc_env $ upsweep_inst lcl_hsc_env msg k n iu
+ lift $ MaybeT $ wrapAction lcl_hsc_env $ do
+ res <- upsweep_inst lcl_hsc_env msg k n iu
+ cleanCurrentModuleTempFilesMaybe (hsc_logger hsc_env) (hsc_tmpfs hsc_env) (hsc_dflags hsc_env)
+ return res
executeCompileNode :: Int
-> Int
@@ -2289,7 +2292,10 @@ executeCompileNode k n wait_deps mknot_var mod = do
hsc_env { hsc_type_env_vars = knotVarsFromModuleEnv knot_var }
-- Compile the module, locking with a semphore to avoid too many modules
-- being compiled at the same time leading to high memory usage.
- lift $ MaybeT (withAbstractSem compile_sem $ wrapAction lcl_hsc_env $ upsweep_mod lcl_hsc_env env_messager old_hpt mod k n)
+ lift $ MaybeT (withAbstractSem compile_sem $ wrapAction lcl_hsc_env $ do
+ res <- upsweep_mod lcl_hsc_env env_messager old_hpt mod k n
+ cleanCurrentModuleTempFilesMaybe (hsc_logger hsc_env) (hsc_tmpfs hsc_env) lcl_dynflags
+ return res)
executeTypecheckLoop :: IO HomePackageTable -- Dependencies of the loop
-> RunMakeM [HomeModInfo] -- The loop itself