This repository contains an example project to demonstrate that changes in a GHC Plugin do not cause recompilation of modules using the plugin if its added using the addCorePlugin
If a plugin is added using the {-# OPTIONS_GHC -fplugin Plugin #-}
pragma then recompilation happens as expected.
- Building first time triggers plugin when compiling the
exe/Main.hs
:
cabal build all | grep Hello
--------------- Hello from plugin!
- Building second time does not (Nothing has changed so no recompilation needed).
- Changing
exe/Main.hs
does trigger plugin:
cabal build all | grep Hello
--------------- Hello from plugin!
- Changing the Plugin (e.g. by modifying a message in the https://github.com/Unisay/plugin-recomp-repro/blob/main/src/Plugin.hs) doesn't trigger recompilation of
exe/Main.hs
that uses the plugin, so its not triggered:
cabal build all | grep Hello