summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-09-23 14:19:57 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-09-23 14:19:57 +0000
commit8c8dc051ba58e394650ae3579a7d2eb67189b297 (patch)
tree7e8f0646a70c3b23e3fd24765e14bce5aca7540e /compiler
parent47c0fd27b2fbad86bdfa646e976fb45dcde59db6 (diff)
downloadhaskell-8c8dc051ba58e394650ae3579a7d2eb67189b297.tar.gz
emit a helpful error message for missing DPH packages
Diffstat (limited to 'compiler')
-rw-r--r--compiler/main/Packages.lhs9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs
index b080b95b1a..ff316aa021 100644
--- a/compiler/main/Packages.lhs
+++ b/compiler/main/Packages.lhs
@@ -359,6 +359,15 @@ comparing f a b = f a `compare` f b
packageFlagErr :: PackageFlag
-> [(PackageConfig, UnusablePackageReason)]
-> IO a
+
+-- for missing DPH package we emit a more helpful error message, because
+-- this may be the result of using -fdph-par or -fdph-seq.
+packageFlagErr (ExposePackage pkg) [] | is_dph_package pkg
+ = ghcError (CmdLineError (showSDoc $ dph_err))
+ where dph_err = text "the " <> text pkg <> text " package is not installed."
+ $$ text "To install it: \"cabal install dph\"."
+ is_dph_package pkg = "dph" `isPrefixOf` pkg
+
packageFlagErr flag reasons = ghcError (CmdLineError (showSDoc $ err))
where err = text "cannot satisfy " <> ppr_flag <>
(if null reasons then empty else text ": ") $$