
#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