Commit f48da184 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Add verboseCommands predicate to show executed commands in full when needed.

parent 304b0999
......@@ -16,13 +16,16 @@ buildWithResources rs target = do
needBuilder laxDependencies builder
path <- builderPath builder
argList <- interpret target getArgs
verbose <- interpret target verboseCommands
let quitelyUnlessVerbose = if verbose then withVerbosity Loud else quietly
-- The line below forces the rule to be rerun if the args hash has changed
checkArgsHash target
withResources rs $ do
putBuild $ "/--------\n| Running " ++ show builder ++ " with arguments:"
mapM_ (putBuild . ("| " ++)) $ interestingInfo builder argList
putBuild $ "\\--------"
quietly $ case builder of
unless verbose $ do
putBuild $ "/--------\n| Running " ++ show builder ++ " with arguments:"
mapM_ (putBuild . ("| " ++)) $ interestingInfo builder argList
putBuild $ "\\--------"
quitelyUnlessVerbose $ case builder of
Ar -> arCmd path argList
HsCpp -> do
......
......@@ -2,7 +2,8 @@ module Settings.User (
userArgs, userPackages, userLibWays, userRtsWays, userTargetDirectory,
userProgramPath, userKnownPackages, integerLibrary,
trackBuildSystem, buildHaddock, validating, ghciWithDebugger, ghcProfiled,
ghcDebugged, dynamicGhcPrograms, laxDependencies, buildSystemConfigFile
ghcDebugged, dynamicGhcPrograms, laxDependencies, buildSystemConfigFile,
verboseCommands
) where
import Expression
......@@ -81,3 +82,9 @@ buildHaddock = return True
buildSystemConfigFile :: Bool
buildSystemConfigFile = False
-- Set to True to print full command lines during the build process. Note, this
-- is a Predicate, hence you can enable verbose output for a chosen package
-- only, e.g.: verboseCommands = package ghcPrim
verboseCommands :: Predicate
verboseCommands = return False
Markdown is supported
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