[GHC] #10701: -fth-dec-file uses qualified names from hidden modules

#10701: -fth-dec-file uses qualified names from hidden modules -------------------------------------+------------------------------------- Reporter: Fabian | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Keywords: TH | Operating System: Unknown/Multiple Architecture: | Type of failure: Compile-time Unknown/Multiple | crash Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- In cross compilation builds, the current TH situation is a bit of a showstopper. However, much TH code is 'safe' to cross-compile. Before the TH situation is solved, it would be great if GHC could automate as much of the work-around process as possible. -dth-dec-file is a big step on the way to create a non-TH version of the source. However, there are some problems with the generated code. One is that qualified names from hidden modules are used. A instance declaration for Aeson.ToJSON is outputted as follows: {{{#!hs instance Data.Aeson.Types.Class.ToJSON InputDropboxFiles where }}} Ideally, GHC would be able to combine the splice output with the original file, replacing all $() with the corresponding splice, and even generate correct imports. I personally think this would be a great solution to the TH problem. Most cross-compilation projects could just generate the non-TH version with the host GHC, and the few that depends on architecture specific variables can be edited before cross-compiled -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10701 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10701: -fth-dec-file uses qualified names from hidden modules -------------------------------------+------------------------------------- Reporter: Fabian | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: TH Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thomie): Fabian: I think I read you have a list of issues to report, hence I'm mentioning the following; For all bug reports, please attach or copy-paste a small program (as small as possible is best) that demonstrates the bug you found, including the instructions to compile and run it. This saves us time constructing it ourselves, and we can put it in the testsuite later. See [wiki:ReportABug#Fulldescription:whatinformationtoprovideinthebodyofyourbugreport]. Thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10701#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10701: -fth-dec-file uses qualified names from hidden modules -------------------------------------+------------------------------------- Reporter: Fabian | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by Fabian): * keywords: TH => -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10701#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

Fabian: I think I read you have a list of issues to report, hence I'm mentioning the following;
For all bug reports, please attach or copy-paste a small program (as small as possible is best) that demonstrates the bug you found, including
#10701: -fth-dec-file uses qualified names from hidden modules -------------------------------------+------------------------------------- Reporter: Fabian | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Fabian): Replying to [comment:1 thomie]: the instructions to compile and run it. This saves us time constructing it ourselves, and we can put it in the testsuite later. See [wiki:ReportABug#Fulldescription:whatinformationtoprovideinthebodyofyourbugreport]. Thanks!
I'll put together a test case tomorrow and add it to the ticket -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10701#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10701: -fth-dec-file uses qualified names from hidden modules -------------------------------------+------------------------------------- Reporter: Fabian | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by Fabian): * Attachment "Test10702.hs" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10701 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10701: -fth-dec-file uses qualified names from hidden modules -------------------------------------+------------------------------------- Reporter: Fabian | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * component: Compiler => Template Haskell -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10701#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10701: -fth-dec-file uses qualified names from hidden modules -------------------------------------+------------------------------------- Reporter: Fabian | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Template Haskell | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * milestone: => 7.12.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10701#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10701: -fth-dec-file uses qualified names from hidden modules -------------------------------------+------------------------------------- Reporter: Fabian | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Template Haskell | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * cc: GregWeber (added) Comment: Fabian: did you add the right test here (filename makes it appear it is for a different ticket)? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10701#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10701: -fth-dec-file uses qualified names from hidden modules -------------------------------------+------------------------------------- Reporter: Fabian | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Template Haskell | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Fabian): Replying to [comment:6 thomie]:
Fabian: did you add the right test here (filename makes it appear it is for a different ticket)?
Yes it's the right file. I made one for several tickets. I have updated all tickets with a new file without the dependency on aeson, and with ddump-splices output included -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10701#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC