projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
47c0fd2
)
emit a helpful error message for missing DPH packages
author
Simon Marlow
<marlowsd@gmail.com>
Thu, 23 Sep 2010 14:19:57 +0000
(14:19 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Thu, 23 Sep 2010 14:19:57 +0000
(14:19 +0000)
compiler/main/Packages.lhs
patch
|
blob
|
history
diff --git
a/compiler/main/Packages.lhs
b/compiler/main/Packages.lhs
index
b080b95
..
ff316aa
100644
(file)
--- 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
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 ": ") $$
packageFlagErr flag reasons = ghcError (CmdLineError (showSDoc $ err))
where err = text "cannot satisfy " <> ppr_flag <>
(if null reasons then empty else text ": ") $$