[GHC] #10021: Add "Error:" prefix for error-messages

#10021: Add "Error:" prefix for error-messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: Type: feature | Status: new request | Milestone: 7.12.1 Priority: normal | Version: 7.8.4 Component: Compiler | Operating System: Unknown/Multiple Keywords: | Type of failure: None/Unknown Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Similar to what we have for "Warning:". E.g., we have: {{{ ➜ cat test.hs main = putStrLn "Hello!" ➜ ghc --make -fforce-recomp -Wall ./test.hs [1 of 1] Compiling Main ( test.hs, test.o ) test.hs:1:1: Warning: Top-level binding with no type signature: main :: IO () Linking test ... ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o ) test2.hs:1:8: Not in scope: ‘foo’ }}} And I propose having: {{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o ) test2.hs:1:8: Error: Not in scope: ‘foo’ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for error-messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): You don't motivate the change. Could you update the Description to explain why this would be a good change to make. Are there any disadvantages? Presuambly ever `should_fail` test in GHC's regression suite, and every other library's regression suite, would need to be updated, which would be a nuisance. If there's a consensus in favour, I'm happy for this to happen. It should also be easy to implement. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for error-messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by k-bx: Old description:
Similar to what we have for "Warning:".
E.g., we have:
{{{ ➜ cat test.hs main = putStrLn "Hello!" ➜ ghc --make -fforce-recomp -Wall ./test.hs [1 of 1] Compiling Main ( test.hs, test.o )
test.hs:1:1: Warning: Top-level binding with no type signature: main :: IO () Linking test ... ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o )
test2.hs:1:8: Not in scope: ‘foo’ }}}
And I propose having:
{{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o )
test2.hs:1:8: Error: Not in scope: ‘foo’ }}}
New description: Similar to what we have for "Warning:". E.g., we have: {{{ ➜ cat test.hs main = putStrLn "Hello!" ➜ ghc --make -fforce-recomp -Wall ./test.hs [1 of 1] Compiling Main ( test.hs, test.o ) test.hs:1:1: Warning: Top-level binding with no type signature: main :: IO () Linking test ... ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o ) test2.hs:1:8: Not in scope: ‘foo’ }}} And I propose having: {{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o ) test2.hs:1:8: Error: Not in scope: ‘foo’ }}} == Motivation == Main motivation point right now is that there's a ticket #9219 (parallel build's output of errors doesn't occur at the end of output), due to which, error-reporting of your program might get lost somewhere in the middle of a build-log. As another example, if your program has a lot of warnings, and you build it with multiple cores, you almost always get an error lost somewhere in the middle of warnings and it's almost impossible to find. So, this feature's main purpose is to ease navigation in textual output of ghc in order to find errors quickly, not being tied to output ordering. == Disadvantages == Many regression tests might need a fix. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for error-messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by k-bx): @simonpj added motivation and disadvantages sections. Waiting for more input on mailing list for now and started digging into ghc ecosystem (e.g. was fighting few `sh validate` errors). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for error-messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by simonpj: Old description:
Similar to what we have for "Warning:".
E.g., we have:
{{{ ➜ cat test.hs main = putStrLn "Hello!" ➜ ghc --make -fforce-recomp -Wall ./test.hs [1 of 1] Compiling Main ( test.hs, test.o )
test.hs:1:1: Warning: Top-level binding with no type signature: main :: IO () Linking test ... ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o )
test2.hs:1:8: Not in scope: ‘foo’ }}}
And I propose having:
{{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o )
test2.hs:1:8: Error: Not in scope: ‘foo’ }}}
== Motivation ==
Main motivation point right now is that there's a ticket #9219 (parallel build's output of errors doesn't occur at the end of output), due to which, error-reporting of your program might get lost somewhere in the middle of a build-log. As another example, if your program has a lot of warnings, and you build it with multiple cores, you almost always get an error lost somewhere in the middle of warnings and it's almost impossible to find.
So, this feature's main purpose is to ease navigation in textual output of ghc in order to find errors quickly, not being tied to output ordering.
== Disadvantages ==
Many regression tests might need a fix.
New description: Similar to what we have for "Warning:". E.g., we have: {{{ ➜ cat test.hs main = putStrLn "Hello!" ➜ ghc --make -fforce-recomp -Wall ./test.hs [1 of 1] Compiling Main ( test.hs, test.o ) test.hs:1:1: Warning: Top-level binding with no type signature: main :: IO () Linking test ... ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o ) test2.hs:1:8: Not in scope: ‘foo’ }}} And I propose having: {{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o ) test2.hs:1:8: Error: Not in scope: ‘foo’ }}} This proposal only affects error messages produced by GHC itself. For example, the behaviour of the `error` function is unaffected. == Motivation == Main motivation point right now is that there's a ticket #9219 (parallel build's output of errors doesn't occur at the end of output), due to which, error-reporting of your program might get lost somewhere in the middle of a build-log. As another example, if your program has a lot of warnings, and you build it with multiple cores, you almost always get an error lost somewhere in the middle of warnings and it's almost impossible to find. So, this feature's main purpose is to ease navigation in textual output of ghc in order to find errors quickly, not being tied to output ordering. == Disadvantages == Many regression tests might need a fix. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for error-messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by hvr): I'd like to propose to change the case of `Error` and `Warning` to lower case to match the convention as used by the most popular C/C++-compilers these days. For reference, this is what `gcc` currently does: {{{ $ gcc -Wall -c foo.c foo.c: In function ‘main’: foo.c:2:1: warning: control reaches end of non-void function [-Wreturn- type] int main() { } ^ }}} {{{ $ gcc -Wall -Werror -c foo.c foo.c: In function ‘main’: foo.c:2:1: error: control reaches end of non-void function [-Werror =return-type] int main() { } ^ cc1: all warnings being treated as errors }}} and here's what `clang` does: {{{ $ clang-3.5 -Wall -c foo.c foo.c:2:18: warning: unused variable 'x' [-Wunused-variable] int main() { int x = 0; } ^ 1 warning generated. }}} {{{ $ clang-3.5 -Wall -Werror -c foo.c foo.c:2:18: error: unused variable 'x' [-Werror,-Wunused-variable] int main() { int x = 0; } ^ 1 error generated. }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for compile-time error messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by k-bx: Old description:
Similar to what we have for "Warning:".
E.g., we have:
{{{ ➜ cat test.hs main = putStrLn "Hello!" ➜ ghc --make -fforce-recomp -Wall ./test.hs [1 of 1] Compiling Main ( test.hs, test.o )
test.hs:1:1: Warning: Top-level binding with no type signature: main :: IO () Linking test ... ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o )
test2.hs:1:8: Not in scope: ‘foo’ }}}
And I propose having:
{{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o )
test2.hs:1:8: Error: Not in scope: ‘foo’ }}}
This proposal only affects error messages produced by GHC itself. For example, the behaviour of the `error` function is unaffected.
== Motivation ==
Main motivation point right now is that there's a ticket #9219 (parallel build's output of errors doesn't occur at the end of output), due to which, error-reporting of your program might get lost somewhere in the middle of a build-log. As another example, if your program has a lot of warnings, and you build it with multiple cores, you almost always get an error lost somewhere in the middle of warnings and it's almost impossible to find.
So, this feature's main purpose is to ease navigation in textual output of ghc in order to find errors quickly, not being tied to output ordering.
== Disadvantages ==
Many regression tests might need a fix.
New description: The proposal is to modify GHC compile-time output for error-messages, by adding a prefix, similar to what we currently have for warnings. An example of a warning message (see `Warning:` prefix): {{{ ➜ cat test.hs main = putStrLn "Hello!" ➜ ghc --make -fforce-recomp -Wall ./test.hs [1 of 1] Compiling Main ( test.hs, test.o ) test.hs:1:1: Warning: Top-level binding with no type signature: main :: IO () Linking test ... }}} An example of current output for an error: {{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o ) test2.hs:1:8: Not in scope: ‘foo’ }}} The proposal is to change it to become: {{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o ) test2.hs:1:8: Error: Not in scope: ‘foo’ }}} This proposal only affects error messages produced by GHC itself. For example, the behaviour of the `error` function is unaffected. == Motivation == Main motivation point right now is that there's a ticket #9219 (parallel build's output of errors doesn't occur at the end of output), due to which, error-reporting of your program might get lost somewhere in the middle of a build-log. As another example, if your program has a lot of warnings, and you build it with multiple cores, you almost always get an error lost somewhere in the middle of warnings and it's almost impossible to find. So, this feature's main purpose is to ease navigation in textual output of ghc in order to find errors quickly, not being tied to output ordering. == Disadvantages == Many regression tests might need a fix. == Additional consideration == @hvr proposed that during work on this bug we could make GHC output more consistent with other compiler's (GCC and clang) by also lower-casing "Error" and "Warning" prefixes. This might be potentially useful for existing tools that work on top of compiler output for finding errors/warning, and GHC's output will become "more valid" for them. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for compile-time error messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by k-bx): @hvr while Emacs compilation highliter (the one that lets you navigate through errors after `M-x compile`) is smart enough to understand current GHC output, I would say that lower-casing might be useful for other similar tools that work on top of compiler's output and are hard-coded for GCC/clang lower-cased "error" and "warning", so +1 from me on this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for compile-time error messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by spl): * cc: sean.leather@… (added) Old description:
The proposal is to modify GHC compile-time output for error-messages, by adding a prefix, similar to what we currently have for warnings.
An example of a warning message (see `Warning:` prefix):
{{{ ➜ cat test.hs main = putStrLn "Hello!" ➜ ghc --make -fforce-recomp -Wall ./test.hs [1 of 1] Compiling Main ( test.hs, test.o )
test.hs:1:1: Warning: Top-level binding with no type signature: main :: IO () Linking test ... }}}
An example of current output for an error:
{{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o )
test2.hs:1:8: Not in scope: ‘foo’ }}}
The proposal is to change it to become:
{{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o )
test2.hs:1:8: Error: Not in scope: ‘foo’ }}}
This proposal only affects error messages produced by GHC itself. For example, the behaviour of the `error` function is unaffected.
== Motivation ==
Main motivation point right now is that there's a ticket #9219 (parallel build's output of errors doesn't occur at the end of output), due to which, error-reporting of your program might get lost somewhere in the middle of a build-log. As another example, if your program has a lot of warnings, and you build it with multiple cores, you almost always get an error lost somewhere in the middle of warnings and it's almost impossible to find.
So, this feature's main purpose is to ease navigation in textual output of ghc in order to find errors quickly, not being tied to output ordering.
== Disadvantages ==
Many regression tests might need a fix.
== Additional consideration ==
@hvr proposed that during work on this bug we could make GHC output more consistent with other compiler's (GCC and clang) by also lower-casing "Error" and "Warning" prefixes.
This might be potentially useful for existing tools that work on top of compiler output for finding errors/warning, and GHC's output will become "more valid" for them.
New description: We propose adding the prefix `Error:` to compile-time error messages produced by GHC. An example of a warning message (see `Warning:` prefix): {{{ ➜ cat test.hs main = putStrLn "Hello!" ➜ ghc --make -fforce-recomp -Wall ./test.hs [1 of 1] Compiling Main ( test.hs, test.o ) test.hs:1:1: Warning: Top-level binding with no type signature: main :: IO () Linking test ... }}} An example of a current error message: {{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o ) test2.hs:1:8: Not in scope: ‘foo’ }}} The proposal is to change the error message to become: {{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o ) test2.hs:1:8: Error: Not in scope: ‘foo’ }}} This change affects only the error messages produced by GHC when compiling. It does not change runtime error reporting, e.g. with the `error` function. == Motivation == We wish to make compile-time error messages easier for humans and computers to identify. For example, when running a long parallel build, it can be easy to miss an error message (see #9219 for an example). With a known string such as `Error:`, we can use search functionality in a terminal window or text editor (when viewing the build log) or use a command-line tool such as `grep` (when streaming and filtering the build log) to quickly find errors. As a secondary motivation, adding `Error:` for error messages brings a nice symmetry to the current use of `Warning:` for warning messages. == Disadvantages == The output of many regression tests will need to be updated for the new error message format. == Additional consideration == @hvr proposed that during work on this bug we could make GHC output more consistent with other compiler's (GCC and clang) by also lower-casing "Error" and "Warning" prefixes. This might be potentially useful for existing tools that work on top of compiler output for finding errors/warning, and GHC's output will become "more valid" for them. -- Comment: I modified the ticket description in an attempt to be more clear about the proposal and to expand the motivation. P.S. I'm heavily in favor of this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for compile-time error messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by spl: Old description:
We propose adding the prefix `Error:` to compile-time error messages produced by GHC.
An example of a warning message (see `Warning:` prefix):
{{{ ➜ cat test.hs main = putStrLn "Hello!" ➜ ghc --make -fforce-recomp -Wall ./test.hs [1 of 1] Compiling Main ( test.hs, test.o )
test.hs:1:1: Warning: Top-level binding with no type signature: main :: IO () Linking test ... }}}
An example of a current error message:
{{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o )
test2.hs:1:8: Not in scope: ‘foo’ }}}
The proposal is to change the error message to become:
{{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o )
test2.hs:1:8: Error: Not in scope: ‘foo’ }}}
This change affects only the error messages produced by GHC when compiling. It does not change runtime error reporting, e.g. with the `error` function.
== Motivation ==
We wish to make compile-time error messages easier for humans and computers to identify. For example, when running a long parallel build, it can be easy to miss an error message (see #9219 for an example). With a known string such as `Error:`, we can use search functionality in a terminal window or text editor (when viewing the build log) or use a command-line tool such as `grep` (when streaming and filtering the build log) to quickly find errors.
As a secondary motivation, adding `Error:` for error messages brings a nice symmetry to the current use of `Warning:` for warning messages.
== Disadvantages ==
The output of many regression tests will need to be updated for the new error message format.
== Additional consideration ==
@hvr proposed that during work on this bug we could make GHC output more consistent with other compiler's (GCC and clang) by also lower-casing "Error" and "Warning" prefixes.
This might be potentially useful for existing tools that work on top of compiler output for finding errors/warning, and GHC's output will become "more valid" for them.
New description: We propose adding the prefix `Error:` to compile-time error messages produced by GHC. An example of a warning message (see `Warning:` prefix): {{{ ➜ cat test.hs main = putStrLn "Hello!" ➜ ghc --make -fforce-recomp -Wall ./test.hs [1 of 1] Compiling Main ( test.hs, test.o ) test.hs:1:1: Warning: Top-level binding with no type signature: main :: IO () Linking test ... }}} An example of a current error message: {{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o ) test2.hs:1:8: Not in scope: ‘foo’ }}} The proposal is to change the error message to become: {{{ ➜ cat test2.hs main = foo ➜ ghc --make -fforce-recomp -Wall ./test2.hs [1 of 1] Compiling Main ( test2.hs, test2.o ) test2.hs:1:8: Error: Not in scope: ‘foo’ }}} This change affects only the error messages produced by GHC when compiling. It does not change runtime error reporting, e.g. with the `error` function. == Motivation == We wish to make compile-time error messages easier for humans and computers to identify. For example, when running a long parallel build, it can be easy to miss an error message (see #9219 for an example). With a known string such as `Error:`, we can use search functionality in a terminal window or text editor (when viewing the build log) or use a command-line tool such as `grep` (when streaming and filtering the build log) to quickly find errors. As a secondary motivation, adding `Error:` for error messages brings a nice symmetry to the current use of `Warning:` for warning messages. == Disadvantages == The output of many regression tests will need to be updated for the new error message format. == Additional consideration == @hvr [comment:5 suggested] that during work on this bug we could make GHC output more consistent with other compilers (GCC and clang) by using lowercase `error:` and `warning:` prefixes. This might be potentially useful for existing tools that work on top of compiler output for finding errors/warning, and GHC's output will become "more valid" for them. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for compile-time error messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by k-bx): One more thing to consider. Current severities are: {{{ data Severity = SevOutput | SevDump | SevInteractive | SevInfo | SevWarning | SevError | SevFatal }}} For severity `SevFatal`, would it make sense to output `fatal: <msg>`, stick to `error: <msg>`, or just keep it as it is right now? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for compile-time error messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Yes, it's horrible that these seven (''seven''!) levels of severity are declared in a data type with no comment whatsoever to indicate what the author had in mind. One can guess from the names but it still seems like a huge omission. I have no opinion about `fatal` vs `error` for `SevFatal`. I'm inclined to the former, since it reflects the underlying truth. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for compile-time error messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by spl): Having not looked at the code, I'm not even sure how output, dump, and interactive (to say the least) are cases of severity. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for compile-time error messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: k-bx Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by k-bx): * owner: => k-bx -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for compile-time error messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: k-bx Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by k-bx): Just wanted to update a little on my work. I had one week off and will have one more now, so things are slower than I wanted, otherwise here are how things going: I wrote two scripts to help me working on this issue. First is turtle- replace-stdout.hs, second is turtle-review.hs. Here they are: https://gist.github.com/k-bx/fe7027c919980eb9b7f0 When you run first one, it will replace (almost) all failed test's actual output with expected one. Afterwards, you should run second script, which will review trivial cases and git-add them. Finally, the ones that are left were reviewed manually. Currently status is that few tests still fail upon validate, and few will probably become failing after rebase. Anyway, will finish the work quickly after I come back from Norway. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for compile-time error messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: k-bx Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thomie):
I wrote two scripts to help me working on this issue. First is turtle- replace-stdout.hs, second is turtle-review.hs. Here they are: https://gist.github.com/k-bx/fe7027c919980eb9b7f0
I haven't look at your script in detail, but are you aware of [Building/RunningTests/Updating make accept]? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for compile-time error messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: k-bx Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by k-bx): @thomie thanks, haven't been aware of it at all. Will check it out! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for compile-time error messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: k-bx Type: feature request | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thomie): If you're going to run that on the full testsuite, make sure you install these [Building/RunningTests/Running#AdditionalPackages packages] with the inplace compiler. Otherwise some tests get skipped. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10021: Add "Error:" prefix for compile-time error messages
-------------------------------------+-------------------------------------
Reporter: k-bx | Owner: k-bx
Type: feature request | Status: new
Priority: normal | Milestone: 7.12.1
Component: Compiler | Version: 7.8.4
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#10021: Add "Error:" prefix for compile-time error messages -------------------------------------+------------------------------------- Reporter: k-bx | Owner: k-bx Type: feature request | Status: closed Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.8.4 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by k-bx): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10021#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC