[GHC] #8144: Interface hashes include time stamp of included .h file when CPP is used

GHC ghc-devs at haskell.org
Tue Aug 20 06:08:58 CEST 2013


#8144: Interface hashes include time stamp of included .h file when CPP is used
-------------------------+-------------------------------------------------
       Reporter:  nh2    |             Owner:
           Type:  bug    |            Status:  new
       Priority:         |         Milestone:
  normal                 |           Version:  7.6.3
      Component:         |  Operating System:  Unknown/Multiple
  Compiler               |   Type of failure:  Compile-time performance bug
       Keywords:         |         Test Case:
   Architecture:         |          Blocking:
  Unknown/Multiple       |
     Difficulty:         |
  Unknown                |
     Blocked By:         |
Related Tickets:         |
-------------------------+-------------------------------------------------
 See https://github.com/nh2/ghc-bug-time-dependent-interface-hashes for a
 fast test case.

 Having '''Test.hs''':

 {{{
 {-# LANGUAGE CPP #-}

 module Test () where
 }}}

 and an empty '''cabal_macros.h''',

 {{{
 touch cabal_macros.h
 ghc -c Test.hs -optP-include -optPcabal_macros.h
 }}}

 will generate you a different interface hash ''most of the time'' in
 '''ghc --show-iface Test.hi'''.


 It looks like the modification time of the .h file makes it into the
 interface hash, but only at second resolution, and you get ''compilation
 IS NOT required'' if you manage to run it twice per second.

 I think the interface hash should be independent from the time stamp of
 the header file.

 This bug can trigger unnecessary recompilation and makes compilations with
 identical inputs non-deterministic.

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




More information about the ghc-tickets mailing list