summaryrefslogtreecommitdiff
path: root/src/Compile
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2025-03-26 23:45:56 +0100
committerTom Smeding <tom@tomsmeding.com>2025-03-26 23:45:56 +0100
commite26f5ab33e1aee655df9469e03f88afd76a6335c (patch)
tree39ada76979e16daf2884192265d11c2ac4f2fa7b /src/Compile
parent2c1df7d9cde613fbe1aff0333462681d11eea879 (diff)
Compile.Exec: also remove tmpdir when compilation fails
Diffstat (limited to 'src/Compile')
-rw-r--r--src/Compile/Exec.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Compile/Exec.hs b/src/Compile/Exec.hs
index fa61910..b01b715 100644
--- a/src/Compile/Exec.hs
+++ b/src/Compile/Exec.hs
@@ -54,7 +54,9 @@ buildKernel csource funnames = do
case ec of
ExitSuccess -> return ()
- ExitFailure{} -> ioError (mkIOError userErrorType "chad kernel compilation failed" Nothing Nothing)
+ ExitFailure{} -> do
+ removeDirectoryRecursive path
+ ioError (mkIOError userErrorType "chad kernel compilation failed" Nothing Nothing)
numLoaded <- atomicModifyIORef' numLoadedCounter (\n -> (n+1, n+1))
when debug $ hPutStrLn stderr $ "[chad] loading kernel " ++ path ++ " (" ++ show numLoaded ++ " total)"