diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-09-13 13:41:15 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-09-17 09:41:20 -0400 |
commit | a6529ffdec9d1082308fe96a2cbd9c53f597bfb6 (patch) | |
tree | afa00a2a15f134381ed9bcdc1935f3eb86378918 /compiler/GHC | |
parent | bfddee13d10b183452508fa00116b6449ffeb757 (diff) | |
download | haskell-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.hs | 10 |
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 |