[GHC] #9243: Recompilation avoidance works imperfectly with -fno-code/-fwrite-interface
#9243: Recompilation avoidance works imperfectly with -fno-code/-fwrite-interface -------------------------+------------------------------------------------- Reporter: | Owner: ezyang | Status: new Type: bug | Milestone: Priority: | Version: 7.9 normal | Operating System: Unknown/Multiple Component: | Type of failure: Compile-time performance bug Compiler | Test Case: Keywords: | Blocking: Architecture: | Unknown/Multiple | Difficulty: | Unknown | Blocked By: | Related Tickets: | -------------------------+------------------------------------------------- With the latest `-fwrite-interface` enhancements, a build directory can contain interface files independently of object files. In cases like this, we would like to have recompilation avoidance avoid typechecking files whose interface files are up-to-date. However, this does not currently work: we always re-typecheck: {{{ t-edyang@cam-05-unx:/5playpen/t-edyang/sandbox/q$ /5playpen/t-edyang/ghc- backpack/inplace/bin/ghc-stage2 --make A.hs -fno-code -fwrite-interface [1 of 1] Compiling A ( A.hs, nothing ) t-edyang@cam-05-unx:/5playpen/t-edyang/sandbox/q$ /5playpen/t-edyang/ghc- backpack/inplace/bin/ghc-stage2 --make A.hs -fno-code -fwrite-interface [1 of 1] Compiling A ( A.hs, nothing ) }}} The reason for this is that recompilation avoidance logic in `compileOne` (in `DriverPipeline.hs`) seems to rely exclusively on "linkables" in order to figure out if source has been modified or not. We never generate an object file with `-fwrite-interface`, so the compiler always concludes that we need to retypecheck. However, recompilation avoidance for hs-boot does work. The reason for this is because we create a dummy o-boot linkable. We can't use this strategy for `-fno-code`, because the dummy object file would imply that we actually compiled the file (which we didn't). The upshot is that to fix this problem, it looks like we might have to rejigger all of the logic in `compileOne`, which why I gave up on this for now. Related to https://github.com/haskell/cabal/issues/1179 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9243> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9243: Recompilation avoidance works imperfectly with -fno-code/-fwrite-interface -------------------------------------------------+------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: Operating System: Unknown/Multiple | backpack Type of failure: Compile-time performance bug | Architecture: Test Case: | Unknown/Multiple Blocking: | Difficulty: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Changes (by ezyang): * keywords: => backpack -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9243#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9243: Recompilation avoidance works imperfectly with -fno-code/-fwrite-interface -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: backpack 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: D596 | -------------------------------------+------------------------------------- Changes (by ezyang): * owner: => ezyang * priority: normal => high * differential: => D596 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9243#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9243: Recompilation avoidance works imperfectly with -fno-code/-fwrite-interface -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: new Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.9 Resolution: | Keywords: backpack 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: D596 | -------------------------------------+------------------------------------- Changes (by ezyang): * milestone: => 7.10.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9243#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9243: Recompilation avoidance doesn't work for -fno-code/-fwrite-interface -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: new Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.9 Resolution: | Keywords: backpack 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: D596 | -------------------------------------+------------------------------------- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9243#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9243: Recompilation avoidance doesn't work for -fno-code/-fwrite-interface -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: patch Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.9 Resolution: | Keywords: backpack 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: D596 | -------------------------------------+------------------------------------- Changes (by ezyang): * status: new => patch -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9243#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9243: Recompilation avoidance doesn't work for -fno-code/-fwrite-interface -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: patch Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.9 Resolution: | Keywords: backpack Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D596 -------------------------------------+------------------------------------- Changes (by simonpj): * differential: D596 => Phab:D596 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9243#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9243: Recompilation avoidance doesn't work for -fno-code/-fwrite-interface -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: patch Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.9 Resolution: | Keywords: backpack Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D596 -------------------------------------+------------------------------------- Comment (by Edward Z. Yang <ezyang@…>): In [changeset:"2223e196b2dc5340d70e58be011c279d381b4319/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="2223e196b2dc5340d70e58be011c279d381b4319" Fix #9243 so recompilation avoidance works with -fno-code Summary: Where we track timestamps of object files, also track timestamps for interface files. When -fno-code -fwrite-interface is enabled, use the interface file timestamp as an extra check to see if the files are up-to-date. We had to apply this logic to one-shot and make modes. This fix would be good to merge into 7.10; it makes using -fno-code -fwrite-interface for flywheel type checking usable. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate and new test cases Reviewers: austin Subscribers: carter, thomie Differential Revision: https://phabricator.haskell.org/D596 GHC Trac Issues: #9243 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9243#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9243: Recompilation avoidance doesn't work for -fno-code/-fwrite-interface -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: merge Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.9 Resolution: | Keywords: backpack Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D596 -------------------------------------+------------------------------------- Changes (by ezyang): * status: patch => merge -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9243#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9243: Recompilation avoidance doesn't work for -fno-code/-fwrite-interface -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: merge Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.9 Resolution: | Keywords: backpack Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D596 -------------------------------------+------------------------------------- Comment (by ezyang): Oh, to be clear to whoever merges: you probably need the parent commit https://git.haskell.org/ghc.git/commit/af4d99803ea7676f88f250ad56a8c31c1c8cd... -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9243#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9243: Recompilation avoidance doesn't work for -fno-code/-fwrite-interface -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: closed Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.9 Resolution: fixed | Keywords: backpack Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D596 -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged into ghc-7.10. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9243#comment:10> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9243: Recompilation avoidance doesn't work for -fno-code/-fwrite-interface -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: closed Priority: high | Milestone: 7.10.1 Component: Compiler | Version: 7.9 Resolution: fixed | Keywords: backpack Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D596 -------------------------------------+------------------------------------- Comment (by Thomas Miedema <thomasmiedema@…>): In [changeset:"bc604bdb0144010e8582caa6ea159ca0446c04f2/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="bc604bdb0144010e8582caa6ea159ca0446c04f2" Update assert to fix retc001 and retc002 (#9243) Since 2223e196b2dc5340d70e58be011c279d381b4319, maybe_old_linkable can be Nothing even with an up-to-date interface file. This happens when compiling with --make -fno-code -fwrite-interface. See also Note [Recompilation checking when typechecking only] in GhcMake.hs. This fixes retc001 and retc002 when ghc_debugged. Differential Revision: https://phabricator.haskell.org/D1077 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9243#comment:11> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC