[GHC] #13342: Core Lint warnings are emitted on stdout rather than stderr

#13342: Core Lint warnings are emitted on stdout rather than stderr -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- It seems that they should be outputted on stderr like other warnings. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13342 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13342: Core Lint warnings are emitted on stdout rather than stderr -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * keywords: => newcomer -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13342#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13342: Core Lint warnings are emitted on stdout rather than stderr -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): Here is an easy way to reproduce the problem. You need a compiler compiled with `-DDEBUG` (build flavour devel2 is easiest) and then `inplace/bin/ghc-stage2 -dcore-lint A.hs` {{{ module A where f :: [()] -> [()] f (x:xs) = x : f xs {-# INLINE f #-} }}} {{{ [1 of 1] Compiling A ( cltest.hs, cltest.o ) *** Core Lint warnings : in result of Occurrence analysis *** cltest.hs:4:1: warning: [RHS of f :: [()] -> [()]] INLINE binder is (non-rule) loop breaker: f *** Core Lint warnings : in result of Simplifier *** cltest.hs:4:1: warning: [RHS of f :: [()] -> [()]] INLINE binder is (non-rule) loop breaker: f *** Core Lint warnings : in result of Occurrence analysis *** cltest.hs:4:1: warning: [RHS of f :: [()] -> [()]] INLINE binder is (non-rule) loop breaker: f *** Core Lint warnings : in result of Simplifier *** cltest.hs:4:1: warning: [RHS of f :: [()] -> [()]] INLINE binder is (non-rule) loop breaker: f *** Core Lint warnings : in result of Tidy Core *** cltest.hs:4:1: warning: [RHS of f :: [()] -> [()]] INLINE binder is (non-rule) loop breaker: f *** Core Lint warnings : in result of CorePrep *** cltest.hs:4:1: warning: [RHS of f :: [()] -> [()]] INLINE binder is (non-rule) loop breaker: f }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13342#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13342: Core Lint warnings are emitted on stdout rather than stderr -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by ThreeFx): Just a note: The culprit seems to be `displayLintResults` in `compiler/coreSyn/CoreLint.hs`. Using `log_action` with the severity `SevDump` writes the given text to `stdout`. By changing this to `SevWarning` it is written to `stderr` instead, although the error message is worse than before because it is even more redundant: {{{ <no location info>: warning: *** Core Lint warnings : in result of Occurrence analysis *** test.hs:4:1: warning: [RHS of f :: [()] -> [()]] INLINE binder is (non-rule) loop breaker: f }}} Since linting `Core` is a compiler developer thing 99% of the time, IMO it is more important to print concise and clear error messages/warnings than to write to the correct output (the first line overshadows the linting error). But these are just my 2 cents. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13342#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13342: Core Lint warnings are emitted on stdout rather than stderr -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): I think printing to the correct output is out primary importance here. If you don't interleave outputs and only inspect `stderr` for errors then you will not see these warnings. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13342#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13342: Core Lint warnings are emitted on stdout rather than stderr -------------------------------------+------------------------------------- Reporter: mpickering | Owner: ThreeFx Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by ThreeFx): * owner: (none) => ThreeFx -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13342#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13342: Core Lint warnings are emitted on stdout rather than stderr -------------------------------------+------------------------------------- Reporter: mpickering | Owner: ThreeFx Type: bug | Status: patch Priority: low | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by ThreeFx): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13342#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13342: Core Lint warnings are emitted on stdout rather than stderr
-------------------------------------+-------------------------------------
Reporter: mpickering | Owner: ThreeFx
Type: bug | Status: patch
Priority: low | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Matthew Pickering

#13342: Core Lint warnings are emitted on stdout rather than stderr -------------------------------------+------------------------------------- Reporter: mpickering | Owner: ThreeFx Type: bug | Status: closed Priority: low | Milestone: Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13342#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC