diff options
author | Chaitanya Koparkar <ckoparkar@gmail.com> | 2018-05-03 12:39:45 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-05-03 12:39:55 -0400 |
commit | 721e82644b49da59e84c409562a63e7df75068bb (patch) | |
tree | c29522ea776858e0a51dc8e4b27f306ef174a3b6 /compiler/main | |
parent | 866525a1765715b8b9902e1bd53b9af1c7a93a30 (diff) | |
download | haskell-721e82644b49da59e84c409562a63e7df75068bb.tar.gz |
GHCi: Improve the error message for hidden packages
Test Plan: make test TEST=T15055
Reviewers: bgamari, RyanGlScott, osa1, Iceland_jack
Reviewed By: osa1
Subscribers: ulysses4ever, thomie, carter
GHC Trac Issues: #15055
Differential Revision: https://phabricator.haskell.org/D4621
Diffstat (limited to 'compiler/main')
-rw-r--r-- | compiler/main/Finder.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/main/Finder.hs b/compiler/main/Finder.hs index 2bfea5d37a..9568ac154c 100644 --- a/compiler/main/Finder.hs +++ b/compiler/main/Finder.hs @@ -667,14 +667,18 @@ cantFindErr cannot_find _ dflags mod_name find_result <+> quotes (ppr pkgid) --FIXME: we don't really want to show the unit id 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 + <> dot $$ pkg_hidden_hint pkgid + pkg_hidden_hint pkgid | gopt Opt_BuildingCabalPackage dflags = let pkg = expectJust "pkg_hidden" (lookupPackage dflags pkgid) in text "Perhaps you need to add" <+> quotes (ppr (packageName pkg)) <+> text "to the build-depends in your .cabal file." - | otherwise = Outputable.empty + | otherwise + = let pkg = expectJust "pkg_hidden" (lookupPackage dflags pkgid) + in text "You can run" <+> + quotes (text ":set -package " <> ppr (packageName pkg)) <+> + text "to expose it." mod_hidden pkg = text "it is a hidden module in the package" <+> quotes (ppr pkg) |