Ticket #2445 (closed merge: fixed)

Opened 5 years ago

Last modified 4 years ago

better error message needed for missing package files

Reported by: duncan Owned by: igloo
Priority: high Milestone: 6.10.2
Component: Compiler Version: 6.8.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Here's a real user's confusion:

~ $ ghci
GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
Prelude> :module Network
Could not find module `Network':
  Use -v to see a list of the files searched for.
Prelude> Leaving GHCi.
~ $ ghc-pkg list network
/usr/lib/ghc-6.8.2/package.conf:
    network-2.1.0.0
/home/sjm/.ghc/i386-linux-6.8.2/package.conf:
    network-2.2.0.0

Turns out the problem is that the network-2.2.0.0 package that is registered locally is messed up, the .hi files are missing, probably accidentally deleted.

In this situation the error message is not very helpful. The current error message makes sense in the context of local files since there is is quite reasonable for them to not exist however it's no good at all for the case of a module from a package. We know that the package exports that module so the file had better exist and if it does not, it's not simply a case of a missing file, the package is totally borked. The user needs to know that the package is borked so that they can unregister or reinstall it. The current message does not alert them to the real problem.

The message should say which package (including version) claims to provide the module and that files are missing from the installed package and as such the package is unusably broken and should be reinstalled.

Change History

Changed 5 years ago by igloo

  • difficulty set to Unknown
  • milestone set to 6.10 branch

Changed 5 years ago by duncan

It would be great if ghc-pkg check would also stat all the files that we know we need for each package (ie the .hi files for all modules and the library .a files) and report any borked packages.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by simonmar

  • priority changed from normal to high
  • milestone changed from 6.10 branch to 6.10.2

Changed 4 years ago by simonmar

  • owner set to simonmar

Changed 4 years ago by simonmar

  • owner changed from simonmar to igloo
  • type changed from bug to merge

Done:

Thu Jan 15 04:25:24 PST 2009  Simon Marlow <marlowsd@gmail.com>
  * More useful error message when a package .hi file cannot be found:

Thu Jan 15 04:21:43 PST 2009  Simon Marlow <marlowsd@gmail.com>
  * soup-up "ghc-pkg check"

Changed 4 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Both merged.

Note: See TracTickets for help on using tickets.