Opened 3 years ago

Closed 19 months ago

Last modified 12 months ago

#8796 closed bug (fixed)

-ddump-splices prints to error stream

Reported by: jstolarek Owned by: qnikst
Priority: normal Milestone: 8.0.1
Component: Compiler Version: 7.9
Keywords: newcomer Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D627
Wiki Page:


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.

Change History (11)

comment:1 Changed 3 years ago by simonpj

I doubt it is specifically intended. Do fix.


comment:2 Changed 3 years ago 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 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.

comment:3 follow-up: Changed 3 years ago 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 this SE question). At 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: and So it seems that there is demand for improvement.

comment:4 Changed 3 years ago by simonpj

I probably implemented this, and I don't think stdin/stderr was a conscious choice. Feel free to change it.


comment:5 in reply to: ↑ 3 Changed 22 months ago by jstolarek

  • Keywords newcomer added

Replying to nomeata:

Wasn’t there a ticket asking for more structured splice output, i.e. dumping it to a separate file


comment:6 Changed 22 months ago by jstolarek

Similarly, -dverbose-core2core prints some information on stdout and some on stderr. This could also be cleaned up.

comment:7 Changed 20 months ago by qnikst

  • Differential Rev(s) set to Phab:627
  • Owner set to qnikst

comment:8 Changed 20 months ago by thoughtpolice

  • Differential Rev(s) changed from Phab:627 to Phab:D627
  • Milestone set to 7.12.1

comment:9 Changed 19 months ago by Austin Seipp <austin@…>

In 73f976c47f00060baaeead9e0331ab265a84251c/ghc:

Make -ddump-splices output to stdout (fixes #8796)

Fixes debug output so all info messages will use
stdout. Fixes #8796.

Make -ddump-splices output to stdout (fixes #8796)
Make -dverbose-core2core use stdout (fixes #8796)

Reviewers: simonpj, austin

Reviewed By: austin

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #8796

comment:10 Changed 19 months ago by thoughtpolice

  • Resolution set to fixed
  • Status changed from new to closed

Merged, thanks!

comment:11 Changed 12 months ago by thoughtpolice

  • Milestone changed from 7.12.1 to 8.0.1

Milestone renamed

Note: See TracTickets for help on using tickets.