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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
#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):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by sgillespie):

 I think the strategy should be to modify mkModuleToPkgConfAll to include
 all UnusablePackages in PackageState.hs. We could then add another
 constructor to ModuleOrigin (say, BrokenPackage) so that we could report
 it on lookupModuleWithSuggestions.

 Please correct me if this is not a reasonable approach.

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
#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):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Phyx-):

 I haven't looked in great details but that seems like a reasonable
 approach to me. I'd say go ahead and give it a try!

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by sgillespie):

 What specific message should we show? I was thinking:

 {{{
 Prelude> :m + Control.Monad.Random

 <no location info>: error:
     Could not find module ‘Control.Monad.Random’
     It is a member of the package
 ‘MonadRandom-0.5.1-1421RgpXdhC8e8UI7D3emA’
     which is unusable due to missing dependencies:
       fail-4.9.0.0-BAHmj60kS5K7NVhhKpm9J5
 }}}

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Phyx-):

 I would change the first part to be more precise

 `Could not find module ‘Control.Monad.Random’` into something like `Could
 not load module ‘Control.Monad.Random’` since the message is a bit
 contradictory saying it couldn't find it yet it's part of a package it
 knows about.

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by sgillespie):

 Agreed; however, GHC does display the same contradictory message with
 hidden packages:

 {{{
 Prelude> :m + Data.Map

 <no location info>: error:
     Could not find module ‘Data.Map’
     It is a member of the hidden package ‘containers-0.5.11.0’.
     You can run ‘:set -package containers’ to expose it.
     (Note: this unloads all the modules in the current scope.)
 }}}

 I think it would make sense to use the same language for both scenarios. I
 can either update both, or leave them both the same.  What do you think?

 In the meantime, I'm going to go ahead and submit a review so someone can
 start reviewing it

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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:                    |
-------------------------------------+-------------------------------------
Changes (by sgillespie):

 * differential:   => Phab:D4783


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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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 sgillespie):

 I added my phabricator revision, but it doesn't appear to be building
 (we're on Step 1 for over 24 hours now):
 https://phabricator.haskell.org/harbormaster/build/47009/

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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 sgillespie):

 Replying to [comment:27 Phyx-]:
 > I would change the first part to be more precise
 >
 > `Could not find module ‘Control.Monad.Random’` into something like
 `Could not load module ‘Control.Monad.Random’` since the message is a bit
 contradictory saying it couldn't find it yet it's part of a package it
 knows about.

 I toyed with this a bit, using "Could not load module" for hidden and
 unusable packages. It broke hundreds of tests, and I'm a bit uncomfortable
 with that. For that reason, I think it's best not to mess with that for
 now.

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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 Phyx-):

 It's quite common to have to update test outputs when you change user
 visible messages. I'd be more surprised if you didn't have to. In any
 case, will change it later.

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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 sgillespie):

 Replying to [comment:32 Phyx-]:
 > It's quite common to have to update test outputs when you change user
 visible messages. I'd be more surprised if you didn't have to. In any
 case, will change it later.

 After further review, it was only 2 tests. I updated them and added them
 to the phabricator revision.

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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 Phyx-):

 Thanks! The new error messages look good to me! I'll give dfeuer a few
 days to respond to your review.

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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

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

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#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

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets