crystal icon indicating copy to clipboard operation
crystal copied to clipboard

Ancillary compiler output prints to STDOUT

Open straight-shoota opened this issue 7 months ago • 1 comments

The compiler has some options that print ancillary information, such as --progress and --stats. They do currently print to STDOUT. But STDOUT is meant for the normal output of a program. Errors and diagnostics should go to STDERR. Warnings and errors for example already go to STDERR.

All similar functions such as --progress and --stats should print to STDERR instead of STDOUT.

One could argue that progress information could actually be considered the normal output of some compiler commands like crystal build. But that would not work when you consider features such as --cross-compile which prints a linker command to STDOUT. You wouldn't want that mixed with diagnostics output.

straight-shoota avatar Oct 31 '23 18:10 straight-shoota

More precisely they should go to Crystal::Compiler#stderr, and never to hardcoded references of the STDERR constant

HertzDevil avatar Oct 31 '23 19:10 HertzDevil