summaryrefslogtreecommitdiff
path: root/compiler/main/Finder.lhs
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2014-08-22 14:38:10 +0100
committerEdward Z. Yang <ezyang@cs.stanford.edu>2014-08-29 12:39:04 +0100
commit27d6c089549a2ee815940e6630a54cb372bbbcd2 (patch)
treefbfc82a7ba5d66720b0edc0492ea261bd0cb2ac9 /compiler/main/Finder.lhs
parent8d7a1dcdbee47a980d0ecc8fa8e9336866a75d1b (diff)
downloadhaskell-27d6c089549a2ee815940e6630a54cb372bbbcd2.tar.gz
Use ghc-local types for packages, rather than Cabal types
Also start using the new package db file format properly, by using the ghc-specific section. This is the main patch in the series for removing the compiler's dep on the Cabal lib.
Diffstat (limited to 'compiler/main/Finder.lhs')
-rw-r--r--compiler/main/Finder.lhs19
1 files changed, 9 insertions, 10 deletions
diff --git a/compiler/main/Finder.lhs b/compiler/main/Finder.lhs
index f9c7e2eee0..8b9a5e9547 100644
--- a/compiler/main/Finder.lhs
+++ b/compiler/main/Finder.lhs
@@ -42,7 +42,6 @@ import UniqFM
import Maybes ( expectJust )
import Exception ( evaluate )
-import Distribution.Text
import Data.IORef ( IORef, writeIORef, readIORef, atomicModifyIORef )
import System.Directory
import System.FilePath
@@ -616,17 +615,17 @@ cantFindErr cannot_find _ dflags mod_name find_result
| otherwise =
hang (ptext (sLit "Locations searched:")) 2 $ vcat (map text files)
- pkg_hidden pkg =
- ptext (sLit "It is a member of the hidden package") <+> quotes (ppr pkg)
- <> dot $$ cabal_pkg_hidden_hint pkg
- cabal_pkg_hidden_hint pkg
+ pkg_hidden pkgid =
+ ptext (sLit "It is a member of the hidden package") <+> quotes (ppr pkgid)
+ --FIXME: we don't really want to show the package key here we should
+ -- show the source package id or installed package id if it's ambiguous
+ <> dot $$ cabal_pkg_hidden_hint pkgid
+ cabal_pkg_hidden_hint pkgid
| gopt Opt_BuildingCabalPackage dflags
- = case simpleParse (packageKeyString pkg) of
- Just pid ->
- ptext (sLit "Perhaps you need to add") <+>
- quotes (text (display (pkgName pid))) <+>
+ = let pkg = expectJust "cabal_pkg_hidden_hint" (lookupPackage dflags pkgid)
+ in ptext (sLit "Perhaps you need to add") <+>
+ quotes (ppr (packageName pkg)) <+>
ptext (sLit "to the build-depends in your .cabal file.")
- Nothing -> empty
| otherwise = empty
mod_hidden pkg =