From 884e956711508eeba9bf6652a89e49502cef3f55 Mon Sep 17 00:00:00 2001 From: Emanuel Borsboom Date: Tue, 8 Sep 2015 15:48:40 -0700 Subject: [PATCH] Out of memory warning if Cabal exits with -9 (#947) --- src/Stack/Types/Build.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Stack/Types/Build.hs b/src/Stack/Types/Build.hs index 55a7eab6f8..a8abae8c0b 100644 --- a/src/Stack/Types/Build.hs +++ b/src/Stack/Types/Build.hs @@ -75,7 +75,7 @@ import Stack.Types.Package import Stack.Types.PackageIdentifier import Stack.Types.PackageName import Stack.Types.Version -import System.Exit (ExitCode) +import System.Exit (ExitCode (ExitFailure)) import System.FilePath (dropTrailingPathSeparator, pathSeparator) ---------------------------------------------- @@ -235,6 +235,9 @@ instance Show StackBuildException where in "\n-- While building package " ++ dropQuotes (show taskProvides') ++ " using:\n" ++ " " ++ fullCmd ++ "\n" ++ " Process exited with code: " ++ show exitCode ++ + (if exitCode == ExitFailure (-9) + then " (THIS MAY INDICATE OUT OF MEMORY)" + else "") ++ logLocations ++ (if S.null bs then ""