[GHC] #10895: "no output will be generated" should be an error, not a warning.
#10895: "no output will be generated" should be an error, not a warning. -------------------------------------+------------------------------------- Reporter: gershomb | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Incorrect Unknown/Multiple | warning at compile-time Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- Consider a file "Test.hs" which has a "main" function but is declared as "module Test where..." If we attempt to compile it, we get the following warning: {{{ Warning: output was redirected with -o, but no output will be generated because there is no Main module. }}} This should be upgraded from a warning to an error. This would help e.g. Cabal, because such warnings do not lead to a failure of the wrapping Cabal process, which is confusing to end-users. For gory details, see e.g. discussion at https://github.com/haskell/cabal/issues/1847 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10895> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10895: "no output will be generated" should be an error, not a warning. -------------------------------------+------------------------------------- Reporter: gershomb | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): Attempt to compile it how? Obviously `ghc Test` will not warn, and will just produce an object file. I guess you mean `ghc Test -o foo`? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10895#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10895: "no output will be generated" should be an error, not a warning. -------------------------------------+------------------------------------- Reporter: gershomb | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Description changed by gershomb: Old description:
Consider a file "Test.hs" which has a "main" function but is declared as "module Test where..."
If we attempt to compile it, we get the following warning:
{{{ Warning: output was redirected with -o, but no output will be generated because there is no Main module. }}}
This should be upgraded from a warning to an error. This would help e.g. Cabal, because such warnings do not lead to a failure of the wrapping Cabal process, which is confusing to end-users.
For gory details, see e.g. discussion at https://github.com/haskell/cabal/issues/1847
New description: Consider a file "Test.hs" which has a "main" function but is declared as "module Test where..." If we attempt to compile it with for example "ghc --make Test.hs -o Test", we get the following warning: {{{ Warning: output was redirected with -o, but no output will be generated because there is no Main module. }}} This should be upgraded from a warning to an error. This would help e.g. Cabal, because such warnings do not lead to a failure of the wrapping Cabal process, which is confusing to end-users. For gory details, see e.g. discussion at https://github.com/haskell/cabal/issues/1847 -- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10895#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10895: "no output will be generated" should be an error, not a warning. -------------------------------------+------------------------------------- Reporter: gershomb | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by gershomb): Yep, ticket amended to indicate. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10895#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10895: "no output will be generated" should be an error, not a warning. -------------------------------------+------------------------------------- Reporter: gershomb | Owner: Type: bug | Status: patch Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1253 -------------------------------------+------------------------------------- Changes (by thomie): * status: new => patch * differential: => Phab:D1253 * milestone: => 8.0.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10895#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10895: "no output will be generated" should be an error, not a warning. -------------------------------------+------------------------------------- Reporter: gershomb | Owner: Type: bug | Status: patch Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1253 -------------------------------------+------------------------------------- Comment (by Thomas Miedema <thomasmiedema@…>): In [changeset:"1637e4d16d28223aac66100cf7308d76a2a7ee7c/ghc" 1637e4d/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="1637e4d16d28223aac66100cf7308d76a2a7ee7c" Driver: --make -o without Main should be an error (#10895) Reviewed by: austin Differential Revision: https://phabricator.haskell.org/D1253 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10895#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10895: "no output will be generated" should be an error, not a warning. -------------------------------------+------------------------------------- Reporter: gershomb | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Incorrect | Test Case: warning at compile-time | driver/should_fail/T10895 Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D1253 -------------------------------------+------------------------------------- Changes (by thomie): * status: patch => closed * testcase: => driver/should_fail/T10895 * resolution: => fixed Comment: Thanks for the suggestion. Should be fixed in ghc-8. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10895#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC