-
Notifications
You must be signed in to change notification settings - Fork 701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use stderr for Cabal's diagnostic messages instead of stdout #4789
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ import Distribution.Utils.Progress | |
import Distribution.Verbosity | ||
import Distribution.Simple.Utils | ||
import Text.PrettyPrint | ||
import System.IO (hPutStrLn, stderr) | ||
|
||
type CtxMsg = Doc | ||
type LogMsg = Doc | ||
|
@@ -54,7 +55,7 @@ runLogProgress verbosity (LogProgress m) = | |
} | ||
step_fn :: LogMsg -> NoCallStackIO a -> NoCallStackIO a | ||
step_fn doc go = do | ||
putStrLn (render doc) | ||
hPutStrLn stderr (render doc) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could be replaced with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reverted this particular change. Changing |
||
go | ||
fail_fn :: Doc -> NoCallStackIO a | ||
fail_fn doc = do | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only do this for GHC? Perhaps it should be the default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure. Do these other programs write non-essential messages to stdout? I think the use of stdout for progress messages as GHC does is not normal, but I suppose Cabal could be proactive and force everything to stderr.