X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FPackages.lhs;h=38e599600b3aa1a3b185b6e01093541425a2027e;hb=9c84f11b774960077d33d94a23ebc42af79d2ec4;hp=b080b95b1af4e5d4302d0ff4f3610d91abc39ce2;hpb=9e6ca39b5e90b7a4acc755e3e95cc3ef60940070;p=ghc-hetmet.git diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs index b080b95..38e5996 100644 --- a/compiler/main/Packages.lhs +++ b/compiler/main/Packages.lhs @@ -170,7 +170,7 @@ initPackages :: DynFlags -> IO (DynFlags, [PackageId]) initPackages dflags = do pkg_db <- case pkgDatabase dflags of Nothing -> readPackageConfigs dflags - Just db -> return db + Just db -> return $ maybeHidePackages dflags db (pkg_state, preload, this_pkg) <- mkPackageState dflags pkg_db [] (thisPackage dflags) return (dflags{ pkgDatabase = Just pkg_db, @@ -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 ": ") $$ @@ -419,7 +428,6 @@ findWiredInPackages dflags pkgs = do integerPackageId, basePackageId, rtsPackageId, - haskell98PackageId, thPackageId, dphSeqPackageId, dphParPackageId ]