Opened 7 years ago

Last modified 10 months ago

#4806 new feature request

Make error message more user friendly when module is not found because package is unusable

Reported by: mitar Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.0.1
Keywords: newcomer Cc: mmitar@…, Phyx-
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Make error message more user friendly when module is not found because package is unusable. Currently it just reports that module is missing (the same as it even would not be installed) but then checking with ghc-pkg find-module shows package correctly. Chasing '-v' output around can then show you this but it would be easier that you would immediately get a helpful message.

Change History (22)

comment:1 Changed 7 years ago by igloo

Milestone: 7.2.1

Thanks for the report. It would be useful if you could paste the command you're running and the messages you're seeing, so we can be sure we're looking at the same thing.

comment:2 Changed 6 years ago by igloo

Milestone: 7.4.17.6.1
Priority: normallow

comment:3 Changed 5 years ago by igloo

Milestone: 7.6.17.6.2

comment:4 Changed 3 years ago by thoughtpolice

Milestone: 7.6.27.10.1

Moving to 7.10.1.

comment:5 Changed 3 years ago by thomie

difficulty: Unknown
Status: newinfoneeded

mitar: please add an example to show the problem. What do you mean with "package is unusable?". Thanks.

comment:6 Changed 3 years ago by mitar

See here an example of exactly what I am talking about here and how it confuses users. So user here has issues using Haskell program and module is said to not exist: `Could not find module 'Data.Vector'`.

But then you can see such error:

package vector-0.10.0.1-3450daae3d9f2092020075d05481123c is unusable due to missing or recursive dependencies:
  base-4.5.1.0-81d626fb996bc7e140a3fd4481b338cd primitive-0.5.0.1-15cdc8c11a54a78809b647af0c2975b3

So instead of saying that that module is not found which make one think you just have to install it, something else should be said.

comment:7 Changed 3 years ago by thoughtpolice

Milestone: 7.10.17.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:8 Changed 3 years ago by thomie

Keywords: newcomer added

comment:9 Changed 3 years ago by thomie

Priority: lownormal
Status: infoneedednew

comment:10 Changed 3 years ago by lstrano

Owner: set to lstrano

comment:11 Changed 2 years ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:12 Changed 23 months ago by thomie

Milestone: 8.0.1

comment:13 Changed 19 months ago by mpickering

Owner: lstrano deleted

Please reassign if you still plan to work on this.

comment:14 Changed 16 months ago by Phyx-

Owner: set to bollu

comment:15 Changed 16 months ago by Phyx-

Cc: Phyx- added

comment:16 Changed 16 months ago by bollu

How do I reproduce this, exactly? If I'm fixing this, I'll need to know when the bug is fixed, so I was wondering what the correct way to reproduce this is. Do I damage my package database on purpose?

comment:17 Changed 16 months ago by Phyx-

@bollu, yeah, that seems like a reasonable thing to do, but I wouldn't go messing with your stage0 compiler (e.g. the one you use to compile the git source with the first time).

Just do a normal compile and corrpupt the stage2 compiler in the folder inplace that gets created.

comment:18 Changed 16 months ago by mpickering

You could also make a sandbox and damage the sandbox package database?

comment:19 Changed 16 months ago by Phyx-

Would the sandbox (I'm fuzzy on the details of it) also sandbox the actual package registration? e.g. does the sandbox copy the installed packages or just links to the ones already installed?

I must admit to not having used sandboxes before :)

comment:20 Changed 16 months ago by mpickering

They are installed in a completely separate database in ./.cabal-sandbox. So they or neither copied nor linked. I haven't understood this ticket but it's something that popped into my mind.

comment:21 Changed 15 months ago by Phyx-

Aha, no you're right, sandboxes would be ideal it sounds like.

comment:22 Changed 10 months ago by bollu

Owner: bollu deleted
Note: See TracTickets for help on using tickets.