
#13829: ghc --make should not relink when we know the binary doesn't change -------------------------------------+------------------------------------- Reporter: nh2 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #13828 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by nh2: @@ -22,1 +22,6 @@ - Perhaps even earlier (e.g. after parsing). + Perhaps even earlier (e.g. after parsing) in this specific case; but + certainly after code gen, which I'd expect also to avoid the recompilation + if e.g. a comment was added to the file, as the comment won't make it into + the program code (unless something like TH `location` or `HasCallStack` is + used, which can change the line numbers those generate if a comment pushes + them down). New description: I would expect GHC not to relink after touching a file, since no actual program code was changed. But it does: {{{ $ echo "main = return ()" > Main.hs $ ghc --make Main.hs [1 of 1] Compiling Main ( Main.hs, Main.o ) Linking Main ... $ touch Main.hs $ ghc --make Main.hs [1 of 1] Compiling Main ( Main.hs, Main.o ) Linking Main ... }}} I would expect that the recompilation avoidance makes GHC stop continuing as soon as it has noticed that the same object code (`.o` file) was generated as in the first build. Perhaps even earlier (e.g. after parsing) in this specific case; but certainly after code gen, which I'd expect also to avoid the recompilation if e.g. a comment was added to the file, as the comment won't make it into the program code (unless something like TH `location` or `HasCallStack` is used, which can change the line numbers those generate if a comment pushes them down). -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13829#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler