diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-09-13 13:41:15 +0100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2021-09-13 13:48:03 +0100 |
commit | 4f46a935b4515ab686c8ed420208be26098c3b08 (patch) | |
tree | 0d70dbdb8385167ef93f2dbdaa03084c1bed59e1 | |
parent | 2d15175266d0e0d9ca6565124b0c17e207b5541c (diff) | |
download | haskell-wip/t20293.tar.gz |
driver: Clean up temporary files after a module has been compiledwip/t20293
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
-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 ef5ce36fef..3f60085f83 100644 --- a/compiler/GHC/Driver/Make.hs +++ b/compiler/GHC/Driver/Make.hs @@ -2258,7 +2258,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 @@ -2288,7 +2291,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 |