Add flag to control whether self-recompilation information is written to interface
This patch adds the flag -fwrite-if-self-recomp which controls whether interface files contain the information necessary to answer the question: Do I need to recompile myself or is this current interface file suitable? Why? Most packages are only built once either by a distribution or cabal and then placed into an immutable store, after which we will never ask this question. Therefore we can derive two benefits from omitting this information. * Primary motivation: It vastly reduces the surface area for creating non-deterministic interface files. See issue #10424 which motivated a proper fix to that issue. Distributions have long contained versions of GHC which just have broken self-recompilation checking (in order to get deterministic interface files). * Secondary motivation: This reduces the size of interface files slightly.. the `mi_usages` field can be quite big but probably this isn't such a great benefit. * Third motivation: Conceptually clarity about which parts of an interface file are used in order to **communicate** with subsequent packages about the **interface** for a module. And which parts are used to self-communicate during recompilation checking. The main tracking issue is #22188 but fixes issues such as #10424 in a proper way.
Showing
- compiler/GHC.hs 0 additions, 2 deletionscompiler/GHC.hs
- compiler/GHC/Driver/DynFlags.hs 2 additions, 1 deletioncompiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Flags.hs 1 addition, 0 deletionscompiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main.hs 2 additions, 2 deletionscompiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs 3 additions, 3 deletionscompiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Session.hs 1 addition, 0 deletionscompiler/GHC/Driver/Session.hs
- compiler/GHC/HsToCore.hs 6 additions, 17 deletionscompiler/GHC/HsToCore.hs
- compiler/GHC/Iface/Binary.hs 3 additions, 7 deletionscompiler/GHC/Iface/Binary.hs
- compiler/GHC/Iface/Load.hs 12 additions, 8 deletionscompiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Make.hs 42 additions, 33 deletionscompiler/GHC/Iface/Make.hs
- compiler/GHC/Iface/Recomp.hs 63 additions, 51 deletionscompiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Recomp/Types.hs 112 additions, 0 deletionscompiler/GHC/Iface/Recomp/Types.hs
- compiler/GHC/Unit/Module/ModGuts.hs 1 addition, 1 deletioncompiler/GHC/Unit/Module/ModGuts.hs
- compiler/GHC/Unit/Module/ModIface.hs 71 additions, 115 deletionscompiler/GHC/Unit/Module/ModIface.hs
- compiler/ghc.cabal.in 1 addition, 0 deletionscompiler/ghc.cabal.in
- docs/users_guide/phases.rst 18 additions, 0 deletionsdocs/users_guide/phases.rst
- testsuite/tests/count-deps/CountDepsAst.stdout 1 addition, 0 deletionstestsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout 1 addition, 0 deletionstestsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/driver/self-recomp/Makefile 38 additions, 0 deletionstestsuite/tests/driver/self-recomp/Makefile
- testsuite/tests/driver/self-recomp/SelfRecomp01.hs 2 additions, 0 deletionstestsuite/tests/driver/self-recomp/SelfRecomp01.hs
Loading
Please register or sign in to comment