X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FPackages.lhs;h=ff316aa02104678e4fd1ff0fbda295a9d4302b9e;hp=b080b95b1af4e5d4302d0ff4f3610d91abc39ce2;hb=8c8dc051ba58e394650ae3579a7d2eb67189b297;hpb=47c0fd27b2fbad86bdfa646e976fb45dcde59db6 diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs index b080b95..ff316aa 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 ": ") $$