[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

#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
participants (1)
-
GHC