[GHC] #15858: Enabling a pure Plugin with existing build output never triggers recompilation

#15858: Enabling a pure Plugin with existing build output never triggers recompilation -------------------------------------+------------------------------------- Reporter: DanielG | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.7 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Other Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Consider the following compilation session: {{{ $ ghc -fplugin ImpurePlugin Foo.hs <Compiles Foo.hs> $ ghc Foo.hs }}} where ImpurePlugin is a `Plugin` which returns `ForceRecompile` in `pluginRecompile`. The second invocation of GHC doesn't recompile even though `ImpurePlugin` could have changed the generated build output which would now be out of date. The same thing happens when switching from an impure/fingerprinted plugin to a pure plugin. The problem is that `pluginRecompileToRecompileRequired` just assumes no compilation is required when the current plugin stack is pure, that is either only pure plugins or no plugins at all are registered: {{{ pluginRecompileToRecompileRequired :: Fingerprint -> PluginRecompile -> RecompileRequired pluginRecompileToRecompileRequired old_fp pr = case pr of NoForceRecompile -> UpToDate ForceRecompile -> RecompBecause "Plugin forced recompilation" MaybeRecompile fp -> if fp == old_fp then UpToDate }}} note the `UpToDate` in the `NoForceRecompile` case. Furthermore I would argue that even switching from having no plugin at all active to having a pure plugin active should trigger recompilation, even though the plugin might be pure it could still choose to affect the build output after all. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15858 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15858: Enabling a pure Plugin with existing build output never triggers recompilation -------------------------------------+------------------------------------- Reporter: DanielG | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5299 Wiki Page: | -------------------------------------+------------------------------------- Changes (by DanielG): * status: new => patch * differential: => Phab:D5299 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15858#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15858: Enabling a pure Plugin with existing build output never triggers recompilation -------------------------------------+------------------------------------- Reporter: DanielG | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5299 Wiki Page: | -------------------------------------+------------------------------------- Comment (by DanielG): For now I've not implemented recompilation when going from no plugins -> some plugins or the other way around. I'm waiting for feedback on the desired behaviour in that case. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15858#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15858: Enabling a pure Plugin with existing build output never triggers recompilation -------------------------------------+------------------------------------- Reporter: DanielG | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.7 Resolution: | Keywords: Plugins Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5299 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * cc: mpickering (added) * keywords: => Plugins -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15858#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15858: Enabling a pure Plugin with existing build output never triggers
recompilation
-------------------------------------+-------------------------------------
Reporter: DanielG | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 8.7
Resolution: | Keywords: Plugins
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Other | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5299
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#15858: Enabling a pure Plugin with existing build output never triggers recompilation -------------------------------------+------------------------------------- Reporter: DanielG | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.7 Resolution: fixed | Keywords: Plugins Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5299 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.8.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15858#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC