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

#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

#8144: Interface hashes include time stamp of included .h file when CPP is used -------------------------------------------------+------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Changes (by akio): * cc: tkn.akio@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of included .h file when CPP is used -------------------------------------------------+------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by nh2): (This happens for me with ghc-7.6.3, ghc-7.4.1 and some version of GHC 7.7.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of included .h file when CPP is used -------------------------------------------------+------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by simonpj): That certainly sounds wrong. Would anyone care to investigate? Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of included .h file when CPP is used -------------------------------------------------+------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by nh2): http://www.haskell.org/ghc/docs/7.6.3/html/libraries/ghc/HscTypes.html#t:Usa... see {{{ UsageFile { usg_file_path :: FilePath , usg_mtime :: UTCTime } }}} https://github.com/ghc/ghc/blame/9082111dc/compiler/iface/MkIface.lhs#L603 {{{ iface_hash <- computeFingerprint ... }}} where ''computeFingerprint'' just uses the ''instance Binary Usage'', so the mtime goes into the fingerprint. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of included .h file when CPP is used -------------------------------------------------+------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by nh2): ''UsageFile'' was introduced with ''addDependentFile'' in https://github.com/ghc/ghc/commit/b994313. The modification time being only (obtained) in second resolution is what triggers the inconsistent behaviour. Regarding that commit, I am also not sure how https://github.com/ghc/ghc/commit/b994313#L3R1283 works: {{{ checkModUsage _this_pkg UsageFile{ usg_file_path = file, usg_mtime = old_mtime } = do new_mtime <- liftIO $ getModificationTime file return $ old_mtime /= new_mtime }}} I might be wrong, but it looks to me as if this can only ever return False (''UpToDate'' in current GHC head) '''because''' the mtime is so coarse - in other words if your computer is too slow, a second will pass and this will never be considered up to date? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of included .h file when CPP is used -------------------------------------------------+------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by refold): Looks like #7473 is related. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------------------+------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

Looks like #7473 is related. According to discussion in #7473 `getModificationTime` was improved on Linux to return time with resolution better than 1 second. nh2, what
#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------------------+------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by jstolarek): Replying to [comment:6 refold]: platform are you on? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------------------+------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by nh2): Replying to [comment:8 jstolarek]:
nh2, what platform are you on?
Linux on all the GHCs I mentioned above. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------------------+------------------------- Reporter: nh2 | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Changes (by nh2): * status: new => patch Comment: I wrote a patch: https://github.com/nh2/ghc/compare/fix-interface-hashes-mtime https://github.com/nh2/packages-base/compare/fix-interface-hashes-mtime It contains some preparatory cleanup commits, the main change is at https://github.com/nh2/ghc/commit/e368816. This fixes my test case. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------------------+------------------------- Reporter: nh2 | Owner: nh2 Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Changes (by nh2): * owner: => nh2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------------------+------------------------- Reporter: nh2 | Owner: nh2 Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by simonmar): Looks good to me. Making iface hashes more deterministic is definitely the way to go. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime)
-------------------------------------------------+-------------------------
Reporter: nh2 | Owner: nh2
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time performance bug | Unknown/Multiple
Test Case: | Difficulty:
Blocking: | Unknown
| Blocked By:
| Related Tickets:
-------------------------------------------------+-------------------------
Comment (by Austin Seipp

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------------------+------------------------- Reporter: nh2 | Owner: nh2 Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by thoughtpolice): This is now fixed but I have not yet added a test, so I will keep it open. @nh2, can you confirm this fixes your bug? Perhaps include a patch for a simpler test if possible :) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime)
-------------------------------------------------+-------------------------
Reporter: nh2 | Owner: nh2
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time performance bug | Unknown/Multiple
Test Case: | Difficulty:
Blocking: | Unknown
| Blocked By:
| Related Tickets:
-------------------------------------------------+-------------------------
Comment (by Austin Seipp

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------------------+------------------------- Reporter: nh2 | Owner: nh2 Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by nh2): There is small bug in the replacement code used for the stage 1 compiler: The input file is never read :P (Doesn't become obvious until you try to backport my change to 7.6.) Please pull: https://github.com/nh2/ghc/compare/fix-interface-hashes-mtime -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------------------+------------------------- Reporter: nh2 | Owner: nh2 Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by thoughtpolice): Thanks, I've merged and I'm validating now. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime)
-------------------------------------------------+-------------------------
Reporter: nh2 | Owner: nh2
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time performance bug | Unknown/Multiple
Test Case: | Difficulty:
Blocking: | Unknown
| Blocked By:
| Related Tickets:
-------------------------------------------------+-------------------------
Comment (by thoughtpolice):
Merged
{{{
commit 95ebff9aed3e8570c7ac51148594c48a812c5b19
Author: Austin Seipp

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------------------+------------------------- Reporter: nh2 | Owner: nh2 Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time performance bug | Unknown/Multiple Test Case: | Difficulty: Blocking: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by nh2): A backport to 7.6 can be found at https://github.com/nh2/ghc/releases/tag /fix-interface-hashes-mtime-7.6.3-release-tarball-tag (based on 7.6.3 release tarball, 64 bit Linux ghc binary also provided). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------------------+------------------------- Reporter: nh2 | Owner: nh2 Type: bug | Status: Priority: normal | closed Component: Compiler | Milestone: Resolution: fixed | Version: 7.6.3 Operating System: Unknown/Multiple | Keywords: Type of failure: Compile-time performance bug | Architecture: Test Case: | Unknown/Multiple Blocking: | Difficulty: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Changes (by ezyang): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:20 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------------------+------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | testcase Type of failure: Compile-time performance bug | Architecture: Test Case: | Unknown/Multiple Blocking: | Difficulty: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Changes (by ezyang): * keywords: => testcase * owner: nh2 => * status: closed => new * resolution: fixed => Comment: nh2: Would it be possible to get a test case on this one? (Or is there one already?) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:21 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------------------+------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | testcase Type of failure: Compile-time performance bug | Architecture: Test Case: | Unknown/Multiple Blocking: | Difficulty: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by nh2): Replying to [comment:21 ezyang]:
nh2: Would it be possible to get a test case on this one? (Or is there one already?)
I'll make one eventually (that means hopefully this week). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:22 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: testcase Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: Compile- | Blocked By: time performance bug | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rodlogic): Should this be closed or is a test case still pending? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:23 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: testcase Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: Compile- | Blocked By: time performance bug | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by nh2): Still pending. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:24 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: testcase Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: Compile- | Blocked By: time performance bug | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by nh2): I added a test case at https://github.com/nh2/ghc/compare/testcase-8144. Please pull. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:25 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: testcase Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: Compile- | Blocked By: time performance bug | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:26 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: testcase Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: Compile- | Blocked By: time performance bug | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by thomie): Test LGTM. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:27 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: testcase Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: Compile- | Blocked By: time performance bug | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: patch => infoneeded * milestone: => 7.10.1 Comment: Niklas, can you please rebase this patch? I manually did it, but then the test started failing (the `.stdout` file had "compilation IS NOT required" once too many times). Can you please take this and verify it should work? Thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:28 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: testcase Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: Compile- | Blocked By: time performance bug | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by thoughtpolice): Here's a WIP patch: https://github.com/ghc/ghc/commit/a3bf4bfae694572b0bf886fcb1191d066d242aed on `wip/8144` -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:29 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: testcase Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by nomeata): What is the status of this? Stable interfaces are important for distributions like Debian! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:31 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: infoneeded Priority: high | Milestone: 7.12.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: testcase Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by nomeata): * priority: normal => high Comment: Also, from reading the patch, it is not clear to me if the filename is also part of the ABI hash. It should not be, as build directory names may change, e.g. on automatic build machines. Also see http://bugs.debian.org/785282 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:32 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: testcase Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by nomeata): * priority: high => normal Comment: Ah, wait: This is only waiting for a test case, right? So then why do I still see this {{{ ./usr/lib/ghc/base-4.7.0.2/System/Info.hi --- /dev/fd/63 2015-05-14 10:15:20.278404032 +0200 +++ /dev/fd/62 2015-05-14 10:15:20.278404032 +0200 @@ -5,7 +5,7 @@ Way: Wanted [], got [] interface base:System.Info 7084 - interface hash: 038b3a2a32cd43c6a82b096e3ef5c665 + interface hash: 4ff1db7940716ca0e906d3f6b7af1166 ABI hash: 67cae6f933216805d975ee28cd5ea72d export-list hash: 89e8b7a3bfc33bdb505eb586ca9fe64e orphan hash: 693e9af84d3dfcc71e640e005bdc5e2e @@ -64,7 +64,7 @@ divMod e11d60a38cd49de2f6058cc39227517a import safe Prelude 74043f272d60acec1777d3461cfe5ef4 exports: be888345b248b32ace8f805dd49f3def -addDependentFile "/build/ghc-LIQtDg/ghc-7.8.4/includes/ghcplatform.h" +addDependentFile "/build/ghc-Na5lKv/ghc-7.8.4/includes/ghcplatform.h" addDependentFile "libraries/base/dist- install/build/autogen/cabal_macros.h" addDependentFile "/usr/include/stdc-predef.h" f85496685a82c42827c38c1ecec0b5fd }}} Looks like the filename is included in the hash then, because the files are identical in both builds... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:33 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: testcase Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): nomeata, sorry if I am missing something obvious, but this ticket seems to be about the time stamp not appearing in the interface hash, so the fact that this ticket is just waiting for a test is not incompatible with the interface hash including the file name. Currently we need the .h file name in the interface file so that we can check whether the file fingerprint matches, and we use the interface hash to determine whether to write a new interface file, so it's not immediately obvious that we can avoid putting the file name in the interface hash. Maybe you'd like to create a new ticket about finding some way to avoid this? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:34 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8144: Interface hashes include time stamp of dependent files (UsageFile mtime) -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.6.3 Resolution: | Keywords: testcase Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by nomeata):
and we use the interface hash to determine whether to write a new interface file,
Ah, this is new to me. I assumed that when a module is compiled, its interface is written, and the interface hash is only used to decide whether to rebuild another module or not. But you are right, this deserves a separate ticket. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8144#comment:35 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC