Commit 6696ad57 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Print exit code and stderr for failing progs at debug level verbosity

Also adjust the verbosity level we get during configure at -v3
Should make it a bit easier to track down failing calls.
parent 313f50cc
......@@ -296,7 +296,10 @@ rawSystemExit :: Verbosity -> FilePath -> [String] -> IO ()
rawSystemExit verbosity path args = do
printRawCommandAndArgs verbosity path args
hFlush stdout
maybeExit $ rawSystem path args
exitcode <- rawSystem path args
unless (exitcode == ExitSuccess) $ do
debug verbosity $ path ++ " returned " ++ show exitcode
exitWith exitcode
-- | Run a command and return its output.
--
......@@ -335,6 +338,10 @@ rawSystemStdout' verbosity path args = do
-- wait for the program to terminate
exitcode <- waitForProcess pid
unless (exitcode == ExitSuccess) $
debug verbosity $ path ++ " returned " ++ show exitcode
++ if null err then "" else
" with error message:\n" ++ err
return (output, exitcode)
#else
......@@ -343,6 +350,8 @@ rawSystemStdout' verbosity path args = do
hClose tmpHandle
let quote name = "'" ++ name ++ "'"
exitCode <- system $ unwords (map quote (path:args)) ++ " >" ++ quote tmpName
unless (exitcode == ExitSuccess) $
debug verbosity $ path ++ " returned " ++ show exitcode
output <- readFile tmpName
length output `seq` return (output, exitCode)
#endif
......
......@@ -79,7 +79,7 @@ moreVerbose Verbose = Deafening
moreVerbose Deafening = Deafening
lessVerbose :: Verbosity -> Verbosity
lessVerbose Deafening = Verbose
lessVerbose Deafening = Deafening
lessVerbose Verbose = Normal
lessVerbose Normal = Silent
lessVerbose Silent = Silent
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment