Fix recompilation avoidance bug for implementor of hsig.
ClosedPublic

Authored by ezyang on Mar 26 2017, 12:54 AM.

Details

Summary

I observed a bug where if I modified the module which implemented
an hsig in another package, GHC would not recompile the signature
in this situation. The cause of this was two fold:

  1. calculateAvails is a bit subtle in that it doesn't actually set imp_mods; you have to set it yourself in the end.
  1. There was a bug with the module we passed to mkUsageInfos; it needs to be an identity module otherwise we exclude the implementing module from the list of depended upon modules.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>

Test Plan

validate

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ezyang created this revision.Mar 26 2017, 12:54 AM
ezyang updated this revision to Diff 11876.Mar 26 2017, 4:30 PM

fix validate error

bgamari requested changes to this revision.Mar 27 2017, 8:42 AM
bgamari added inline comments.
compiler/typecheck/TcBackpack.hs
869

On the whole I can't help but wonder whether calculateAvails's interface could be improved. Afterall, of the three call-sites we have in the tree currently, one actively hacks around it to avoid including imp_mod in the avails list (TcBackpack.hs:772) and the other two have to awkwardly tweak the result.

testsuite/tests/backpack/cabal/bkpcabal06/Makefile
11

Needs to be updated.

This revision now requires changes to proceed.Mar 27 2017, 8:42 AM
ezyang updated this revision to Diff 11917.Mar 29 2017, 1:05 PM
ezyang edited edge metadata.

Better cleaner implementation

bgamari requested changes to this revision.Mar 29 2017, 7:03 PM

Indeed, this is quite an improvement. There's still one small issue though.

compiler/deSugar/DsUsage.hs
188

This match is redundant, no?

This revision now requires changes to proceed.Mar 29 2017, 7:03 PM
This revision was automatically updated to reflect the committed changes.