Fix incorrect retypecheck loop in -j (#14075)
ClosedPublic

Authored by ezyang on Aug 1 2017, 11:51 PM.

Details

Summary

The parallel codepath was incorrectly retypechecking the
hs-boot ModIface prior to typechecking the hs file,
which was inconsistent with the non-parallel case. The
non-parallel case gets it right: you don't want to retypecheck
the hs-boot file itself (forwarding its declarations to hs)
because you need it to be consistently knot-tied with itself
when you compare the interfaces.

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.Aug 1 2017, 11:51 PM
duog added a subscriber: duog.Aug 5 2017, 4:05 PM

Perhaps this isn't the best place for this question, but in any case, my understanding of the second typecheckLoop is that it makes unfoldings (and rules, etc) in the loop closer available to modules that import the .hs-boot file. I don't think this happens when compiling files "manually" with ghc -c does it? And doesn't this mean that, for example, unfoldings in DynFlags.hi are unavailable to modules that import Dynflags.hs-boot?

bgamari edited edge metadata.Aug 5 2017, 8:21 PM
In D3815#107812, @duog wrote:

Perhaps this isn't the best place for this question, but in any case, my understanding of the second typecheckLoop is that it makes unfoldings (and rules, etc) in the loop closer available to modules that import the .hs-boot file. I don't think this happens when compiling files "manually" with ghc -c does it? And doesn't this mean that, for example, unfoldings in DynFlags.hi are unavailable to modules that import Dynflags.hs-boot?

I believe that is correct; you won't get unfoldings for any declarations not in defined in the hs-boot file. Really all of this should be better documented in the users guide.

@duog, you are right. I have written a ticket about the issue:
https://ghc.haskell.org/trac/ghc/ticket/14092#ticket

This revision is now accepted and ready to land.Aug 18 2017, 7:47 AM
This revision was automatically updated to reflect the committed changes.