[GHC] #4806: Make error message more user friendly when module is not found because package is unusable

GHC ghc-devs at haskell.org
Sun Jun 17 16:42:07 UTC 2018


#4806: Make error message more user friendly when module is not found because
package is unusable
-------------------------------------+-------------------------------------
        Reporter:  mitar             |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.0.1
      Resolution:                    |             Keywords:  newcomer
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D4783
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"df0f148feae4c3b9653260edff843d561d6d5918/ghc"
 df0f148f/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="df0f148feae4c3b9653260edff843d561d6d5918"
 Improve error message when importing an unusable package

 If a module cannot be found because it is ignored or from an unusable
 package, report this to the user and the reason it is unusable.

 Currently, GHC displays the standard "Cannot find module error". For
 example:

 ```
 <no location info>: error:
     Could not find module ‘Control.Monad.Random’
     Perhaps you meant
       Control.Monad.Reader (from mtl-2.2.2)
       Control.Monad.Cont (from mtl-2.2.2)
       Control.Monad.Error (from mtl-2.2.2)
 ```

 GHC does, however, indicate unusable/ignored packages with the -v flag:

 ```
 package MonadRandom-0.5.1-1421RgpXdhC8e8UI7D3emA is unusable due to
 missing dependencies:
   fail-4.9.0.0-BAHmj60kS5K7NVhhKpm9J5
 ```

 With this change, I took that message and added it to the output of the
 "Cannot find module" message.

 Reviewers: bgamari, dfeuer

 Reviewed By: bgamari

 Subscribers: Phyx, dfeuer, rwbarton, thomie, carter

 GHC Trac Issues: #4806

 Differential Revision: https://phabricator.haskell.org/D4783
 }}}

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


More information about the ghc-tickets mailing list