[GHC] #14482: GHC -M mode fails to ensure that boot files are built before source files

GHC ghc-devs at haskell.org
Mon Nov 20 14:01:32 UTC 2017


#14482: GHC -M mode fails to ensure that boot files are built before source files
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:  8.4.1
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #14481            |  Differential Rev(s):  Phab:D4208
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 I think the payload of the patch is:

 * Make `M.o` depend on `M.hi-boot`.

 But let me ask this: in what program will that that not happen without
 this patch?  I think only on programs where

 * Neither `M.hs` nor any of the module that `M.hs` imports, transitively,
 does a `{-# SOURCE #-}` import of `M`.

 And in those cases we can just get rid of `M.hs-boot` entirely.  It's not
 needed.

 I've had a look at the example in #14481. (I'm not sure why this ticket is
 distinct from #14481, incidentally.)  I believe it has the same property:
 no one imports `Instances1` in fact.

 I grant that GHC should not crash.  But rather than simply adding an extra
 dependency, if we find that if there is no transitive edge from `M.hs` to
 `M.hs-boot`, we should

 a) add one
 b) emit a warning that `M.hs-boot` is apparently redundant.

 Failing to do (b) seems wrong.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14482#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list