Skip to content

Interface hashes include time stamp of dependent files (UsageFile mtime)

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.

Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Edited by Niklas Hambüchen
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information