[GHC] #16167: -ddump-json output empty with runghc

#16167: -ddump-json output empty with runghc -------------------------------------+------------------------------------- Reporter: shmish111 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.4.3 Keywords: | Operating System: MacOS X Architecture: x86_64 | Type of failure: Incorrect (amd64) | error/warning at compile-time Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- If I create a haskell file called, for example, Main.hs which does not compile and run `ghc -ddump-json Main.hs` I will get a json formatted output after the error messages. This is a list of the errors, as expected. However if I run `runghc -ddump-json Main.hs` I get an empty list at the end `[]` -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16167 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16167: -ddump-json output empty with runghc -------------------------------------+------------------------------------- Reporter: shmish111 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Incorrect | (amd64) error/warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): Did you try with 8.6? Behaviour should be at least different due to fixing #14078. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16167#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16167: -ddump-json output empty with runghc -------------------------------------+------------------------------------- Reporter: shmish111 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Incorrect | (amd64) error/warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by shmish111): Interesting, with 8.6.3 there is no output at all, also `-ddump-json -ddump-to-file` does not produce a file (I guess that makes sense based on the fact that `-ddump-json` seems to not do anything. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16167#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16167: -ddump-json output empty with runghc -------------------------------------+------------------------------------- Reporter: shmish111 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Incorrect | (amd64) error/warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): With 8.6.2, {{{
ghc f.hs -fforce-recomp -ddump-json {"span": null,"doc": "Loaded package environment from /root/sql- haskell/.ghc.environment.x86_64-linux-8.6.2","severity": "SevInfo","reason": null} {"span": {"file": "f.hs","startLine": 1,"startCol": 8,"endLine": 1,"endCol": 9},"doc": "parse error on input \u2018f\u2019","severity": "SevError","reason": null} }}}
{{{
runghc f.hs -fforce-recomp -ddump-json Loaded package environment from /root/sql- haskell/.ghc.environment.x86_64-linux-8.6.2
f.hs:1:8: error: parse error on input ‘f’ | 1 | module f | }}} I'm not sure why `runghc` behaves differently. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16167#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16167: -ddump-json output empty with runghc -------------------------------------+------------------------------------- Reporter: shmish111 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.4.3 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Incorrect | (amd64) error/warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by shmish111): Ok, I seem to have narrowed it down to the `-e ":set prog Main.hs"` flag ``` [nix-shell:~]$ ghc --version The Glorious Glasgow Haskell Compilation System, version 8.4.4 [nix-shell:~]$ ghc -x hs -e ":set prog Main.hs" -ddump-json Main2.hs Main2.hs:4:8: error: • Variable not in scope: undefinedx :: IO () • Perhaps you meant ‘undefined’ (imported from Prelude) | 4 | main = undefinedx | ^^^^^^^^^^ [] ``` ``` [nix-shell:~]$ ghc --version The Glorious Glasgow Haskell Compilation System, version 8.6.3 [nix-shell:~]$ ghc -x hs -e ":set prog Main.hs" -ddump-json Main2.hs Main2.hs:4:8: error: • Variable not in scope: undefinedx :: IO () • Perhaps you meant ‘undefined’ (imported from Prelude) | 4 | main = undefinedx | ^^^^^^^^^^ ``` -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16167#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16167: -ddump-json doesn't work with -e -------------------------------------+------------------------------------- Reporter: shmish111 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Incorrect | (amd64) error/warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * keywords: => newcomer * version: 8.4.3 => 8.6.3 * os: MacOS X => Unknown/Multiple Comment: Ok, so it seems that `-ddump-json` doesn't work with `-e`. Shouldn't be too hard to fix if someone feels inclined. Thanks for narrowing it down. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16167#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC