[GHC] #13237: Extend TH with addModCStub

GHC ghc-devs at haskell.org
Fri Feb 10 16:32:55 UTC 2017


#13237: Extend TH with addModCStub
-------------------------------------+-------------------------------------
        Reporter:                    |                Owner:
  facundo.dominguez                  |  facundo.dominguez
            Type:  feature request   |               Status:  patch
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Template Haskell  |              Version:  8.0.1
      Resolution:                    |             Keywords:  inline-c
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D3106
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by facundo.dominguez):

 As far as I've tested, changing spaces in irrelevant places, forces
 recompilation of files which import the module when the files use TH.

 I'd say in the current state of affairs there is no danger of ignoring a
 change, but rather unnecessary recompilation might happen.

 Regarding the possibility of includes in the C code which changes, it
 won't be detected in the same way that reading a file with `runIO` isn't
 detected. For this cases, there is
 [https://www.stackage.org/haddock/lts-7.19/template-haskell-2.11.0.0
 /Language-Haskell-TH-Syntax.html#v:addDependentFile addDependentFile] to
 let GHC know of the dependency.

 I'm afraid it is not easy to call `addDependentFile` in `addCStub` because
 identifying the relevant files is difficult if they are conditionally
 included (i.e. between `#if` and `#endif`). On the otherhand, it would be
 ok to ask the frameworks producing the C code to call `addDependentFile`
 as necessary.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13237#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list