
#12035: hs-boot knot tying insufficient for ghc --make -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.1 checker) | Keywords: hs-boot Resolution: | backpack Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by ezyang): This PDF gives the full story, http://web.mit.edu/~ezyang/Public/backpack- symbol-tables.pdf but the short answer is that there are two ways we loop tie hs-boot. The first, which is correctly implemented for `--make`, is retypechecking all the modules that depended on the `hs-boot` file. The second is tying the loop ''at the same time'' we are typechecking the `hs` module which implements the `hs-boot` file; i.e., it's what `tcg_type_env_var` is for. If we have: {{{ -- A.hs-boot module A where x :: Bool -- B.hs module B where import {-# SOURCE #-} A y = not x -- A.hs module A where import B x = True z = not y }}} When we typecheck `A.hs`, does the unfolding for `y` have an up-to-date unfolding for `x`? In one-shot mode the answer is yes (and thus we see the behavior of #10083), but in make mode the answer is no. The retypecheck loop has nothing to do with it, since it happens AFTER we finish building the hs file. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12035#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler