[GHC] #13152: Provide a mechanism to notify build system when .hi file is ready

GHC ghc-devs at haskell.org
Thu Jan 19 17:48:41 UTC 2017


#13152: Provide a mechanism to notify build system when .hi file is ready
-------------------------------------+-------------------------------------
           Reporter:  rwbarton       |             Owner:
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:  8.2.1
          Component:  Driver         |           Version:  8.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 In one-shot mode GHC typically finishes writing the interface file around
 halfway through compilation. A dependent module (if it doesn't use
 Template Haskell) only needs the interface file to start building. If we
 could start building a module as soon as all its dependencies' interface
 files are ready, we would cut the critical path by about a factor of 2;
 and parallelism in the GHC build tree is currently low enough that this
 should give significantly lower build times even on only modestly parallel
 systems.

 The first obstruction to doing this is that there isn't a good way to know
 when the interface file becomes ready. I propose the following simple and
 flexible mechanism:

 * Add a GHC command-line argument `-finterface-file-finished=N,F,str`.
 When GHC has finished writing the interface file it uses the `send` system
 call to send the string `str` to file descriptor `N` using flags `F`.

 The build system might then invoke GHC with file descriptor `N` open to a
 UNIX datagram socket, for example, and generate a unique `str` for each
 interface file dependency.

 Alternative suggestions are more than welcome.

 I tentatively milestoned this for 8.2 since it would be nice to have this
 available in the bootstrapping compiler when we switch to Hadrian, and the
 GHC-side implementation should be simple.

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


More information about the ghc-tickets mailing list