Implement "An API for deciding whether plugins should cause recompilation"
This patch implements the API proposed as pull request #108 for plugin authors to influence the recompilation checker. It adds a new field to a plugin which computes a `FingerPrint`. This is recorded in interface files and if it changes then we recompile the module. There are also helper functions such as `purePlugin` and `impurePlugin` for constructing plugins which have simple recompilation semantics but in general, an author can compute a hash as they wish. Fixes #12567 and #7414 https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/002 2-plugin-recompilation.rst Reviewers: bgamari, ggreif Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #7414, #12567 Differential Revision: https://phabricator.haskell.org/D4366
Showing
- compiler/deSugar/Desugar.hs 5 additions, 1 deletioncompiler/deSugar/Desugar.hs
- compiler/deSugar/DsUsage.hs 15 additions, 6 deletionscompiler/deSugar/DsUsage.hs
- compiler/iface/LoadIface.hs 1 addition, 0 deletionscompiler/iface/LoadIface.hs
- compiler/iface/MkIface.hs 68 additions, 2 deletionscompiler/iface/MkIface.hs
- compiler/main/DynamicLoading.hs 10 additions, 8 deletionscompiler/main/DynamicLoading.hs
- compiler/main/HscTypes.hs 6 additions, 0 deletionscompiler/main/HscTypes.hs
- compiler/main/Plugins.hs 57 additions, 7 deletionscompiler/main/Plugins.hs
- compiler/simplCore/CoreMonad.hs 3 additions, 3 deletionscompiler/simplCore/CoreMonad.hs
- compiler/simplCore/SimplCore.hs 3 additions, 2 deletionscompiler/simplCore/SimplCore.hs
- docs/users_guide/extending_ghc.rst 57 additions, 0 deletionsdocs/users_guide/extending_ghc.rst
- testsuite/tests/plugins/Makefile 26 additions, 1 deletiontestsuite/tests/plugins/Makefile
- testsuite/tests/plugins/T12567a.stderr 0 additions, 5 deletionstestsuite/tests/plugins/T12567a.stderr
- testsuite/tests/plugins/all.T 18 additions, 0 deletionstestsuite/tests/plugins/all.T
- testsuite/tests/plugins/plugin-recomp-flags.stderr 6 additions, 0 deletionstestsuite/tests/plugins/plugin-recomp-flags.stderr
- testsuite/tests/plugins/plugin-recomp-flags.stdout 4 additions, 0 deletionstestsuite/tests/plugins/plugin-recomp-flags.stdout
- testsuite/tests/plugins/plugin-recomp-impure.stderr 6 additions, 0 deletionstestsuite/tests/plugins/plugin-recomp-impure.stderr
- testsuite/tests/plugins/plugin-recomp-impure.stdout 4 additions, 0 deletionstestsuite/tests/plugins/plugin-recomp-impure.stdout
- testsuite/tests/plugins/plugin-recomp-pure.stderr 3 additions, 0 deletionstestsuite/tests/plugins/plugin-recomp-pure.stderr
- testsuite/tests/plugins/plugin-recomp-pure.stdout 2 additions, 0 deletionstestsuite/tests/plugins/plugin-recomp-pure.stdout
- testsuite/tests/plugins/plugin-recomp-test.hs 8 additions, 0 deletionstestsuite/tests/plugins/plugin-recomp-test.hs
Loading
Please register or sign in to comment