[GHC] #8796: -ddump-splices prints to error stream

#8796: -ddump-splices prints to error stream -------------------------------------------+------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Easy (less than 1 hour) | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: -------------------------------------------+------------------------------- I just noticed that unlike other dump flags, `-ddump-splices` dumps to the error stream. I don't think this difference in behaviour is intended. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8796 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8796: -ddump-splices prints to error stream -------------------------------+------------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | -------------------------------+------------------------------------------- Comment (by simonpj): I doubt it is specifically intended. Do fix. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8796#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8796: -ddump-splices prints to error stream -------------------------------+------------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | -------------------------------+------------------------------------------- Comment (by jstolarek): I looked at the code responsible for this and it seems that this was a concious decision (not sure if correct one). Code is in [[GhcFile(typecheck/TcRnMonad.lhs)]]. There's `dumpTcRn` function which uses `printInfoForUser` to print to `stderr` (`printOutputForUser` would print to `stdout`). `dumpTcRn` is used as a backend for dumping renamer and typechecker traces as well as TH splices. Now I'm not sure if all of this should be printed on stdout or just the TH splices? It seems strange to me that stderr is used as an output for more detailed debugging information. I feel this is not the intent for stderr. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8796#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8796: -ddump-splices prints to error stream -------------------------------+------------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | -------------------------------+------------------------------------------- Comment (by nomeata): Wasn’t there a ticket asking for more structured splice output, i.e. dumping it to a separate file, with precise origin information, basically everything needed to write a tool that reliably replaces the TH code by the splice... Currenlty I only find #5016, which is about getting the dump closer to valid Haskell (also see [http://stackoverflow.com/questions/12169093/can-i -rely-on-template-haskell-expansion-using-ddump-splices-to-always-genera this SE question]). At http://stackoverflow.com/a/15851260/946226 people are surprised that it is dumped to stderr, and not to a file. And there are two tools doing this splace-replacement-thingy already: https://joeyh.name/blog/entry/Template_Haskell_on_impossible_architectures/ and http://hackage.haskell.org/package/zeroth. So it seems that there is demand for improvement. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8796#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8796: -ddump-splices prints to error stream -------------------------------+------------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | -------------------------------+------------------------------------------- Comment (by simonpj): I probably implemented this, and I don't think stdin/stderr was a conscious choice. Feel free to change it. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8796#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8796: -ddump-splices prints to error stream -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: | hour) None/Unknown | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by jstolarek): * keywords: => newcomer Comment: Replying to [comment:3 nomeata]:
Wasn’t there a ticket asking for more structured splice output, i.e. dumping it to a separate file #8624
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8796#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8796: -ddump-splices prints to error stream -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: | hour) None/Unknown | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by jstolarek): Similarly, `-dverbose-core2core` prints some information on stdout and some on stderr. This could also be cleaned up. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8796#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8796: -ddump-splices prints to error stream -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: qnikst Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:627 -------------------------------------+------------------------------------- Changes (by qnikst): * owner: => qnikst * differential: => Phab:627 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8796#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8796: -ddump-splices prints to error stream -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: qnikst Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.9 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D627 -------------------------------------+------------------------------------- Changes (by thoughtpolice): * differential: Phab:627 => Phab:D627 * milestone: => 7.12.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8796#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8796: -ddump-splices prints to error stream
-------------------------------------+-------------------------------------
Reporter: jstolarek | Owner: qnikst
Type: bug | Status: new
Priority: normal | Milestone: 7.12.1
Component: Compiler | Version: 7.9
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions: Phab:D627
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#8796: -ddump-splices prints to error stream -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: qnikst Type: bug | Status: closed Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.9 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D627 -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: new => closed * resolution: => fixed Comment: Merged, thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8796#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC