[GHC] #10420: "Care with plugin imports" is wrong / orphan RULE visibility

GHC ghc-devs at haskell.org
Sat Jun 20 22:13:30 UTC 2015


#10420: "Care with plugin imports" is wrong / orphan RULE visibility
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                   Owner:  ezyang
            Type:  bug               |                  Status:  patch
        Priority:  normal            |               Milestone:
       Component:  Compiler (Type    |                 Version:  7.11
  checker)                           |                Keywords:
      Resolution:                    |            Architecture:
Operating System:  Unknown/Multiple  |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:  plugins07
      Blocked By:                    |                Blocking:  10294
 Related Tickets:                    |  Differential Revisions:  Phab:D950
-------------------------------------+-------------------------------------

Comment (by Edward Z. Yang <ezyang@…>):

 In [changeset:"0cb1f5cf26fae946ca745abc5e302e62a8f66feb/ghc"]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="0cb1f5cf26fae946ca745abc5e302e62a8f66feb"
 Filter orphan rules based on imports, fixes #10294 and #10420.

 Summary:
 If we have an orphan rule in our database, don't apply it
 unless the defining module is transitively imported by the
 module we are processing.  We do this by defining a new RuleEnv
 data type which includes both the RuleBase as well as the set
 of visible orphan modules, and threading this through the
 relevant environments (CoreReader, RuleCheckEnv and ScEnv).

 This is analogous to the instances fix we applied in #2182
 4c834fdddf4d44d12039da4d6a2c63a660975b95, but done for RULES.
 An important knock-on effect is that we can remove some buggy
 code in LoadInterface which tried to avoid loading interfaces
 that were loaded by plugins (which sometimes caused instances
 and rules to NEVER become visible).

 One note about tests: I renamed the old plugins07 test to T10420
 and replaced plugins07 with a test to ensure that a plugin
 import did not cause new rules to be loaded in.

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

 Test Plan: validate

 Reviewers: simonpj, austin, goldfire

 Subscribers: bgamari, thomie

 Differential Revision: https://phabricator.haskell.org/D950

 GHC Trac Issues: #10420
 }}}

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


More information about the ghc-tickets mailing list