[commit: ghc] master: Fix a Backpack recompilation avoidance bug when signatures change. (ca54315)

git at git.haskell.org git at git.haskell.org
Sat Feb 18 00:47:50 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/ca543154bbf0ec36ee2654050ee67a467420449f/ghc

>---------------------------------------------------------------

commit ca543154bbf0ec36ee2654050ee67a467420449f
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Sun Feb 12 02:44:01 2017 -0800

    Fix a Backpack recompilation avoidance bug when signatures change.
    
    Summary:
    Recompilation avoidance checks if -this-unit-id has changed by relying
    on the "wanted module" check in readIface ("Something is amiss...").
    Unfortunately, this check didn't check if the instantiation made
    sense, which meant that if you changed the signatures of a Backpack
    package, we'd still treat the old signatures as up-to-date.
    
    The way I fixed this was by having findAndReadIface take in a 'Module'
    representing the /actual/ module we were intending to lookup.  We
    convert this into the 'Module' we expect to see in 'mi_module' and
    now do a more elaborate check that will also verify that instantiations
    make sense.
    
    Along the way, I robustified the logging infrastructure for
    recompilation checking, and folded wrongIfaceModErr (which
    was dead code) into the error message.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
    
    Test Plan: validate
    
    Reviewers: bgamari, austin
    
    Subscribers: thomie, snowleopard
    
    Differential Revision: https://phabricator.haskell.org/D3130


>---------------------------------------------------------------

ca543154bbf0ec36ee2654050ee67a467420449f
 compiler/basicTypes/Module.hs                      |  4 ++
 compiler/iface/FlagChecker.hs                      |  4 ++
 compiler/iface/LoadIface.hs                        | 68 +++++++++++++---------
 compiler/iface/MkIface.hs                          | 13 ++++-
 compiler/iface/TcIface.hs                          |  2 +-
 compiler/typecheck/TcBackpack.hs                   | 12 ++--
 testsuite/driver/extra_files.py                    |  1 +
 .../tests/backpack/cabal/bkpcabal04/.gitignore     |  3 +
 testsuite/tests/backpack/cabal/bkpcabal04/Makefile | 29 +++++++++
 .../cabal/{bkpcabal01 => bkpcabal04}/Setup.hs      |  0
 testsuite/tests/backpack/cabal/bkpcabal04/all.T    | 10 ++++
 .../bkpcabal04.cabal.in1}                          | 12 ++--
 .../bkpcabal04.cabal.in2}                          | 12 ++--
 .../{bkpcabal03/asig1 => bkpcabal04/p}/A.hsig      |  1 -
 .../tests/backpack/cabal/bkpcabal04/q/A/B.hsig.in  |  2 +
 .../tests/backpack/cabal/bkpcabal04/q/B.hsig.in    |  2 +
 testsuite/tests/backpack/should_compile/bkp51.bkp  |  2 +-
 17 files changed, 124 insertions(+), 53 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ca543154bbf0ec36ee2654050ee67a467420449f


More information about the ghc-commits mailing list