Skip to content

Unisay/plugin-recomp-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example GHC Plugin

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.

Steps to reproduce

  1. Building first time triggers plugin when compiling the exe/Main.hs:
cabal build all | grep Hello
--------------- Hello from plugin!
  1. Building second time does not (Nothing has changed so no recompilation needed).
  2. Changing exe/Main.hs does trigger plugin:
cabal build all | grep Hello
--------------- Hello from plugin!
  1. 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

GHC recompilation avoidance doc.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published