Skip to content

better error message needed for missing package files

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.

Trac metadata
Trac field Value
Version 6.8.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information